Beispiel #1
0
function edit()
{
    global $lang_global, $lang_item_templ, $lang_item, $lang_item_edit, $output, $world_db, $realm_id, $item_datasite, $lang_id_tab, $quest_datasite, $action_permission, $user_lvl, $creature_datasite;
    wowhead_tt();
    valid_login($action_permission['read']);
    if (!isset($_GET['entry'])) {
        redirect("item.php?error=1");
    }
    $sql = new SQL();
    $sql->connect($world_db[$realm_id]['addr'], $world_db[$realm_id]['user'], $world_db[$realm_id]['pass'], $world_db[$realm_id]['name']);
    $entry = $sql->quote_smart($_GET['entry']);
    $deplang = get_lang_id();
    $result = $sql->query("SELECT `item_template`.`entry`,`class`,`subclass`,`unk0`,IFNULL(" . ($deplang != 0 ? "name_loc{$deplang}" : "NULL") . ",`name`) as name,`displayid`,`Quality`,`Flags`,`BuyCount`,`BuyPrice`,`SellPrice`,`InventoryType`,`AllowableClass`,`AllowableRace`,`ItemLevel`,`RequiredLevel`,`RequiredSkill`,`RequiredSkillRank`,`requiredspell`,`requiredhonorrank`,`RequiredCityRank`,`RequiredReputationFaction`,`RequiredReputationRank`,`maxcount`,`stackable`,`ContainerSlots`,`stat_type1`,`stat_value1`,`stat_type2`,`stat_value2`,`stat_type3`,`stat_value3`,`stat_type4`,`stat_value4`,`stat_type5`,`stat_value5`,`stat_type6`,`stat_value6`,`stat_type7`,`stat_value7`,`stat_type8`,`stat_value8`,`stat_type9`,`stat_value9`,`stat_type10`,`stat_value10`,`dmg_min1`,`dmg_max1`,`dmg_type1`,`dmg_min2`,`dmg_max2`,`dmg_type2`,`armor`,`holy_res`,`fire_res`,`nature_res`,`frost_res`,`shadow_res`,`arcane_res`,`delay`,`ammo_type`,`RangedModRange`,`spellid_1`,`spelltrigger_1`,`spellcharges_1`,`spellppmRate_1`,`spellcooldown_1`,`spellcategory_1`,`spellcategorycooldown_1`,`spellid_2`,`spelltrigger_2`,`spellcharges_2`,`spellppmRate_2`,`spellcooldown_2`,`spellcategory_2`,`spellcategorycooldown_2`,`spellid_3`,`spelltrigger_3`,`spellcharges_3`,`spellppmRate_3`,`spellcooldown_3`,`spellcategory_3`,`spellcategorycooldown_3`,`spellid_4`,`spelltrigger_4`,`spellcharges_4`,`spellppmRate_4`,`spellcooldown_4`,`spellcategory_4`,`spellcategorycooldown_4`,`spellid_5`,`spelltrigger_5`,`spellcharges_5`,`spellppmRate_5`,`spellcooldown_5`,`spellcategory_5`,`spellcategorycooldown_5`,`bonding`,`description`,`PageText`,`LanguageID`,`PageMaterial`,`startquest`,`lockid`,`Material`,`sheath`,`RandomProperty`,`RandomSuffix`,`block`,`itemset`,`MaxDurability`,`area`,`Map`,`BagFamily`,`TotemCategory`,`socketColor_1`,`socketContent_1`,`socketColor_2`,`socketContent_2`,`socketColor_3`,`socketContent_3`,`socketBonus`,`GemProperties`,`RequiredDisenchantSkill`,`ArmorDamageModifier`,`ScriptName`,`DisenchantID`,`FoodType`,`minMoneyLoot`,`maxMoneyLoot` FROM item_template LEFT JOIN locales_item ON item_template.entry = locales_item.entry WHERE item_template.entry = '{$entry}'");
    if ($result) {
        $item = $sql->fetch_assoc($result);
        require_once "scripts/get_lib.php";
        //$tooltip = get_item_tooltip($entry);
        $output .= "<script type=\"text/javascript\" src=\"libs/js/tab.js\"></script>\n   <center>\n    <br /><br /><br />\n    <form method=\"post\" action=\"item.php?action=do_update\" name=\"form1\">\n    <input type=\"hidden\" name=\"backup_op\" value=\"0\"/>\n    <input type=\"hidden\" name=\"type\" value=\"edit\"/>\n    <input type=\"hidden\" name=\"entry\" value=\"{$entry}\"/>\n\n<div class=\"jtab-container\" id=\"container\">\n  <ul class=\"jtabs\">\n    <li><a href=\"#\" onclick=\"return showPane('pane1', this)\" id=\"tab1\">{$lang_item_edit['general_tab']}</a></li>\n    <li><a href=\"#\" onclick=\"return showPane('pane2', this)\">{$lang_item_edit['additional_tab']}</a></li>\n    <li><a href=\"#\" onclick=\"return showPane('pane3', this)\">{$lang_item_edit['stats_tab']}</a></li>\n  <li><a href=\"#\" onclick=\"return showPane('pane4', this)\">{$lang_item_edit['damage_tab']}</a></li>\n  <li><a href=\"#\" onclick=\"return showPane('pane5', this)\">{$lang_item_edit['spell_tab']}</a></li>\n  <li><a href=\"#\" onclick=\"return showPane('pane7', this)\">{$lang_item_edit['sock_tab']}</a></li>\n  <li><a href=\"#\" onclick=\"return showPane('pane6', this)\">{$lang_item_edit['req_tab']}</a></li>\n  <li><a href=\"#\" onclick=\"return showPane('pane8', this)\">{$lang_item_edit['info']}</a></li>";
        if ($item['DisenchantID']) {
            $output .= "<li><a href=\"#\" onclick=\"return showPane('pane9', this)\">{$lang_item_edit['disenchant_tab']}</a></li>";
        }
        $output .= "</ul>\n  <div class=\"jtab-panes\">";
        $output .= "<div id=\"pane1\">\n    <br /><br />\n<table class=\"lined\" style=\"width: 720px;\">\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['general']}:</td></tr>\n<tr>\n <td>" . makeinfocell($lang_item_edit['entry'], $lang_item_edit['entry_desc']) . "</td>\n <td>";
        //$output .= maketooltip($entry, "$item_datasite$entry", $tooltip, "item_tooltip");
        $output .= "</td>\n <td>" . makeinfocell($lang_item_edit['display_id'], $lang_item_edit['display_id_desc']) . "</td>\n <td><input type=\"text\" name=\"displayid\" size=\"8\" maxlength=\"11\" value=\"{$item['displayid']}\" /></td>\n\n <td>" . makeinfocell($lang_item_edit['req_level'], $lang_item_edit['req_level_desc']) . "</td>\n <td><input type=\"text\" name=\"RequiredLevel\" size=\"8\" maxlength=\"4\" value=\"{$item['RequiredLevel']}\" /></td>\n\n <td>" . makeinfocell($lang_item_edit['item_level'], $lang_item_edit['item_level_desc']) . "</td>\n <td><input type=\"text\" name=\"ItemLevel\" size=\"8\" maxlength=\"4\" value=\"{$item['ItemLevel']}\" /></td>\n</tr>\n\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['names']}:</td></tr>\n<tr>\n <td>" . makeinfocell($lang_item_edit['item_name'], $lang_item_edit['item_name_desc']) . "</td>\n <td colspan=\"3\"><input type=\"text\" name=\"name\" size=\"30\" maxlength=\"225\" value=\"{$item['name']}\" /></td>\n\n <td>" . makeinfocell($lang_item_edit['script_name'], $lang_item_edit['script_name_desc']) . "</td>\n <td colspan=\"3\"><input type=\"text\" name=\"ScriptName\" size=\"30\" maxlength=\"100\" value=\"{$item['ScriptName']}\" /></td>\n</tr>\n\n<tr>\n <td>" . makeinfocell($lang_item_edit['description'], $lang_item_edit['description_desc']) . "</td>\n <td colspan=\"3\"><input type=\"text\" name=\"description\" size=\"30\" maxlength=\"225\" value=\"{$item['description']}\" /></td>\n <td colspan=\"4\"></td>\n</tr>\n\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['type']}:</td></tr>\n   <tr>";
        $class = array(0 => "", 1 => "", 2 => "", 4 => "", 5 => "", 6 => "", 7 => "", 9 => "", 11 => "", 12 => "", 13 => "", 14 => "", 15 => "");
        $class[$item['class']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['class'], $lang_item_edit['class_desc']) . "</td>\n  <td colspan=\"3\"><select name=\"class\">\n    <option value=\"0\" {$class[0]}>0 - {$lang_item['consumable']}</option>\n    <option value=\"1\" {$class[1]}>1 - {$lang_item['bag']}</option>\n    <option value=\"2\" {$class[2]}>2 - {$lang_item['weapon']}</option>\n    <option value=\"4\" {$class[4]}>4 - {$lang_item['armor']}</option>\n    <option value=\"5\" {$class[5]}>5 - {$lang_item['reagent']}</option>\n    <option value=\"6\" {$class[6]}>6 - {$lang_item['projectile']}</option>\n    <option value=\"7\" {$class[7]}>7 - {$lang_item['trade_goods']}s</option>\n    <option value=\"9\" {$class[9]}>9 - {$lang_item['recipe']}</option>\n    <option value=\"11\" {$class[11]}>11 - {$lang_item['quiver']}</option>\n    <option value=\"12\" {$class[12]}>12 - {$lang_item['quest']}</option>\n    <option value=\"13\" {$class[13]}>13 - {$lang_item['key']}</option>\n    <option value=\"14\" {$class[14]}>14 - {$lang_item['permanent']}</option>\n    <option value=\"15\" {$class[15]}>15 - {$lang_item['misc_short']}</option>\n     </select></td>";
        unset($class);
        $subclass = array(0 => array(0 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => ""), 1 => array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => ""), 2 => array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 10 => "", 11 => "", 12 => "", 13 => "", 14 => "", 15 => "", 16 => "", 17 => "", 18 => "", 19 => "", 20 => ""), 4 => array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 9 => ""), 6 => array(2 => "", 3 => ""), 7 => array(0 => "", 1 => "", 2 => "", 3 => ""), 9 => array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => ""), 11 => array(2 => "", 3 => ""), 13 => array(0 => "", 1 => ""));
        $subclass[$item['class']][$item['subclass']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['subclass'], $lang_item_edit['subclass_desc']) . "</td>\n  <td colspan=\"3\"><select name=\"subclass\">\n    <option value=\"0\" {$subclass[0][0]}>0 - {$lang_item['none']}</option>\n    <optgroup label=\"Class 0: {$lang_item['consumable']}\">\n    <option value=\"0\" {$subclass[0][0]}>0 - {$lang_item['consumable']}</option>\n    <option value=\"3\" {$subclass[0][3]}>3 - {$lang_item['potion']}</option>\n    <option value=\"4\" {$subclass[0][4]}>4 - {$lang_item['scroll']}</option>\n    <option value=\"5\" {$subclass[0][5]}>5 - {$lang_item['bandage']}</option>\n    <option value=\"6\" {$subclass[0][6]}>6 - {$lang_item['healthstone']}</option>\n    <option value=\"7\" {$subclass[0][7]}>7 - {$lang_item['combat_effect']}</option>\n  <optgroup label=\"Class 1: {$lang_item['bag']}\">\n    <option value=\"0\" {$subclass[1][0]}>0 - {$lang_item['bag']}</option>\n    <option value=\"1\" {$subclass[1][1]}>1 - {$lang_item['soul_shards']}</option>\n    <option value=\"2\" {$subclass[1][2]}>2 - {$lang_item['herbs']}</option>\n    <option value=\"3\" {$subclass[1][3]}>3 - {$lang_item['enchanting']}</option>\n    <option value=\"4\" {$subclass[1][4]}>4 - {$lang_item['engineering']}</option>\n    <option value=\"5\" {$subclass[1][5]}>5 - {$lang_item['gems']}</option>\n    <option value=\"6\" {$subclass[1][6]}>6 - {$lang_item['mining']}</option>\n  <optgroup label=\"Class 2: {$lang_item['weapon']}\">\n    <option value=\"0\" {$subclass[2][0]}>0 - {$lang_item['axe_1h']}</option>\n    <option value=\"1\" {$subclass[2][2]}>1 - {$lang_item['axe_2h']}</option>\n    <option value=\"2\" {$subclass[2][2]}>2 - {$lang_item['bow']}</option>\n    <option value=\"3\" {$subclass[2][2]}>3 - {$lang_item['rifle']}</option>\n    <option value=\"4\" {$subclass[2][4]}>4 - {$lang_item['mace_1h']}</option>\n    <option value=\"5\" {$subclass[2][5]}>5 - {$lang_item['mace_2h']}</option>\n    <option value=\"6\" {$subclass[2][6]}>6 - {$lang_item['polearm']}</option>\n    <option value=\"7\" {$subclass[2][7]}>7 - {$lang_item['sword_1h']}</option>\n    <option value=\"8\" {$subclass[2][8]}>8 - {$lang_item['sword_2h']}</option>\n    <option value=\"10\" {$subclass[2][10]}>10 - {$lang_item['staff']}</option>\n    <option value=\"11\" {$subclass[2][11]}>11 - {$lang_item['exotic_1h']}</option>\n    <option value=\"12\" {$subclass[2][12]}>12 - {$lang_item['exotic_2h']}</option>\n    <option value=\"13\" {$subclass[2][13]}>13 - {$lang_item['fist_weapon']}</option>\n    <option value=\"14\" {$subclass[2][14]}>14 - {$lang_item['misc_weapon']}</option>\n    <option value=\"15\" {$subclass[2][15]}>15 - {$lang_item['dagger']}</option>\n    <option value=\"16\" {$subclass[2][16]}>16 - {$lang_item['thrown']}</option>\n    <option value=\"17\" {$subclass[2][17]}>17 - {$lang_item['spear']}</option>\n    <option value=\"18\" {$subclass[2][18]}>18 - {$lang_item['crossbow']}</option>\n    <option value=\"19\" {$subclass[2][19]}>19 - {$lang_item['wand']}</option>\n    <option value=\"20\" {$subclass[2][20]}>20 - {$lang_item['fishing_pole']}</option>\n  </optgroup>\n  <optgroup label=\"Class 4: {$lang_item['armor']}\">\n    <option value=\"0\" {$subclass[4][0]}>0 - {$lang_item['misc']}</option>\n    <option value=\"1\" {$subclass[4][1]}>1 - {$lang_item['cloth']}</option>\n    <option value=\"2\" {$subclass[4][2]}>2 - {$lang_item['leather']}</option>\n    <option value=\"3\" {$subclass[4][3]}>3 - {$lang_item['mail']}</option>\n    <option value=\"4\" {$subclass[4][4]}>4 - {$lang_item['plate']}</option>\n    <option value=\"5\" {$subclass[4][5]}>5 - {$lang_item['buckler']}</option>\n    <option value=\"6\" {$subclass[4][6]}>6 - {$lang_item['shield']}</option>\n    <option value=\"7\" {$subclass[4][7]}>7 - {$lang_item['libram']}</option>\n    <option value=\"8\" {$subclass[4][8]}>8 - {$lang_item['idol']}</option>\n    <option value=\"9\" {$subclass[4][9]}>9 - {$lang_item['totem']}</option>\n  </optgroup>\n  <optgroup label=\"Class 6: {$lang_item['projectile']}\">\n    <option value=\"2\" {$subclass[6][2]}>2 - {$lang_item['arrows']}</option>\n    <option value=\"3\" {$subclass[6][3]}>3 - {$lang_item['bullets']}</option>\n  </optgroup>\n  <optgroup label=\"Class 7: {$lang_item['trade_goods']}\">\n    <option value=\"0\" {$subclass[7][0]}>0 - {$lang_item['trade_goods']}</option>\n    <option value=\"1\" {$subclass[7][1]}>1 - {$lang_item['parts']}</option>\n    <option value=\"2\" {$subclass[7][2]}>2 - {$lang_item['explosives']}</option>\n    <option value=\"3\" {$subclass[7][3]}>3 - {$lang_item['devices']}</option>\n  </optgroup>\n  <optgroup label=\"Class 9: {$lang_item['recipe']}\">\n    <option value=\"0\" {$subclass[9][0]}>0 - {$lang_item['book']}</option>\n    <option value=\"1\" {$subclass[9][1]}>1 - {$lang_item['LW_pattern']}</option>\n    <option value=\"2\" {$subclass[9][2]}>2 - {$lang_item['tailoring_pattern']}</option>\n    <option value=\"3\" {$subclass[9][3]}>3 - {$lang_item['ENG_Schematic']}</option>\n    <option value=\"4\" {$subclass[9][4]}>4 - {$lang_item['BS_plans']}</option>\n    <option value=\"5\" {$subclass[9][5]}>5 - {$lang_item['cooking_recipe']}</option>\n    <option value=\"6\" {$subclass[9][6]}>6 - {$lang_item['alchemy_recipe']}</option>\n    <option value=\"7\" {$subclass[9][7]}>7 - {$lang_item['FA_manual']}</option>\n    <option value=\"8\" {$subclass[9][8]}>8 - {$lang_item['ench_formula']}</option>\n    <option value=\"9\" {$subclass[9][9]}>9 - {$lang_item['fishing_manual']}</option>\n    <option value=\"10\" {$subclass[9][10]}>10 - {$lang_item['JC_formula']}</option>\n  </optgroup>\n  <optgroup label=\"Class 11: {$lang_item['quiver']}\">\n    <option value=\"2\" {$subclass[11][2]}>2 - {$lang_item['quiver']}</option>\n    <option value=\"3\" {$subclass[11][3]}>3 - {$lang_item['ammo_pouch']}</option>\n  </optgroup>\n  <optgroup label=\"Class 13: {$lang_item['key']}\">\n    <option value=\"0\" {$subclass[13][0]}>0 - {$lang_item['key']}</option>\n    <option value=\"1\" {$subclass[13][1]}>1 - {$lang_item['lockpick']}</option>\n  </optgroup>\n </select></td>\n</tr>\n<tr>";
        unset($subclass);
        $quality = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "");
        $quality[$item['Quality']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['quality'], $lang_item_edit['quality_desc']) . "</td>\n   <td colspan=\"2\"><select name=\"Quality\">\n    <option value=\"0\" {$quality[0]}>0 - {$lang_item['poor']}</option>\n    <option value=\"1\" {$quality[1]}>1 - {$lang_item['common']}</option>\n    <option value=\"2\" {$quality[2]}>2 - {$lang_item['uncommon']}</option>\n    <option value=\"3\" {$quality[3]}>3 - {$lang_item['rare']}</option>\n    <option value=\"4\" {$quality[4]}>4 - {$lang_item['epic']}</option>\n    <option value=\"5\" {$quality[5]}>5 - {$lang_item['legendary']}</option>\n    <option value=\"6\" {$quality[6]}>6 - {$lang_item['artifact']}</option>\n     </select></td>";
        unset($quality);
        $inv_type = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => "", 11 => "", 12 => "", 13 => "", 14 => "", 15 => "", 16 => "", 17 => "", 18 => "", 19 => "", 20 => "", 21 => "", 22 => "", 23 => "", 24 => "", 25 => "", 26 => "");
        $inv_type[$item['InventoryType']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['inv_type'], $lang_item_edit['inv_type_desc']) . "</td>\n    <td colspan=\"2\"><select name=\"InventoryType\">\n    <option value=\"0\" {$inv_type[0]}>0 - {$lang_item['other']}</option>\n    <option value=\"1\" {$inv_type[1]}>1 - {$lang_item['head']}</option>\n    <option value=\"2\" {$inv_type[2]}>2 - {$lang_item['neck']}</option>\n    <option value=\"3\" {$inv_type[3]}>3 - {$lang_item['shoulder']}</option>\n    <option value=\"4\" {$inv_type[4]}>4 - {$lang_item['shirt']}</option>\n    <option value=\"5\" {$inv_type[5]}>5 - {$lang_item['chest']}</option>\n    <option value=\"6\" {$inv_type[6]}>6 - {$lang_item['belt']}</option>\n    <option value=\"7\" {$inv_type[7]}>7 - {$lang_item['legs']}</option>\n    <option value=\"8\" {$inv_type[8]}>8 - {$lang_item['feet']}</option>\n    <option value=\"9\" {$inv_type[9]}>9 - {$lang_item['belt']}</option>\n    <option value=\"10\" {$inv_type[10]}>10 - {$lang_item['gloves']}</option>\n    <option value=\"11\" {$inv_type[11]}>11 - {$lang_item['finger']}</option>\n    <option value=\"12\" {$inv_type[12]}>12 - {$lang_item['trinket']}</option>\n    <option value=\"13\" {$inv_type[13]}>13 - {$lang_item['one_hand']}</option>\n    <option value=\"14\" {$inv_type[14]}>14 - {$lang_item['off_hand']}</option>\n    <option value=\"15\" {$inv_type[15]}>15 - {$lang_item['bow']}</option>\n    <option value=\"16\" {$inv_type[16]}>16 - {$lang_item['back']}</option>\n    <option value=\"17\" {$inv_type[17]}>17 - {$lang_item['two_hand']}</option>\n    <option value=\"18\" {$inv_type[18]}>18 - {$lang_item['bag']}</option>\n    <option value=\"19\" {$inv_type[19]}>19 - {$lang_item['tabard']}</option>\n    <option value=\"20\" {$inv_type[20]}>20 - {$lang_item['robe']}</option>\n    <option value=\"21\" {$inv_type[21]}>21 - {$lang_item['main_hand']}</option>\n    <option value=\"22\" {$inv_type[22]}>22 - {$lang_item['off_misc']}</option>\n    <option value=\"23\" {$inv_type[23]}>23 - {$lang_item['tome']}</option>\n    <option value=\"24\" {$inv_type[24]}>24 - {$lang_item['projectile']}</option>\n    <option value=\"25\" {$inv_type[25]}>25 - {$lang_item['thrown']}</option>\n    <option value=\"26\" {$inv_type[26]}>26 - {$lang_item['rifle']}</option>\n     </select></td>\n\n     <td>" . makeinfocell($lang_item_edit['flags'], $lang_item_edit['flags_desc']) . "</td>\n     <td><input type=\"text\" name=\"Flags\" size=\"10\" maxlength=\"30\" value=\"{$item['Flags']}\" /></td>\n     </tr>\n\n     <tr>\n     <td>" . makeinfocell($lang_item_edit['item_set'], $lang_item_edit['item_set_desc']) . "</td>\n     <td><input type=\"text\" name=\"itemset\" size=\"10\" maxlength=\"30\" value=\"{$item['itemset']}\" /></td>";
        unset($inv_type);
        $bonding = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "");
        $bonding[$item['bonding']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['bonding'], $lang_item_edit['bonding_desc']) . "</td>\n   <td colspan=\"3\"><select name=\"bonding\">\n    <option value=\"0\" {$bonding[0]}>0 - {$lang_item['no_bind']}</option>\n    <option value=\"1\" {$bonding[1]}>1 - {$lang_item['bop']}</option>\n    <option value=\"2\" {$bonding[2]}>2 - {$lang_item['boe']}</option>\n    <option value=\"3\" {$bonding[3]}>3 - {$lang_item['bou']}</option>\n    <option value=\"4\" {$bonding[4]}>4 - {$lang_item['quest_item']}</option>\n    <option value=\"5\" {$bonding[5]}>5 - {$lang_item['quest_item']}1</option>\n     </select></td>\n\n<td>" . makeinfocell($lang_item_edit['start_quest'], $lang_item_edit['start_quest_desc']) . "</td>\n<td><input type=\"text\" name=\"startquest\" size=\"10\" maxlength=\"30\" value=\"{$item['startquest']}\" /></td>\n\n</tr>\n</table>\n<br />{$lang_item_edit['short_rules_desc']}<br /><br />\n</div>";
        unset($bonding);
        $output .= "<div id=\"pane2\">\n  <br /><br /><table class=\"lined\" style=\"width: 720px;\">\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['vendor']}:</td></tr>\n  <tr>\n   <td>" . makeinfocell($lang_item_edit['buy_count'], $lang_item_edit['buy_count_desc']) . "</td>\n   <td><input type=\"text\" name=\"BuyCount\" size=\"8\" maxlength=\"3\" value=\"{$item['BuyCount']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['buy_price'], $lang_item_edit['buy_price_desc']) . "</td>\n   <td><input type=\"text\" name=\"BuyPrice\" size=\"8\" maxlength=\"30\" value=\"{$item['BuyPrice']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['sell_price'], $lang_item_edit['sell_price_desc']) . "</td>\n   <td><input type=\"text\" name=\"SellPrice\" size=\"8\" maxlength=\"30\" value=\"{$item['SellPrice']}\" /></td>\n   <td></td><td></td>\n  </tr>\n\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['container']}:</td></tr>\n  <tr>\n\n    <td>" . makeinfocell($lang_item_edit['max_count'], $lang_item_edit['max_count_desc']) . "</td>\n    <td><input type=\"text\" name=\"maxcount\" size=\"6\" maxlength=\"5\" value=\"{$item['maxcount']}\" /></td>\n\n    <td>" . makeinfocell($lang_item_edit['stackable'], $lang_item_edit['stackable_desc']) . "</td>\n    <td><input type=\"text\" name=\"stackable\" size=\"6\" maxlength=\"5\" value=\"{$item['stackable']}\" /></td>\n\n    <td>" . makeinfocell($lang_item_edit['bag_family'], $lang_item_edit['bag_family_desc']) . "</td>";
        $bagfamily = array(0 => "", 1 => "", 2 => "", 3 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => "", 12 => "");
        $bagfamily[$item['BagFamily']] = " selected=\"selected\" ";
        $output .= "<td><select name=\"BagFamily\">\n    <option value=\"0\" {$bagfamily[0]}>0 - {$lang_item['none']}</option>\n    <option value=\"1\" {$bagfamily[1]}>1 - {$lang_item['arrows']}</option>\n    <option value=\"2\" {$bagfamily[2]}>2 - {$lang_item['bullets']}</option>\n    <option value=\"3\" {$bagfamily[3]}>3 - {$lang_item['soul_shards']}</option>\n    <option value=\"6\" {$bagfamily[6]}>6 - {$lang_item['herbs']}</option>\n    <option value=\"7\" {$bagfamily[7]}>7 - {$lang_item['enchanting']}</option>\n    <option value=\"8\" {$bagfamily[8]}>8 - {$lang_item['engineering']}</option>\n    <option value=\"9\" {$bagfamily[9]}>9 - {$lang_item['keys']}</option>\n    <option value=\"10\" {$bagfamily[10]}>10 - {$lang_item['gems']}</option>\n    <option value=\"12\" {$bagfamily[12]}>12 - {$lang_item['mining']}</option>\n     </select></td>\n  <td>" . makeinfocell($lang_item_edit['bag_slots'], $lang_item_edit['bag_slots_desc']) . "</td>\n  <td><input type=\"text\" name=\"ContainerSlots\" size=\"10\" maxlength=\"3\" value=\"{$item['ContainerSlots']}\" /></td>\n  </tr>\n  <tr>\n\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['materials']}:</td></tr>";
        unset($bagfamily);
        $Material = array(-1 => "", 0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "");
        $Material[$item['Material']] = " selected=\"selected\" ";
        $output .= "<tr>\n  <td>" . makeinfocell($lang_item_edit['material'], $lang_item_edit['material_desc']) . "</td>\n   <td colspan=\"2\"><select name=\"Material\">\n    <option value=\"-1\" {$Material[-1]}>-1 - {$lang_item_edit['consumables']}</option>\n    <option value=\"0\" {$Material[0]}>0 - {$lang_item_edit['none']}</option>\n    <option value=\"1\" {$Material[1]}>1 - {$lang_item_edit['metal']}</option>\n    <option value=\"2\" {$Material[2]}>2 - {$lang_item_edit['wood']}</option>\n    <option value=\"3\" {$Material[3]}>3 - {$lang_item_edit['liquid']}</option>\n    <option value=\"4\" {$Material[4]}>4 - {$lang_item_edit['jewelry']}</option>\n    <option value=\"5\" {$Material[5]}>5 - {$lang_item_edit['chain']}</option>\n    <option value=\"6\" {$Material[6]}>6 - {$lang_item_edit['plate']}</option>\n    <option value=\"7\" {$Material[7]}>7 - {$lang_item_edit['cloth']}</option>\n    <option value=\"8\" {$Material[8]}>8 - {$lang_item_edit['leather']}</option>\n     </select></td>";
        unset($Material);
        $PageMaterial = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "");
        $PageMaterial[$item['PageMaterial']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['page_material'], $lang_item_edit['page_material_desc']) . "</td>\n   <td colspan=\"2\"><select name=\"PageMaterial\">\n    <option value=\"0\" {$PageMaterial[0]}>0 - {$lang_item_edit['none']}</option>\n    <option value=\"1\" {$PageMaterial[1]}>1 - {$lang_item_edit['parchment']}</option>\n    <option value=\"2\" {$PageMaterial[2]}>2 - {$lang_item_edit['stone']}</option>\n    <option value=\"3\" {$PageMaterial[3]}>3 - {$lang_item_edit['marble']}</option>\n    <option value=\"4\" {$PageMaterial[4]}>4 - {$lang_item_edit['silver']}</option>\n    <option value=\"5\" {$PageMaterial[5]}>5 - {$lang_item_edit['bronze']}</option>\n     </select></td>";
        unset($PageMaterial);
        $output .= "<td>" . makeinfocell($lang_item_edit['max_durability'], $lang_item_edit['max_durability_desc']) . "</td>\n  <td><input type=\"text\" name=\"MaxDurability\" size=\"8\" maxlength=\"30\" value=\"{$item['MaxDurability']}\" /></td>\n</tr>\n\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['RandomProperty']}:</td></tr>\n<tr>\n   <td colspan=\"2\">" . makeinfocell($lang_item_edit['RandomProperty'], $lang_item_edit['RandomProperty_desc']) . "</td>\n   <td colspan=\"2\"><input type=\"text\" name=\"RandomProperty\" size=\"8\" maxlength=\"30\" value=\"{$item['RandomProperty']}\" /></td>\n\n   <td colspan=\"2\">" . makeinfocell($lang_item_edit['RandomSuffix'], $lang_item_edit['RandomSuffix_desc']) . "</td>\n   <td colspan=\"2\"><input type=\"text\" name=\"RandomSuffix\" size=\"8\" maxlength=\"10\" value=\"{$item['RandomSuffix']}\" /></td>\n</tr>\n\n\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['other']}:</td></tr>\n  <tr>\n   <td>" . makeinfocell($lang_item_edit['area'], $lang_item_edit['area_desc']) . "</td>\n   <td><input type=\"text\" name=\"area\" size=\"8\" maxlength=\"10\" value=\"{$item['area']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['map'], $lang_item_edit['map_desc']) . "</td>\n   <td><input type=\"text\" name=\"Map\" size=\"8\" maxlength=\"10\" value=\"{$item['Map']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['page_text'], $lang_item_edit['page_text_desc']) . "</td>\n   <td><input type=\"text\" name=\"PageText\" size=\"6\" maxlength=\"30\" value=\"{$item['PageText']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['unk0'], $lang_item_edit['unk0_desc']) . "</td>\n   <td><input type=\"text\" name=\"unk0\" size=\"8\" maxlength=\"10\" value=\"{$item['unk0']}\" /></td>\n  </tr>\n  <tr>\n\n    <tr>\n   <td colspan=\"2\">" . makeinfocell($lang_item_edit['disenchant_id'], $lang_item_edit['disenchant_id_desc']) . "</td>\n   <td><input type=\"text\" name=\"DisenchantID\" size=\"10\" maxlength=\"10\" value=\"{$item['DisenchantID']}\" /></td>\n\n   <td colspan=\"2\">" . makeinfocell($lang_item_edit['req_skill_disenchant'], $lang_item_edit['req_skill_disenchant_desc']) . "</td>\n   <td><input type=\"text\" name=\"RequiredDisenchantSkill\" size=\"10\" maxlength=\"10\" value=\"{$item['RequiredDisenchantSkill']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['lock_id'], $lang_item_edit['lock_id_desc']) . "</td>\n   <td><input type=\"text\" name=\"lockid\" size=\"8\" maxlength=\"30\" value=\"{$item['lockid']}\" /></td>\n  </tr>";
        $LanguageID = array(0 => "", 1 => "", 2 => "", 3 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => "", 11 => "", 12 => "", 13 => "", 14 => "", 33 => "");
        $LanguageID[$item['LanguageID']] = " selected=\"selected\" ";
        $output .= "<tr>\n  <td>" . makeinfocell($lang_item_edit['lang_id'], $lang_item_edit['lang_id_desc']) . "</td>\n   <td colspan=\"2\"><select name=\"LanguageID\">\n    <option value=\"0\" {$LanguageID[0]}>0 - {$lang_item_edit['other']}</option>\n    <option value=\"1\" {$LanguageID[1]}>1 - Orcish</option>\n    <option value=\"2\" {$LanguageID[2]}>2 - Darnassian</option>\n    <option value=\"3\" {$LanguageID[3]}>3 - Taurahe</option>\n    <option value=\"6\" {$LanguageID[6]}>6 - Dwarvish</option>\n    <option value=\"7\" {$LanguageID[7]}>7 - Common</option>\n    <option value=\"8\" {$LanguageID[8]}>8 - Demonic</option>\n    <option value=\"9\" {$LanguageID[9]}>9 - Titan</option>\n    <option value=\"10\" {$LanguageID[10]}>10 - Thelassian</option>\n    <option value=\"11\" {$LanguageID[11]}>11 - Draconic</option>\n    <option value=\"12\" {$LanguageID[12]}>12 - Kalimag</option>\n    <option value=\"13\" {$LanguageID[13]}>13 - Gnomish</option>\n    <option value=\"14\" {$LanguageID[14]}>14 - Troll</option>\n    <option value=\"33\" {$LanguageID[33]}>33 - Gutterspeak</option>\n     </select></td>";
        unset($LanguageID);
        $sheath = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 7 => "");
        $sheath[$item['sheath']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['sheath'], $lang_item_edit['sheath_desc']) . "</td>\n   <td colspan=\"2\"><select name=\"sheath\">\n    <option value=\"0\" {$sheath[0]}>0 - {$lang_item_edit['other']}</option>\n    <option value=\"1\" {$sheath[1]}>1 - {$lang_item['sword_2h']}</option>\n    <option value=\"2\" {$sheath[2]}>2 - {$lang_item['staff']}</option>\n    <option value=\"3\" {$sheath[3]}>3 - {$lang_item['sword_1h']}</option>\n    <option value=\"4\" {$sheath[4]}>4 - {$lang_item['shield']}</option>\n    <option value=\"5\" {$sheath[5]}>5 - {$lang_item['rod']}</option>\n    <option value=\"7\" {$sheath[7]}>7 - {$lang_item['off_hand']}</option>\n     </select></td>\n\n   <td>" . makeinfocell($lang_item_edit['totem_category'], $lang_item_edit['totem_category_desc']) . "</td>\n   <td><input type=\"text\" name=\"TotemCategory\" size=\"8\" maxlength=\"10\" value=\"{$item['TotemCategory']}\" /></td>\n  </tr>\n\n   </table><br /><br />\n    </div>";
        unset($sheath);
        $output .= "<div id=\"pane3\">\n   <br /><br /><table class=\"lined\" style=\"width: 720px;\">\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['stats']}:</td></tr>\n  <tr>\n\n  <td>" . makeinfocell($lang_item_edit['stat_type'] . " 1", $lang_item_edit['stat_type_desc']) . "</td>\n   <td><select name=\"stat_type1\">";
        output_status_options($item['stat_type1']);
        $output .= "</select></td>\n\n  <td><input type=\"text\" name=\"stat_value1\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value1']}\" /></td>\n  <td>" . makeinfocell($lang_item_edit['stat_type'] . " 2", $lang_item_edit['stat_type_desc']) . "</td>\n   <td><select name=\"stat_type2\">";
        output_status_options($item['stat_type2']);
        $output .= "</select></td>\n\n   <td><input type=\"text\" name=\"stat_value2\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value2']}\" /></td>\n  </tr>\n <tr>\n  <td>" . makeinfocell($lang_item_edit['stat_type'] . " 3", $lang_item_edit['stat_type_desc']) . "</td>\n  <td><select name=\"stat_type3\">";
        output_status_options($item['stat_type3']);
        $output .= "</select></td>\n\n  <td><input type=\"text\" name=\"stat_value3\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value3']}\" /></td>\n  <td>" . makeinfocell($lang_item_edit['stat_type'] . " 4", $lang_item_edit['stat_type_desc']) . "</td>\n   <td><select name=\"stat_type4\">";
        output_status_options($item['stat_type4']);
        $output .= "</select></td>\n\n   <td><input type=\"text\" name=\"stat_value4\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value4']}\" /></td>\n  </tr>\n<tr>\n <td>" . makeinfocell($lang_item_edit['stat_type'] . " 5", $lang_item_edit['stat_type_desc']) . "</td>\n <td><select name=\"stat_type5\">";
        output_status_options($item['stat_type5']);
        $output .= "</select></td>\n\n   <td><input type=\"text\" name=\"stat_value5\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value5']}\" /></td>\n  <td>" . makeinfocell($lang_item_edit['stat_type'] . " 6", $lang_item_edit['stat_type_desc']) . "</td>\n   <td><select name=\"stat_type6\">";
        output_status_options($item['stat_type1']);
        $output .= "</select></td>\n\n   <td><input type=\"text\" name=\"stat_value6\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value6']}\" /></td>\n  </tr>\n<tr>\n <td>" . makeinfocell($lang_item_edit['stat_type'] . " 7", $lang_item_edit['stat_type_desc']) . "</td>\n   <td><select name=\"stat_type7\">";
        output_status_options($item['stat_type7']);
        $output .= "</select></td>\n  <td><input type=\"text\" name=\"stat_value7\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value7']}\" /></td>\n  <td>" . makeinfocell($lang_item_edit['stat_type'] . " 8", $lang_item_edit['stat_type_desc']) . "</td>\n   <td><select name=\"stat_type8\">";
        output_status_options($item['stat_type8']);
        $output .= "</select></td>\n\n   <td><input type=\"text\" name=\"stat_value8\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value8']}\" /></td>\n  </tr>\n<tr>\n  <td>" . makeinfocell($lang_item_edit['stat_type'] . " 9", $lang_item_edit['stat_type_desc']) . "</td>\n  <td><select name=\"stat_type9\">";
        output_status_options($item['stat_type9']);
        $output .= "</select></td>\n  <td><input type=\"text\" name=\"stat_value9\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value9']}\" /></td>\n  <td>" . makeinfocell($lang_item_edit['stat_type'] . " 10", $lang_item_edit['stat_type_desc']) . "</td>\n   <td><select name=\"stat_type10\">";
        output_status_options($item['stat_type10']);
        $output .= "</select></td>\n\n   <td><input type=\"text\" name=\"stat_value10\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value10']}\" /></td>\n  </tr>\n\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['resis_armor']}:</td></tr>\n   <tr>\n   <td colspan=\"2\">" . makeinfocell($lang_item['armor'], $lang_item_edit['armor_desc']) . "</td>\n   <td><input type=\"text\" name=\"armor\" size=\"10\" maxlength=\"30\" value=\"{$item['armor']}\" /></td>\n\n   <td colspan=\"2\">" . makeinfocell($lang_item['block'], $lang_item_edit['block_desc']) . "</td>\n   <td><input type=\"text\" name=\"block\" size=\"10\" maxlength=\"30\" value=\"{$item['block']}\" /></td>\n   </tr>\n   <tr>\n   <td colspan=\"2\">" . makeinfocell($lang_item['res_holy'], $lang_item_edit['res_holy_desc']) . "</td>\n   <td><input type=\"text\" name=\"holy_res\" size=\"10\" maxlength=\"30\" value=\"{$item['holy_res']}\" /></td>\n\n   <td colspan=\"2\">" . makeinfocell($lang_item['res_fire'], $lang_item_edit['res_fire_desc']) . "</td>\n   <td><input type=\"text\" name=\"fire_res\" size=\"10\" maxlength=\"30\" value=\"{$item['fire_res']}\" /></td>\n   </tr>\n   <tr>\n   <td colspan=\"2\">" . makeinfocell($lang_item['res_nature'], $lang_item_edit['res_nature_desc']) . "</td>\n   <td><input type=\"text\" name=\"nature_res\" size=\"10\" maxlength=\"30\" value=\"{$item['nature_res']}\" /></td>\n\n   <td colspan=\"2\">" . makeinfocell($lang_item['res_frost'], $lang_item_edit['res_frost_desc']) . "</td>\n   <td><input type=\"text\" name=\"frost_res\" size=\"10\" maxlength=\"30\" value=\"{$item['frost_res']}\" /></td>\n   </tr>\n   <tr>\n   <td colspan=\"2\">" . makeinfocell($lang_item['res_shadow'], $lang_item_edit['res_shadow_desc']) . "</td>\n   <td><input type=\"text\" name=\"shadow_res\" size=\"10\" maxlength=\"30\" value=\"{$item['shadow_res']}\" /></td>\n\n   <td colspan=\"2\">" . makeinfocell($lang_item['res_arcane'], $lang_item_edit['res_arcane_desc']) . "</td>\n   <td><input type=\"text\" name=\"arcane_res\" size=\"10\" maxlength=\"30\" value=\"{$item['arcane_res']}\" /></td>\n   </tr>\n\n    </table><br /><br />\n    </div>";
        $output .= "<div id=\"pane4\">\n     <br /><br /><table class=\"lined\" style=\"width: 720px;\">\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['weapon_properties']}:</td></tr>\n<tr>\n <td>" . makeinfocell($lang_item_edit['delay'], $lang_item_edit['delay_desc']) . "</td>\n <td colspan=\"2\"><input type=\"text\" name=\"delay\" size=\"10\" maxlength=\"11\" value=\"{$item['delay']}\" /></td>\n\n <td>" . makeinfocell($lang_item_edit['ranged_mod'], $lang_item_edit['ranged_mod_desc']) . "</td>\n <td colspan=\"2\"><input type=\"text\" name=\"RangedModRange\" size=\"10\" maxlength=\"40\" value=\"{$item['RangedModRange']}\" /></td>\n</tr>\n<tr>\n <td>" . makeinfocell($lang_item_edit['armor_dmg_mod'], $lang_item_edit['armor_dmg_mod_desc']) . "</td>\n <td colspan=\"2\"><input type=\"text\" name=\"ArmorDamageModifier\" size=\"10\" maxlength=\"40\" value=\"{$item['ArmorDamageModifier']}\" /></td>";
        $ammo_type = array(0 => "", 2 => "", 3 => "");
        $ammo_type[$item['ammo_type']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['ammo_type'], $lang_item_edit['ammo_type_desc']) . "</td>\n   <td colspan=\"2\"><select name=\"ammo_type\">\n    <option value=\"0\" {$ammo_type[0]}>0 - {$lang_item['none']}</option>\n    <option value=\"2\" {$ammo_type[2]}>2 - {$lang_item['arrows']}</option>\n    <option value=\"3\" {$ammo_type[3]}>3 - {$lang_item['bullets']}</option>\n     </select></td>\n</tr>\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_item_edit['weapon_damage']}:</td></tr>\n<tr>";
        unset($ammo_type);
        $output .= "<td>" . makeinfocell($lang_item_edit['damage_type'] . " 1", $lang_item_edit['damage_type_desc']) . "</td>\n   <td colspan=\"2\"><select name=\"dmg_type1\">";
        output_dmgtype_options($item['dmg_type1']);
        $output .= "</select></td>\n\n   <td>" . makeinfocell($lang_item_edit['dmg_min_max'], $lang_item_edit['dmg_min_max_desc']) . "</td>\n   <td colspan=\"4\"><input type=\"text\" name=\"dmg_min1\" size=\"8\" maxlength=\"45\" value=\"{$item['dmg_min1']}\" /> - <input type=\"text\" name=\"dmg_max1\" size=\"8\" maxlength=\"45\" value=\"{$item['dmg_max1']}\" /></td>\n\n</tr>\n<tr>\n  <td>" . makeinfocell($lang_item_edit['damage_type'] . " 2", $lang_item_edit['damage_type_desc']) . "</td>\n   <td colspan=\"2\"><select name=\"dmg_type2\">";
        output_dmgtype_options($item['dmg_type2']);
        $output .= "</select></td>\n\n   <td>" . makeinfocell($lang_item_edit['dmg_min_max'], $lang_item_edit['dmg_min_max_desc']) . "</td>\n   <td colspan=\"4\"><input type=\"text\" name=\"dmg_min2\" size=\"8\" maxlength=\"45\" value=\"{$item['dmg_min2']}\" /> - <input type=\"text\" name=\"dmg_max2\" size=\"8\" maxlength=\"45\" value=\"{$item['dmg_max2']}\" /></td>\n\n</tr>\n</table><br /><br />\n    </div>";
        $output .= "<div id=\"pane5\">\n     <br /><br /><table class=\"lined\" style=\"width: 720px;\">\n<tr>\n   <td colspan=\"2\">{$lang_item_edit['item_spell']} 1</td>\n   <td>" . makeinfocell($lang_item_edit['spell_id'], $lang_item_edit['spell_id_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellid_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_1']}\" /></td>";
        $spelltrigger_1 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_1[$item['spelltrigger_1']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['spell_trigger'], $lang_item_edit['spell_trigger_desc']) . "</td>\n   <td><select name=\"spelltrigger_1\">\n    <option value=\"0\" {$spelltrigger_1[0]}>0: {$lang_item['spell_use']}</option>\n    <option value=\"1\" {$spelltrigger_1[1]}>1: {$lang_item['spell_equip']}</option>\n    <option value=\"2\" {$spelltrigger_1[2]}>2: {$lang_item['spell_coh']}</option>\n    <option value=\"4\" {$spelltrigger_1[4]}>4: {$lang_item['soul_stone']}</option>\n    </select></td>\n   <td>" . makeinfocell($lang_item_edit['spell_charges'], $lang_item_edit['spell_charges_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcharges_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_1']}\" /></td>\n</tr>\n<tr>\n   <td>" . makeinfocell($lang_item_edit['spell_cooldown'], $lang_item_edit['spell_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcooldown_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_1']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category'], $lang_item_edit['spell_category_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategory_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_1']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category_cooldown'], $lang_item_edit['spell_category_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategorycooldown_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_1']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['ppm_rate'], $lang_item_edit['ppm_rate_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellppmRate_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellppmRate_1']}\" /></td>\n</tr>\n<tr><td colspan=\"6\" class=\"hidden\"></td></tr>\n<tr>\n   <td colspan=\"2\">{$lang_item_edit['item_spell']} 2</td>\n   <td>" . makeinfocell($lang_item_edit['spell_id'], $lang_item_edit['spell_id_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellid_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_2']}\" /></td>";
        unset($spelltrigger_1);
        $spelltrigger_2 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_2[$item['spelltrigger_2']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['spell_trigger'], $lang_item_edit['spell_trigger_desc']) . "</td>\n   <td><select name=\"spelltrigger_2\">\n    <option value=\"0\" {$spelltrigger_2[0]}>0: {$lang_item['spell_use']}</option>\n    <option value=\"1\" {$spelltrigger_2[1]}>1: {$lang_item['spell_equip']}</option>\n    <option value=\"2\" {$spelltrigger_2[2]}>2: {$lang_item['spell_coh']}</option>\n    <option value=\"4\" {$spelltrigger_2[4]}>4: {$lang_item['soul_stone']}</option>\n    </select></td>\n   <td>" . makeinfocell($lang_item_edit['spell_charges'], $lang_item_edit['spell_charges_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcharges_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_2']}\" /></td>\n</tr>\n<tr>\n   <td>" . makeinfocell($lang_item_edit['spell_cooldown'], $lang_item_edit['spell_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcooldown_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_2']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category'], $lang_item_edit['spell_category_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategory_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_2']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category_cooldown'], $lang_item_edit['spell_category_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategorycooldown_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_2']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['ppm_rate'], $lang_item_edit['ppm_rate_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellppmRate_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellppmRate_2']}\" /></td>\n</tr>\n<tr><td colspan=\"6\" class=\"hidden\"></td></tr>\n<tr>\n   <td colspan=\"2\">{$lang_item_edit['item_spell']} 3</td>\n   <td>" . makeinfocell($lang_item_edit['spell_id'], $lang_item_edit['spell_id_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellid_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_3']}\" /></td>";
        unset($spelltrigger_2);
        $spelltrigger_3 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_3[$item['spelltrigger_3']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['spell_trigger'], $lang_item_edit['spell_trigger_desc']) . "</td>\n   <td><select name=\"spelltrigger_3\">\n    <option value=\"0\" {$spelltrigger_3[0]}>0: {$lang_item['spell_use']}</option>\n    <option value=\"1\" {$spelltrigger_3[1]}>1: {$lang_item['spell_equip']}</option>\n    <option value=\"2\" {$spelltrigger_3[2]}>2: {$lang_item['spell_coh']}</option>\n    <option value=\"4\" {$spelltrigger_3[4]}>4: {$lang_item['soul_stone']}</option>\n    </select></td>\n   <td>" . makeinfocell($lang_item_edit['spell_charges'], $lang_item_edit['spell_charges_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcharges_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_3']}\" /></td>\n</tr>\n<tr>\n   <td>" . makeinfocell($lang_item_edit['spell_cooldown'], $lang_item_edit['spell_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcooldown_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_3']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category'], $lang_item_edit['spell_category_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategory_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_3']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category_cooldown'], $lang_item_edit['spell_category_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategorycooldown_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_3']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['ppm_rate'], $lang_item_edit['ppm_rate_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellppmRate_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellppmRate_3']}\" /></td>\n</tr>\n<tr><td colspan=\"6\" class=\"hidden\"></td></tr>\n<tr>\n   <td colspan=\"2\">{$lang_item_edit['item_spell']} 4</td>\n   <td>" . makeinfocell($lang_item_edit['spell_id'], $lang_item_edit['spell_id_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellid_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_4']}\" /></td>";
        unset($spelltrigger_3);
        $spelltrigger_4 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_4[$item['spelltrigger_4']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['spell_trigger'], $lang_item_edit['spell_trigger_desc']) . "</td>\n   <td><select name=\"spelltrigger_4\">\n    <option value=\"0\" {$spelltrigger_4[0]}>0: {$lang_item['spell_use']}</option>\n    <option value=\"1\" {$spelltrigger_4[1]}>1: {$lang_item['spell_equip']}</option>\n    <option value=\"2\" {$spelltrigger_4[2]}>2: {$lang_item['spell_coh']}</option>\n    <option value=\"4\" {$spelltrigger_4[4]}>4: {$lang_item['soul_stone']}</option>\n    </select></td>\n   <td>" . makeinfocell($lang_item_edit['spell_charges'], $lang_item_edit['spell_charges_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcharges_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_4']}\" /></td>\n</tr>\n<tr>\n   <td>" . makeinfocell($lang_item_edit['spell_cooldown'], $lang_item_edit['spell_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcooldown_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_4']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category'], $lang_item_edit['spell_category_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategory_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_4']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category_cooldown'], $lang_item_edit['spell_category_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategorycooldown_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_4']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['ppm_rate'], $lang_item_edit['ppm_rate_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellppmRate_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellppmRate_4']}\" /></td>\n</tr>\n<tr><td colspan=\"6\" class=\"hidden\"></td></tr>\n<tr>\n   <td colspan=\"2\">{$lang_item_edit['item_spell']} 5</td>\n   <td>" . makeinfocell($lang_item_edit['spell_id'], $lang_item_edit['spell_id_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellid_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_5']}\" /></td>";
        unset($spelltrigger_4);
        $spelltrigger_5 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_5[$item['spelltrigger_5']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['spell_trigger'], $lang_item_edit['spell_trigger_desc']) . "</td>\n   <td><select name=\"spelltrigger_5\">\n    <option value=\"0\" {$spelltrigger_5[0]}>0: {$lang_item['spell_use']}</option>\n    <option value=\"1\" {$spelltrigger_5[1]}>1: {$lang_item['spell_equip']}</option>\n    <option value=\"2\" {$spelltrigger_5[2]}>2: {$lang_item['spell_coh']}</option>\n    <option value=\"4\" {$spelltrigger_5[4]}>4: {$lang_item['soul_stone']}</option>\n    </select></td>\n   <td>" . makeinfocell($lang_item_edit['spell_charges'], $lang_item_edit['spell_charges_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcharges_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_5']}\" /></td>\n</tr>\n<tr>\n   <td>" . makeinfocell($lang_item_edit['spell_cooldown'], $lang_item_edit['spell_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcooldown_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_5']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category'], $lang_item_edit['spell_category_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategory_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_5']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['spell_category_cooldown'], $lang_item_edit['spell_category_cooldown_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellcategorycooldown_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_5']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['ppm_rate'], $lang_item_edit['ppm_rate_desc']) . "</td>\n   <td><input type=\"text\" name=\"spellppmRate_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellppmRate_5']}\" /></td>\n</tr>\n\n</table>\n    </div>";
        unset($spelltrigger_5);
        $output .= "<div id=\"pane6\">\n    <br /><br /><table class=\"lined\" style=\"width: 720px;\">\n   <tr>";
        $AllowableClass = array(-1 => "", 1 => "", 2 => "", 4 => "", 8 => "", 16 => "", 32 => "", 64 => "", 128 => "", 256 => "", 512 => "", 1024 => "");
        if ($item['AllowableClass'] == -1) {
            $AllowableClass[-1] = " selected=\"selected\" ";
        } else {
            if ($item['AllowableClass'] & 1) {
                $AllowableClass[1] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 2) {
                $AllowableClass[2] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 4) {
                $AllowableClass[4] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 8) {
                $AllowableClass[8] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 16) {
                $AllowableClass[16] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 32) {
                $AllowableClass[32] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 64) {
                $AllowableClass[64] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 128) {
                $AllowableClass[128] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 256) {
                $AllowableClass[256] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 512) {
                $AllowableClass[512] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 1024) {
                $AllowableClass[1024] = " selected=\"selected\" ";
            }
        }
        $output .= "<td>" . makeinfocell($lang_item_edit['allow_class'], $lang_item_edit['allow_class_desc']) . "</td>\n   <td><select multiple=\"multiple\" name=\"AllowableClass[]\" size=\"5\">\n    <option value=\"-1\" {$AllowableClass[-1]}>-1 - {$lang_item_edit['all']}</option>\n    <option value=\"1\" {$AllowableClass[1]}>1 - {$lang_id_tab['warrior']}</option>\n    <option value=\"2\" {$AllowableClass[2]}>2 - {$lang_id_tab['paladin']}</option>\n    <option value=\"4\" {$AllowableClass[4]}>4 - {$lang_id_tab['hunter']}</option>\n    <option value=\"8\" {$AllowableClass[8]}>8 - {$lang_id_tab['rogue']}</option>\n    <option value=\"16\" {$AllowableClass[16]}>16 - {$lang_id_tab['priest']}</option>\n    <option value=\"32\" {$AllowableClass[32]}>32 - FUTURE_1</option>\n    <option value=\"64\" {$AllowableClass[64]}>64 - {$lang_id_tab['shaman']}</option>\n    <option value=\"128\" {$AllowableClass[128]}>128 - {$lang_id_tab['mage']}</option>\n    <option value=\"256\" {$AllowableClass[256]}>256 - {$lang_id_tab['warlock']}</option>\n    <option value=\"512\" {$AllowableClass[512]}>512 - FUTURE_2</option>\n    <option value=\"1024\" {$AllowableClass[1024]}>1024 - {$lang_id_tab['druid']}</option>\n     </select></td>";
        unset($AllowableClass);
        $AllowableRace = array(-1 => "", 1 => "", 2 => "", 4 => "", 8 => "", 16 => "", 32 => "", 64 => "", 128 => "", 256 => "", 512 => "");
        if ($item['AllowableRace'] == -1) {
            $AllowableRace[-1] = " selected=\"selected\" ";
        } else {
            if ($item['AllowableRace'] & 1) {
                $AllowableRace[1] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 2) {
                $AllowableRace[2] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 4) {
                $AllowableRace[4] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 8) {
                $AllowableRace[8] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 16) {
                $AllowableRace[16] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 32) {
                $AllowableRace[32] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 64) {
                $AllowableRace[64] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 128) {
                $AllowableRace[128] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 256) {
                $AllowableRace[256] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 512) {
                $AllowableRace[512] = " selected=\"selected\" ";
            }
        }
        $output .= "<td>" . makeinfocell($lang_item_edit['allow_race'], $lang_item_edit['allow_race_desc']) . "</td>\n   <td><select multiple=\"multiple\" name=\"AllowableRace[]\" size=\"5\">\n    <option value=\"-1\" {$AllowableRace[-1]}>-1 - {$lang_item_edit['all']}</option>\n    <option value=\"1\" {$AllowableRace[1]}>1 - {$lang_id_tab['human']}</option>\n    <option value=\"2\" {$AllowableRace[2]}>2 - {$lang_id_tab['orc']}</option>\n    <option value=\"4\" {$AllowableRace[4]}>4 - {$lang_id_tab['dwarf']}</option>\n    <option value=\"8\" {$AllowableRace[8]}>8 - {$lang_id_tab['nightelf']}</option>\n    <option value=\"16\" {$AllowableRace[16]}>16 - {$lang_id_tab['undead']}</option>\n    <option value=\"32\" {$AllowableRace[32]}>32 - {$lang_id_tab['tauren']}</option>\n    <option value=\"64\" {$AllowableRace[64]}>64 - {$lang_id_tab['gnome']}</option>\n    <option value=\"128\" {$AllowableRace[128]}>128 - {$lang_id_tab['troll']}</option>\n    <option value=\"256\" {$AllowableRace[256]}>256 - {$lang_id_tab['draenei']}</option>\n    <option value=\"512\" {$AllowableRace[512]}>512 - {$lang_id_tab['bloodelf']}</option>\n     </select></td>\n</tr>\n<tr>\n   <td>" . makeinfocell($lang_item_edit['req_skill'], $lang_item_edit['req_skill_desc']) . "</td>\n   <td><input type=\"text\" name=\"RequiredSkill\" size=\"15\" maxlength=\"30\" value=\"{$item['RequiredSkill']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['req_skill_rank'], $lang_item_edit['req_skill_rank_desc']) . "</td>\n   <td><input type=\"text\" name=\"RequiredSkillRank\" size=\"15\" maxlength=\"30\" value=\"{$item['RequiredSkillRank']}\" /></td>\n</tr>\n<tr>\n   <td>" . makeinfocell($lang_item_edit['req_spell'], $lang_item_edit['req_spell_desc']) . "</td>\n   <td><input type=\"text\" name=\"requiredspell\" size=\"15\" maxlength=\"30\" value=\"{$item['requiredspell']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['req_honor_rank'], $lang_item_edit['req_honor_rank_desc']) . "</td>\n   <td><input type=\"text\" name=\"requiredhonorrank\" size=\"15\" maxlength=\"30\" value=\"{$item['requiredhonorrank']}\" /></td>\n</tr>\n<tr>\n   <td>" . makeinfocell($lang_item_edit['req_rep_faction'], $lang_item_edit['req_rep_faction_desc']) . "</td>\n   <td><input type=\"text\" name=\"RequiredReputationFaction\" size=\"15\" maxlength=\"30\" value=\"{$item['RequiredReputationFaction']}\" /></td>";
        unset($AllowableRace);
        $RequiredReputationRank = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "");
        $RequiredReputationRank[$item['RequiredReputationRank']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['req_rep_rank'], $lang_item_edit['req_rep_rank_desc']) . "</td>\n      <td><select name=\"RequiredReputationRank\">\n    <option value=\"0\" {$RequiredReputationRank[0]}>0 - {$lang_item_edit['hated']}</option>\n    <option value=\"1\" {$RequiredReputationRank[1]}>1 - {$lang_item_edit['hostile']}</option>\n    <option value=\"2\" {$RequiredReputationRank[2]}>2 - {$lang_item_edit['unfriendly']}</option>\n    <option value=\"3\" {$RequiredReputationRank[3]}>3 - {$lang_item_edit['neutral']}</option>\n    <option value=\"4\" {$RequiredReputationRank[4]}>4 - {$lang_item_edit['friendly']}</option>\n    <option value=\"5\" {$RequiredReputationRank[5]}>5 - {$lang_item_edit['honored']}</option>\n    <option value=\"6\" {$RequiredReputationRank[6]}>6 - {$lang_item_edit['reverted']}</option>\n    <option value=\"7\" {$RequiredReputationRank[7]}>7 - {$lang_item_edit['exalted']}</option>\n     </select></td>\n</tr>\n<tr>\n   <td colspan=\"2\">" . makeinfocell($lang_item_edit['req_city_rank'], $lang_item_edit['req_city_rank_desc']) . "</td>\n   <td colspan=\"2\"><input type=\"text\" name=\"RequiredCityRank\" size=\"15\" maxlength=\"30\" value=\"{$item['RequiredCityRank']}\" /></td>\n</tr>\n\n   </table><br /><br />\n    </div>";
        unset($RequiredReputationRank);
        $output .= "<div id=\"pane7\">\n    <br /><br /><table class=\"lined\" style=\"width: 720px;\">\n<tr>";
        $socketColor_1 = array(0 => "", 1 => "", 2 => "", 4 => "", 8 => "");
        $socketColor_1[$item['socketColor_1']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['socket_color'] . " 1", $lang_item_edit['socket_color_desc']) . "</td>\n      <td><select name=\"socketColor_1\">\n        <option value=\"0\" {$socketColor_1[0]}>0: {$lang_item['none']}</option>\n        <option value=\"1\" {$socketColor_1[1]}>1: {$lang_item['socket_meta']}</option>\n        <option value=\"2\" {$socketColor_1[2]}>2: {$lang_item['socket_red']}</option>\n        <option value=\"4\" {$socketColor_1[4]}>4: {$lang_item['socket_yellow']}</option>\n        <option value=\"8\" {$socketColor_1[8]}>8: {$lang_item['socket_blue']}</option>\n      </select></td>\n   <td>" . makeinfocell($lang_item_edit['socket_content'] . " 1", $lang_item_edit['socket_content_desc']) . "</td>\n   <td><input type=\"text\" name=\"socketContent_1\" size=\"15\" maxlength=\"10\" value=\"{$item['socketContent_1']}\" /></td>\n</tr>\n<tr>";
        unset($socketColor_1);
        $socketColor_2 = array(0 => "", 1 => "", 2 => "", 4 => "", 8 => "");
        $socketColor_2[$item['socketColor_2']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['socket_color'] . " 2", $lang_item_edit['socket_color_desc']) . "</td>\n      <td><select name=\"socketColor_2\">\n        <option value=\"0\" {$socketColor_2[0]}>0: {$lang_item['none']}</option>\n        <option value=\"1\" {$socketColor_2[1]}>1: {$lang_item['socket_meta']}</option>\n        <option value=\"2\" {$socketColor_2[2]}>2: {$lang_item['socket_red']}</option>\n        <option value=\"4\" {$socketColor_2[4]}>4: {$lang_item['socket_yellow']}</option>\n        <option value=\"8\" {$socketColor_2[8]}>8: {$lang_item['socket_blue']}</option>\n      </select></td>\n\n   <td>" . makeinfocell($lang_item_edit['socket_content'] . " 2", $lang_item_edit['socket_content_desc']) . "</td>\n   <td><input type=\"text\" name=\"socketContent_2\" size=\"15\" maxlength=\"10\" value=\"{$item['socketContent_2']}\" /></td>\n</tr>\n<tr>";
        unset($socketColor_2);
        $socketColor_3 = array(0 => "", 1 => "", 2 => "", 4 => "", 8 => "");
        $socketColor_3[$item['socketColor_3']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell($lang_item_edit['socket_color'] . " 3", $lang_item_edit['socket_color_desc']) . "</td>\n      <td><select name=\"socketColor_3\">\n        <option value=\"0\" {$socketColor_3[0]}>0: {$lang_item['none']}</option>\n        <option value=\"1\" {$socketColor_3[1]}>1: {$lang_item['socket_meta']}</option>\n        <option value=\"2\" {$socketColor_3[2]}>2: {$lang_item['socket_red']}</option>\n        <option value=\"4\" {$socketColor_3[4]}>4: {$lang_item['socket_yellow']}</option>\n        <option value=\"8\" {$socketColor_3[8]}>8: {$lang_item['socket_blue']}</option>\n      </select></td>\n\n   <td>" . makeinfocell($lang_item_edit['socket_content'] . " 3", $lang_item_edit['socket_content_desc']) . "</td>\n   <td><input type=\"text\" name=\"socketContent_3\" size=\"15\" maxlength=\"10\" value=\"{$item['socketContent_3']}\" /></td>\n</tr>\n\n<tr>\n   <td>" . makeinfocell($lang_item_edit['socket_bonus'], $lang_item_edit['socket_bonus_desc']) . "</td>\n   <td><input type=\"text\" name=\"socketBonus\" size=\"15\" maxlength=\"10\" value=\"{$item['socketBonus']}\" /></td>\n\n   <td>" . makeinfocell($lang_item_edit['gem_properties'], $lang_item_edit['gem_properties_desc']) . "</td>\n   <td><input type=\"text\" name=\"GemProperties\" size=\"15\" maxlength=\"10\" value=\"{$item['GemProperties']}\" /></td>\n</tr>\n\n   </table><br /><br />\n    </div>";
        $output .= "<div id=\"pane8\">\n    <br /><br /><table class=\"lined\" style=\"width: 720px;\">\n  <tr class=\"large_bold\"><td colspan=\"5\" class=\"hidden\" align=\"left\">{$lang_item_edit['dropped_by']}: {$lang_item_edit['top_x']}</td></tr>\n  <tr>\n    <th width=\"1%\">ID</th>\n    <th width=\"35%\">{$lang_item_edit['mob_name']}</th>\n    <th width=\"10%\">{$lang_item_edit['mob_level']}</th>\n    <th width=\"25%\">{$lang_item_edit['mob_drop_chance']}</th>\n    <th width=\"25%\">{$lang_item_edit['mob_quest_drop_chance']}</th>\n  </tr>";
        $result2 = $sql->query("SELECT entry,ChanceOrQuestChance,`groupid` FROM creature_loot_template WHERE item = {$item['entry']} ORDER BY `groupid`,ChanceOrQuestChance DESC LIMIT 5");
        while ($info = $sql->fetch_row($result2)) {
            $result3 = $sql->query("SELECT creature_template.entry,IFNULL(" . ($deplang != 0 ? "name_loc{$deplang}" : "NULL") . ",`name`) as name,maxlevel FROM creature_template LEFT JOIN locales_creature ON creature_template.entry = locales_creature.entry WHERE lootid = {$info[0]} LIMIT 1");
            while ($mob = $sql->fetch_row($result3)) {
                $output .= "<tr><td>";
                if ($user_lvl >= $action_permission['delete']) {
                    $output .= "<a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry={$mob['0']}&amp;error=4\" target=\"_blank\">{$mob['0']}</a>";
                } else {
                    $output .= "{$mob['0']}";
                }
                $output .= "</td>\n          <td><a class=\"tooltip\" href=\"{$creature_datasite}{$mob['0']}\" target=\"_blank\">{$mob['1']}</a></td>\n          <td>{$mob['2']}</td>\n          <td>{$info['1']}%</td>\n          <td>{$info['2']}%</td></tr>";
            }
        }
        $result2 = $sql->query("SELECT creature_template.entry,IFNULL(" . ($deplang != 0 ? "name_loc{$deplang}" : "NULL") . ",`name`) as name,maxlevel FROM creature_template LEFT JOIN locales_creature ON creature_template.entry = locales_creature.entry WHERE creature_template.entry IN (SELECT entry FROM npc_vendor WHERE item = {$item['entry']}) ORDER BY maxlevel DESC LIMIT 5");
        if ($sql->num_rows($result2)) {
            $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['sold_by']}: {$lang_item_edit['limit_x']}</td></tr>";
            while ($mob = $sql->fetch_row($result2)) {
                $output .= "<tr>\n        <td width=\"10%\">";
                if ($user_lvl >= $action_permission['delete']) {
                    $output .= "<a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry={$mob['0']}&amp;error=4\" target=\"_blank\">{$mob['0']}</a>";
                } else {
                    $output .= "{$mob['0']}";
                }
                $output .= "\n        <td width=\"10%\">{$mob['2']}</td>\n        <td width=\"80%\" colspan=\"2\" align=\"left\">\n          <a class=\"tooltip\" href=\"{$creature_datasite}{$mob['0']}\" target=\"_blank\">{$mob['1']}</a></td>\n        </td></tr>";
            }
        }
        $result2 = $sql->query("SELECT quest_template.entry,IFNULL(" . ($deplang != 0 ? "title_loc{$deplang}" : "NULL") . ",`title`) as title,QuestLevel FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE ( SrcItemId = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR\n              ReqItemId2 = {$item['entry']} OR ReqItemId3 = {$item['entry']} OR ReqItemId4 = {$item['entry']} OR RewItemId1 = {$item['entry']} OR\n              RewItemId2 = {$item['entry']} OR RewItemId3 = {$item['entry']} OR RewItemId4 = {$item['entry']} ) ORDER BY QuestLevel DESC");
        if ($sql->num_rows($result2)) {
            $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['involved_in_quests']}:</td></tr>";
            while ($quest = $sql->fetch_row($result2)) {
                $output .= "<tr><td width=\"20%\">id: {$quest['0']}</td>\n        <td width=\"80%\" colspan=\"3\" align=\"left\"><a class=\"tooltip\" href=\"{$quest_datasite}{$quest['0']}\" target=\"_blank\">({$quest['2']}) {$quest['1']}</a></td></tr>";
            }
        }
        $result2 = $sql->query("SELECT quest_template.entry,IFNULL(" . ($deplang != 0 ? "title_loc{$deplang}" : "NULL") . ",`title`) as title,QuestLevel FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR\n              RewChoiceItemId3 = {$item['entry']} OR RewChoiceItemId4 = {$item['entry']} OR RewChoiceItemId5 = {$item['entry']} OR RewChoiceItemId6 = {$item['entry']} )\n              ORDER BY QuestLevel DESC");
        if ($sql->num_rows($result2)) {
            $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['reward_from_quest']}:</td></tr>";
            while ($quest = $sql->fetch_row($result2)) {
                $output .= "<tr><td width=\"20%\">id: {$quest['0']}</td>\n        <td width=\"80%\" colspan=\"3\" align=\"left\"><a class=\"tooltip\" href=\"{$quest_datasite}{$quest['0']}\" target=\"_blank\">({$quest['2']}) {$quest['1']}</a></td></tr>";
            }
        }
        $output .= "</tr></table><br /><br />\n    </div>";
        if ($item['DisenchantID']) {
            $output .= "<div id=\"pane9\">\n  <br /><br /><table class=\"lined\" style=\"width: 720px;\">\n  <tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_item_edit['disenchant_templ']}: {$item['DisenchantID']}</td></tr>\n  <tr><td colspan=\"6\">";
            $cel_counter = 0;
            $row_flag = 0;
            $output .= "<table class=\"hidden\" align=\"center\"><tr>";
            $result1 = $sql->query("SELECT item,ChanceOrQuestChance,`groupid`,mincountOrRef,maxcount,lootcondition,condition_value1, condition_value2 FROM disenchant_loot_template WHERE entry = {$item['DisenchantID']} ORDER BY ChanceOrQuestChance DESC");
            while ($item = $sql->fetch_row($result1)) {
                $cel_counter++;
                $tooltip = get_item_name($item[0]) . " ({$item['0']})<br />{$lang_item_edit['drop_chance']}: {$item['1']}%<br />{$lang_item_edit['quest_drop_chance']}: {$item['2']}%<br />{$lang_item_edit['drop_chance']}: {$item['3']}-{$item['4']}<br />{$lang_item_edit['lootcondition']}: {$item['5']}<br />{$lang_item_edit['condition_value1']}: {$item['6']}<br />{$lang_item_edit['condition_value2']}: {$item['7']}";
                $output .= "<td>";
                $output .= maketooltip("<img src=\"" . get_item_icon($item[0]) . "\" class=\"icon_border\" alt=\"\" />", "{$item_datasite}{$item['0']}", $tooltip, "item_tooltip");
                $output .= "<br /><input type=\"checkbox\" name=\"del_de_items[]\" value=\"{$item['0']}\" /></td>";
                if ($cel_counter >= 16) {
                    $cel_counter = 0;
                    $output .= "</tr><tr>";
                    $row_flag++;
                }
            }
            if ($row_flag) {
                $output .= "<td colspan=\"" . (16 - $cel_counter) . "\"></td>";
            }
            $output .= "</td></tr></table>\n </td>\n</tr>\n<tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_item_edit['add_items_to_templ']}:</td></tr>\n<tr>\n<td>" . makeinfocell($lang_item_edit['loot_item_id'], $lang_item_edit['loot_item_id_desc']) . "</td>\n  <td><input type=\"text\" name=\"de_item\" size=\"8\" maxlength=\"10\" value=\"\" /></td>\n<td>" . makeinfocell($lang_item_edit['loot_drop_chance'], $lang_item_edit['loot_drop_chance_desc']) . "</td>\n  <td><input type=\"text\" name=\"de_ChanceOrQuestChance\" size=\"8\" maxlength=\"11\" value=\"0\" /></td>\n<td>" . makeinfocell($lang_item_edit['loot_quest_drop_chance'], $lang_item_edit['loot_quest_drop_chance_desc']) . "</td>\n  <td><input type=\"text\" name=\"de_groupid\" size=\"8\" maxlength=\"10\" value=\"0\" /></td>\n</tr>\n<tr>\n<td>" . makeinfocell($lang_item_edit['min_count'], $lang_item_edit['min_count_desc']) . "</td>\n  <td><input type=\"text\" name=\"de_mincountOrRef\" size=\"8\" maxlength=\"3\" value=\"1\" /></td>\n<td>" . makeinfocell($lang_item_edit['max_count'], $lang_item_edit['max_count_desc']) . "</td>\n  <td><input type=\"text\" name=\"de_maxcount\" size=\"8\" maxlength=\"3\" value=\"1\" /></td>\n</tr>\n<tr>\n<td>" . makeinfocell($lang_item_edit['lootcondition'], $lang_item_edit['lootcondition_desc']) . "</td>\n  <td><input type=\"text\" name=\"de_lootcondition\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\n<td>" . makeinfocell($lang_item_edit['condition_value1'], $lang_item_edit['condition_value1_desc']) . "</td>\n  <td><input type=\"text\" name=\"de_condition_value1\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\n<td>" . makeinfocell($lang_item_edit['condition_value2'], $lang_item_edit['condition_value2_desc']) . "</td>\n  <td><input type=\"text\" name=\"de_condition_value2\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\n</tr>\n</table>\n</div>";
        }
        $output .= "</div>\n</div>\n<br />\n</form>\n\n<script type=\"text/javascript\">setupPanes(\"container\", \"tab1\")</script>";
        unset($socketColor_3);
        $output .= "\n          <table class=\"hidden\">\n            <tr>\n              <td>";
        if ($user_lvl >= $action_permission['delete']) {
            makebutton($lang_item_edit['del_item'], "item.php?action=delete&amp;entry={$entry}\" type=\"wrn", 180);
        }
        $output .= "\n              </td>\n              <td>";
        if ($user_lvl >= $action_permission['update']) {
            makebutton($lang_item_edit['update'], "javascript:do_submit('form1',0)\" type=\"wrn", 180);
        }
        $output .= "\n              </td>\n              <td>";
        if ($user_lvl >= $action_permission['insert']) {
            makebutton($lang_item_edit['export_sql'], "javascript:do_submit('form1',1)", 180);
        }
        $output .= "\n              </td>\n              <td>";
        makebutton($lang_global['back'], "javascript:window.history.back()", 130);
        $output .= "\n              </td>\n              <td>";
        makebutton($lang_item_edit['new_search'], "item.php", 130);
        $output .= "\n              </td>\n            </tr>\n          </table>\n        </center>\n";
    } else {
        error($lang_item_edit['item_not_found']);
        exit;
    }
}
Beispiel #2
0
function do_insert_update($do_insert)
{
    global $lang_global, $lang_creature, $output, $world_db, $realm_id, $creature_datasite, $item_datasite, $quest_datasite, $lang_id_tab, $spell_datasite, $lang_item, $language, $action_permission, $user_lvl, $locales_search_option;
    wowhead_tt();
    require_once "./scripts/get_lib.php";
    require_once 'libs/item_lib.php';
    $sql = new SQL();
    $sql->connect($world_db[$realm_id]['addr'], $world_db[$realm_id]['user'], $world_db[$realm_id]['pass'], $world_db[$realm_id]['name']);
    // entry only needed on update
    if (!$do_insert) {
        if (!isset($_GET['entry'])) {
            redirect("creature.php?error=1");
        }
        $entry = is_numeric($_GET['entry']) ? $sql->quote_smart($_GET['entry']) : redirect("creature.php?error=8");
        $result = $sql->query("SELECT `entry`, `difficulty_entry_1`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`,`subname`, `IconName`, `minlevel`, `maxlevel`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `baseattacktime`, `rangeattacktime`, `unit_flags`,`dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`,`trainer_race`,`minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`,`type_flags`,`lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `RacialLeader`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName` FROM creature_template WHERE entry = '{$entry}'");
    } else {
        // get new free id
        $result = $sql->query("SELECT max(entry)+1 as newentry from creature_template");
        $entry = $sql->result($result, 0, 'newentry');
        $result = $sql->query("SELECT {$entry} as `entry`, 0 as `difficulty_entry_1`, 0 as `KillCredit1`, 0 as `KillCredit2`, 0 as `modelid1`, 0 as `modelid2`, 0 as `modelid3`, 0 as `modelid4`, 'new creature' as `name`,'' as `subname`, '' as `IconName`, 1 as `minlevel`, 1 as `maxlevel`, 0 as `faction_A`, 0 as `faction_H`, 0 as `npcflag`, 1 as `speed`, 1 as `scale`,0 as `rank`, 1 as `mindmg`, 1 as `maxdmg`, 0 as `dmgschool`, 0 as `attackpower`, 2000 as `baseattacktime`, 0 as `rangeattacktime`, 0 as `unit_flags`,0 as `dynamicflags`, 0 as `family`, 0 as `trainer_type`, 0 as `trainer_spell`, 0 as `trainer_class`,0 as `trainer_race`,0 as `minrangedmg`, 0 as `maxrangedmg`, 0 as `rangedattackpower`, 0 as `type`,0 as `type_flags`,0 as `lootid`, 0 as `pickpocketloot`, 0 as `skinloot`, 0 as `resistance1`, 0 as `resistance2`, 0 as `resistance3`, 0 as `resistance4`, 0 as `resistance5`, 0 as `resistance6`, 0 as`spell1`, 0 as`spell2`, 0 as `spell3`, 0 as `spell4`, 0 as `PetSpellDataId`, 100 as `mingold`, 250 as `maxgold`, '' as `AIName`, 0 as `MovementType`, 1 as `InhabitType`, 0 as `RacialLeader`, 1 as `RegenHealth`, 0 as `equipment_id`, 0 as `mechanic_immune_mask`, 0 as `flags_extra`, '' as `ScriptName`");
        // use id for new creature_template
    }
    if ($mob = $sql->fetch_assoc($result)) {
        $output .= "\r\n                <script type=\"text/javascript\" src=\"libs/js/tab.js\"></script>\r\n                <center>\r\n                <br /><br /><br />\r\n                    <form method=\"post\" action=\"creature.php?action=do_update\" name=\"form1\">\r\n                        <input type=\"hidden\" name=\"backup_op\" value=\"0\"/>\r\n                        <input type=\"hidden\" name=\"entry\" value=\"{$entry}\"/>\r\n                        <input type=\"hidden\" name=\"insert\" value=\"{$do_insert}\"/>\r\n                        <div class=\"jtab-container\" id=\"container\">\r\n                            <ul class=\"jtabs\">\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane1', this)\" id=\"tab1\">{$lang_creature['general']}</a></li>\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane3', this)\">{$lang_creature['stats']}</a></li>\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane4', this)\">{$lang_creature['models']}</a></li>\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane2', this)\">{$lang_creature['additional']}</a></li>";
        $quest_flag = 0;
        $vendor_flag = 0;
        $trainer_flag = 0;
        if (!$mob['npcflag']) {
            $output .= "";
        } else {
            if ($mob['npcflag'] & 1) {
                $output .= "";
            }
            //gossip
            if ($mob['npcflag'] & 2) {
                $quest_flag = 1;
                $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane6', this)\">{$lang_creature['quests']}</a></li>";
            }
            if ($mob['npcflag'] & 4) {
                $vendor_flag = 1;
                $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane7', this)\">{$lang_creature['vendor']}</a></li>";
            }
            if ($mob['npcflag'] & 16) {
                $trainer_flag = 1;
                $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane8', this)\">{$lang_creature['trainer']}</a></li>";
            }
        }
        if ($mob['npcflag'] & 128) {
            $vendor_flag = 1;
            $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane7', this)\">{$lang_creature['vendor']}</a></li>";
        }
        if ($mob['npcflag'] & 16384) {
            $vendor_flag = 1;
            $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane7', this)\">{$lang_creature['vendor']}</a></li>";
        }
        if ($mob['lootid']) {
            $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane5', this)\">{$lang_creature['loot']}</a></li>";
        }
        if ($mob['skinloot']) {
            $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane9', this)\">{$lang_creature['skin_loot']}</a></li>";
        }
        if ($mob['pickpocketloot']) {
            $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane10', this)\">{$lang_creature['pickpocket_loot']}</a></li>";
        }
        if ($locales_search_option != 0) {
            $output .= "\r\n                                <li><a href=\"#\" onclick=\"return showPane('pane11', this)\">{$lang_creature['locales']}</a></li>";
        }
        $output .= "\r\n                            </ul>\r\n                            <div class=\"jtab-panes\">\r\n                                <div id=\"pane1\">\r\n                                    <br /><br />\r\n                                    <table class=\"lined\" style=\"width: 720px;\">\r\n                                        <tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['general']}:</td></tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['entry'], $lang_creature['entry_desc']) . "</td>\r\n                                            <td>\r\n                                                <a href=\"{$creature_datasite}{$entry}\" target=\"_blank\">{$entry}</a>\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                            <td colspan=\"3\">\r\n                                                <input type=\"text\" name=\"name\" size=\"50\" maxlength=\"100\" value=\"{$mob['name']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"subname\" size=\"25\" maxlength=\"100\" value=\"{$mob['subname']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['script_name'], $lang_creature['script_name_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"ScriptName\" size=\"25\" maxlength=\"128\" value=\"{$mob['ScriptName']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['basic_status']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['heroic'], $lang_creature['heroic_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"difficulty_entry_1\" size=\"8\" maxlength=\"3\" value=\"{$mob['difficulty_entry_1']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['min_level'], $lang_creature['min_level_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"minlevel\" size=\"8\" maxlength=\"3\" value=\"{$mob['minlevel']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['max_level'], $lang_creature['max_level_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"maxlevel\" size=\"8\" maxlength=\"3\" value=\"{$mob['maxlevel']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>&nbsp;</td>\r\n                                            <td>\r\n                                                &nbsp;\r\n                                            </td>\r\n                                            <td>&nbsp;</td>\r\n                                            <td>\r\n                                                &nbsp;\r\n                                            </td>";
        if ($mob['RegenHealth']) {
            $RegenHealth = "checked";
        } else {
            $RegenHealth = "";
        }
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['RegenHealth'], $lang_creature['RegenHealth']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"checkbox\" name=\"RegenHealth\" value=\"1\" {$RegenHealth} />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['faction_A'], $lang_creature['faction_A_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"faction_A\" size=\"14\" maxlength=\"10\" value=\"{$mob['faction_A']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['faction_H'], $lang_creature['faction_H_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"faction_H\" size=\"14\" maxlength=\"10\" value=\"{$mob['faction_H']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>";
        $rank = array(0 => "", 1 => "", 3 => "", 2 => "", 4 => "");
        $rank[$mob['rank']] = " selected=\"selected\" ";
        $output .= "\r\n                                            <td >" . makeinfocell($lang_creature['rank'], $lang_creature['rank_desc']) . "</td>\r\n                                            <td>\r\n                                                <select name=\"rank\">\r\n                                                    <option value=\"0\" {$rank[0]}>0 - {$lang_creature['normal']}</option>\r\n                                                    <option value=\"1\" {$rank[1]}>1 - {$lang_creature['elite']}</option>\r\n                                                    <option value=\"2\" {$rank[2]}>2 - {$lang_creature['rare_elite']}</option>\r\n                                                    <option value=\"3\" {$rank[3]}>3 - {$lang_creature['world_boss']}</option>\r\n                                                    <option value=\"4\" {$rank[4]}>4 - {$lang_creature['rare']}</option>\r\n                                                </select>\r\n                                            </td>";
        unset($rank);
        $type = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => "");
        $type[$mob['type']] = " selected=\"selected\" ";
        $output .= "\r\n                                            <td colspan=\"2\">" . makeinfocell($lang_creature['type'], $lang_creature['type_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <select name=\"type\">\r\n                                                    <option value=\"0\" {$type[0]}>0 - {$lang_creature['other']}</option>\r\n                                                    <option value=\"1\" {$type[1]}>1 - {$lang_creature['beast']}</option>\r\n                                                    <option value=\"2\" {$type[2]}>2 - {$lang_creature['dragonkin']}</option>\r\n                                                    <option value=\"3\" {$type[3]}>3 - {$lang_creature['demon']}</option>\r\n                                                    <option value=\"4\" {$type[4]}>4 - {$lang_creature['elemental']}</option>\r\n                                                    <option value=\"5\" {$type[5]}>5 - {$lang_creature['giant']}</option>\r\n                                                    <option value=\"6\" {$type[6]}>6 - {$lang_creature['undead']}</option>\r\n                                                    <option value=\"7\" {$type[7]}>7 - {$lang_creature['humanoid']}</option>\r\n                                                    <option value=\"8\" {$type[8]}>8 - {$lang_creature['critter']}</option>\r\n                                                    <option value=\"9\" {$type[9]}>9 - {$lang_creature['mechanical']}</option>\r\n                                                    <option value=\"10\" {$type[10]}>10 - {$lang_creature['not_specified']}</option>\r\n                                                </select>\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>";
        unset($type);
        $npcflag = array(0 => "", 1 => "", 2 => "", 4 => "", 8 => "", 16 => "", 32 => "", 64 => "", 128 => "", 256 => "", 512 => "", 1024 => "", 2048 => "", 4096 => "", 8192 => "", 16384 => "", 65536 => "", 131072 => "", 262144 => "", 524288 => "", 1048576 => "", 2097152 => "", 4194304 => "", 268435456 => "");
        if ($mob['npcflag'] == 0) {
            $npcflag[0] = " selected=\"selected\" ";
        } else {
            if ($mob['npcflag'] & 1) {
                $npcflag[1] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 2) {
                $npcflag[2] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 4) {
                $npcflag[4] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 8) {
                $npcflag[8] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 16) {
                $npcflag[16] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 32) {
                $npcflag[32] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 64) {
                $npcflag[64] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 128) {
                $npcflag[128] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 256) {
                $npcflag[256] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 512) {
                $npcflag[512] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 1024) {
                $npcflag[1024] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 2048) {
                $npcflag[2048] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 4096) {
                $npcflag[4096] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 8192) {
                $npcflag[8192] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 16384) {
                $npcflag[16384] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 65536) {
                $npcflag[65536] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 131072) {
                $npcflag[131072] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 262144) {
                $npcflag[262144] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 524288) {
                $npcflag[524288] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 1048576) {
                $npcflag[1048576] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 2097152) {
                $npcflag[2097152] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 4194304) {
                $npcflag[4194304] = " selected=\"selected\" ";
            }
            if ($mob['npcflag'] & 268435456) {
                $npcflag[268435456] = " selected=\"selected\" ";
            }
        }
        $output .= "\r\n                                            <td rowspan=\"2\">" . makeinfocell($lang_creature['npc_flag'], $lang_creature['npc_flag_desc']) . "</td>\r\n                                            <td colspan=\"2\" rowspan=\"2\">\r\n                                                <select multiple=\"multiple\" name=\"npcflag[]\" size=\"3\">\r\n                                                    <option value=\"0\" {$npcflag[0]}>{$lang_creature['none']}</option>\r\n                                                    <option value=\"1\" {$npcflag[1]}>{$lang_creature['gossip']}</option>\r\n                                                    <option value=\"2\" {$npcflag[2]}>{$lang_creature['quest_giver']}</option>\r\n                                                    <option value=\"4\" {$npcflag[4]}>{$lang_creature['vendor']}</option>\r\n                                                    <option value=\"8\" {$npcflag[8]}>{$lang_creature['taxi']}</option>\r\n                                                    <option value=\"16\" {$npcflag[16]}>{$lang_creature['trainer']}</option>\r\n                                                    <option value=\"32\" {$npcflag[32]}>{$lang_creature['spirit_healer']}</option>\r\n                                                    <option value=\"64\" {$npcflag[64]}>{$lang_creature['guard']}</option>\r\n                                                    <option value=\"128\" {$npcflag[128]}>{$lang_creature['inn_keeper']}</option>\r\n                                                    <option value=\"256\" {$npcflag[256]}>{$lang_creature['banker']}</option>\r\n                                                    <option value=\"512\" {$npcflag[512]}>{$lang_creature['retitioner']}</option>\r\n                                                    <option value=\"1024\" {$npcflag[1024]}>{$lang_creature['tabard_vendor']}</option>\r\n                                                    <option value=\"2048\" {$npcflag[2048]}>{$lang_creature['battlemaster']}</option>\r\n                                                    <option value=\"4096\" {$npcflag[4096]}>{$lang_creature['auctioneer']}</option>\r\n                                                    <option value=\"8192\" {$npcflag[8192]}>{$lang_creature['stable_master']}</option>\r\n                                                    <option value=\"16384\" {$npcflag[16384]}>{$lang_creature['armorer']}</option>\r\n                                                </select>\r\n                                            </td>";
        unset($npcflag);
        $trainer_type = array(0 => "", 1 => "", 2 => "", 3 => "");
        $trainer_type[$mob['trainer_type']] = " selected=\"selected\" ";
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['trainer_type'], $lang_creature['trainer_type_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <select name=\"trainer_type\">\r\n                                                    <option value=\"0\" {$trainer_type[0]}>0 - {$lang_creature['class']}</option>\r\n                                                    <option value=\"1\" {$trainer_type[1]}>1 - {$lang_creature['mounts']}</option>\r\n                                                    <option value=\"2\" {$trainer_type[2]}>2 - {$lang_creature['trade_skill']}</option>\r\n                                                    <option value=\"3\" {$trainer_type[3]}>3 - {$lang_creature['pets']}</option>\r\n                                                </select>\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>";
        unset($trainer_type);
        $family = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 9 => "", 11 => "", 12 => "", 13 => "", 14 => "", 15 => "", 16 => "", 17 => "", 18 => "", 19 => "", 20 => "", 21 => "", 22 => "", 23 => "", 24 => "", 25 => "", 26 => "", 27 => "");
        $family[$mob['family']] = " selected=\"selected\" ";
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['family'], $lang_creature['family_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <select name=\"family\">\r\n                                                    <option value=\"0\" {$family[0]}>0 - {$lang_creature['other']}</option>\r\n                                                    <option value=\"1\" {$family[1]}>1 - {$lang_creature['wolf']}</option>\r\n                                                    <option value=\"2\" {$family[2]}>2 - {$lang_creature['cat']}</option>\r\n                                                    <option value=\"3\" {$family[3]}>3 - {$lang_creature['spider']}</option>\r\n                                                    <option value=\"4\" {$family[4]}>4 - {$lang_creature['bear']}</option>\r\n                                                    <option value=\"5\" {$family[5]}>5 - {$lang_creature['boar']}</option>\r\n                                                    <option value=\"6\" {$family[6]}>6 - {$lang_creature['crocolisk']}</option>\r\n                                                    <option value=\"7\" {$family[7]}>7 - {$lang_creature['carrion_bird']}</option>\r\n                                                    <option value=\"8\" {$family[8]}>8 - {$lang_creature['crab']}</option>\r\n                                                    <option value=\"9\" {$family[9]}>9 - {$lang_creature['gorilla']}</option>\r\n                                                    <option value=\"11\" {$family[11]}>11 - {$lang_creature['raptor']}</option>\r\n                                                    <option value=\"12\" {$family[12]}>12 - {$lang_creature['tallstrider']}</option>\r\n                                                    <option value=\"13\" {$family[13]}>13 - {$lang_creature['other']}</option>\r\n                                                    <option value=\"14\" {$family[14]}>14 - {$lang_creature['other']}</option>\r\n                                                    <option value=\"15\" {$family[15]}>15 - {$lang_creature['felhunter']}</option>\r\n                                                    <option value=\"16\" {$family[16]}>16 - {$lang_creature['voidwalker']}</option>\r\n                                                    <option value=\"17\" {$family[17]}>17 - {$lang_creature['succubus']}</option>\r\n                                                    <option value=\"18\" {$family[18]}>18 - {$lang_creature['other']}</option>\r\n                                                    <option value=\"19\" {$family[19]}>19 - {$lang_creature['doomguard']}</option>\r\n                                                    <option value=\"20\" {$family[20]}>20 - {$lang_creature['scorpid']}</option>\r\n                                                    <option value=\"21\" {$family[21]}>21 - {$lang_creature['turtle']}</option>\r\n                                                    <option value=\"22\" {$family[22]}>22 - {$lang_creature['scorpid']}</option>\r\n                                                    <option value=\"23\" {$family[23]}>23 - {$lang_creature['imp']}</option>\r\n                                                    <option value=\"24\" {$family[24]}>24 - {$lang_creature['bat']}</option>\r\n                                                    <option value=\"25\" {$family[25]}>25 - {$lang_creature['hyena']}</option>\r\n                                                    <option value=\"26\" {$family[26]}>26 - {$lang_creature['owl']}</option>\r\n                                                    <option value=\"27\" {$family[27]}>27 - {$lang_creature['wind_serpent']}</option>\r\n                                                </select>\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['loot']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['loot_id'], $lang_creature['loot_id_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"lootid\" size=\"10\" maxlength=\"10\" value=\"{$mob['lootid']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['skin_loot'], $lang_creature['skin_loot_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"skinloot\" size=\"10\" maxlength=\"10\" value=\"{$mob['skinloot']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['pickpocket_loot'], $lang_creature['pickpocket_loot_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"pickpocketloot\" size=\"10\" maxlength=\"10\" value=\"{$mob['pickpocketloot']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['min_gold'], $lang_creature['min_gold_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"mingold\" size=\"14\" maxlength=\"30\" value=\"{$mob['mingold']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['max_gold'], $lang_creature['max_gold_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"maxgold\" size=\"14\" maxlength=\"30\" value=\"{$mob['maxgold']}\" />\r\n                                            </td>\r\n                                        </tr>";
        unset($family);
        $result1 = $sql->query("SELECT COUNT(*) FROM creature WHERE id = '{$mob['entry']}'");
        $output .= "\r\n                                        <tr>\r\n                                            <td colspan=\"6\">{$lang_creature['creature_swapned']} : " . $sql->result($result1, 0) . " {$lang_creature['times']}.</td>\r\n                                        </tr>\r\n                                    </table>\r\n                                    <br /><br />\r\n                                </div>\r\n                                <div id=\"pane3\">\r\n                                    <br /><br />\r\n                                    <table class=\"lined\" style=\"width: 720px;\">\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['basic_status']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>&nbsp;</td>\r\n                                            <td colspan=\"2\">\r\n                                                &nbsp;\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['speed'], $lang_creature['speed_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"speed_walk\" size=\"8\" maxlength=\"45\" value=\"{$mob['speed_walk']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['damage']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['min_damage'], $lang_creature['min_damage_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"mindmg\" size=\"8\" maxlength=\"45\" value=\"{$mob['mindmg']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['max_damage'], $lang_creature['max_damage_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"maxdmg\" size=\"8\" maxlength=\"45\" value=\"{$mob['maxdmg']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['attack_power'], $lang_creature['attack_power_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"attackpower\" size=\"8\" maxlength=\"10\" value=\"{$mob['attackpower']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['min_range_dmg'], $lang_creature['min_range_dmg_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"minrangedmg\" size=\"8\" maxlength=\"45\" value=\"{$mob['minrangedmg']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['max_range_dmg'], $lang_creature['max_range_dmg_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"maxrangedmg\" size=\"8\" maxlength=\"45\" value=\"{$mob['maxrangedmg']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['ranged_attack_power'], $lang_creature['ranged_attack_power_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"rangedattackpower\" size=\"8\" maxlength=\"10\" value=\"{$mob['rangedattackpower']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['attack_time'], $lang_creature['attack_time_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"baseattacktime\" size=\"8\" maxlength=\"4\" value=\"{$mob['baseattacktime']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['range_attack_time'], $lang_creature['range_attack_time_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"rangeattacktime\" size=\"8\" maxlength=\"4\" value=\"{$mob['rangeattacktime']}\" />\r\n                                            </td>\r\n                                            <td></td>\r\n                                            <td></td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td></td>\r\n                                            <td colspan=\"2\"></td>";
        $dmgschool = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "");
        $dmgschool[$mob['dmgschool']] = " selected=\"selected\" ";
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['dmgschool'], $lang_creature['dmgschool_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <select name=\"dmgschool\">\r\n                                                    <option value=\"0\" {$dmgschool[0]}>0: {$lang_item['physical_dmg']}</option>\r\n                                                    <option value=\"1\" {$dmgschool[1]}>1: {$lang_item['holy_dmg']}</option>\r\n                                                    <option value=\"2\" {$dmgschool[2]}>2: {$lang_item['fire_dmg']}</option>\r\n                                                    <option value=\"3\" {$dmgschool[3]}>3: {$lang_item['nature_dmg']}</option>\r\n                                                    <option value=\"4\" {$dmgschool[4]}>4: {$lang_item['frost_dmg']}</option>\r\n                                                    <option value=\"5\" {$dmgschool[5]}>5: {$lang_item['shadow_dmg']}</option>\r\n                                                    <option value=\"6\" {$dmgschool[6]}>6: {$lang_item['arcane_dmg']}</option>\r\n                                                </select>\r\n                                            </td>";
        unset($dmgschool);
        $output .= "\r\n                                        </tr>\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['spells']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['spell'] . " 1", $lang_creature['spell_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"spell1\" size=\"14\" maxlength=\"11\" value=\"{$mob['spell1']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['spell'] . " 2", $lang_creature['spell_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"spell2\" size=\"14\" maxlength=\"11\" value=\"{$mob['spell2']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['spell'] . " 3", $lang_creature['spell_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"spell3\" size=\"14\" maxlength=\"11\" value=\"{$mob['spell3']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['spell'] . " 4", $lang_creature['spell_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"spell4\" size=\"14\" maxlength=\"11\" value=\"{$mob['spell4']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['resistances']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['resis_holy'], $lang_creature['resis_holy_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"resistance1\" size=\"8\" maxlength=\"10\" value=\"{$mob['resistance1']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['resis_fire'], $lang_creature['resis_fire_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"resistance2\" size=\"8\" maxlength=\"10\" value=\"{$mob['resistance2']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['resis_nature'], $lang_creature['resis_nature_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"resistance3\" size=\"8\" maxlength=\"10\" value=\"{$mob['resistance3']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['resis_frost'], $lang_creature['resis_frost_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"resistance4\" size=\"8\" maxlength=\"10\" value=\"{$mob['resistance4']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['resis_shadow'], $lang_creature['resis_shadow_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"resistance5\" size=\"8\" maxlength=\"10\" value=\"{$mob['resistance5']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['resis_arcane'], $lang_creature['resis_arcane_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"resistance6\" size=\"8\" maxlength=\"10\" value=\"{$mob['resistance6']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                    </table>\r\n                                    <br /><br />\r\n                                </div>\r\n                                <div id=\"pane4\">\r\n                                    <br /><br />\r\n                                    <table class=\"lined\" style=\"width: 720px;\">\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['models']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td colspan=\"2\">" . makeinfocell($lang_creature['modelid_A'], $lang_creature['modelid_A_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"modelid1\" size=\"8\" maxlength=\"11\" value=\"{$mob['modelid1']}\" />\r\n                                            </td>\r\n                                            <td colspan=\"2\">" . makeinfocell($lang_creature['modelid_A2'], $lang_creature['modelid_A2_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"modelid2\" size=\"8\" maxlength=\"11\" value=\"{$mob['modelid2']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td colspan=\"2\">" . makeinfocell($lang_creature['modelid_H'], $lang_creature['modelid_H_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"modelid3\" size=\"8\" maxlength=\"11\" value=\"{$mob['modelid3']}\" />\r\n                                            </td>\r\n                                            <td colspan=\"2\">" . makeinfocell($lang_creature['modelid_H2'], $lang_creature['modelid_H2_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"modelid4\" size=\"8\" maxlength=\"11\" value=\"{$mob['modelid4']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                    </table>\r\n                                    <br /><br />";
        $result1 = $sql->query("SELECT * FROM creature_equip_template WHERE entry = '{$mob['equipment_id']}'");
        if ($mobequip = $sql->fetch_assoc($result1)) {
            $output .= "\r\n                                    <br /><br />\r\n                                    <table class=\"lined\" style=\"width: 720px;\">\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['equipment']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['equip_slot'] . " 1", $lang_creature['equip_slot1_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"equipslot1\" size=\"8\" maxlength=\"10\" value=\"{$mobequip['equipentry1']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['equip_slot'] . " 2", $lang_creature['equip_slot2_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"equipslot2\" size=\"8\" maxlength=\"10\" value=\"{$mobequip['equipentry2']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['equip_slot'] . " 3", $lang_creature['equip_slot3_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"equipslot3\" size=\"8\" maxlength=\"10\" value=\"{$mobequip['equipentry3']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                    </table>\r\n                                    <br /><br />\r\n                                </div>";
        } else {
            $output .= "\r\n                                    <br /><br />\r\n                                    <table class=\"lined\" style=\"width: 720px;\">\r\n                                        <tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['equipment']}:</td></tr>\r\n                                    </table>\r\n                                    <br /><br />\r\n                                </div>";
        }
        $output .= "\r\n                                <div id=\"pane2\">\r\n                                <br /><br />\r\n                                    <table class=\"lined\" style=\"width: 720px;\">\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['scripts']}:</td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['ai_name'], $lang_creature['ai_name_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"AIName\" size=\"14\" maxlength=\"128\" value=\"{$mob['AIName']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['movement_type'], $lang_creature['movement_type_desc']) . "</td>\r\n                                            <td colspan=\"2\">\r\n                                                <input type=\"text\" name=\"MovementType\" size=\"14\" maxlength=\"24\" value=\"{$mob['MovementType']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr class=\"large_bold\">\r\n                                            <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['other']}:</td>\r\n                                        </tr>";
        $trainer_class = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 7 => "", 8 => "", 9 => "", 11 => "");
        $trainer_class[$mob['trainer_class']] = " selected=\"selected\" ";
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['class'], $lang_creature['class_desc']) . "</td>\r\n                                            <td>\r\n                                                <select name=\"class\">\r\n                                                    <option value=\"0\" {$trainer_class[0]}>0 - {$lang_creature['none']}</option>\r\n                                                    <option value=\"1\" {$trainer_class[1]}>1 - {$lang_id_tab['warrior']}</option>\r\n                                                    <option value=\"2\" {$trainer_class[2]}>2 - {$lang_id_tab['paladin']}</option>\r\n                                                    <option value=\"3\" {$trainer_class[3]}>3 - {$lang_id_tab['hunter']}</option>\r\n                                                    <option value=\"4\" {$trainer_class[4]}>4 - {$lang_id_tab['rogue']}</option>\r\n                                                    <option value=\"5\" {$trainer_class[5]}>5 - {$lang_id_tab['priest']}</option>\r\n                                                    <option value=\"7\" {$trainer_class[7]}>7 - {$lang_id_tab['shaman']}</option>\r\n                                                    <option value=\"8\" {$trainer_class[8]}>8 - {$lang_id_tab['mage']}</option>\r\n                                                    <option value=\"9\" {$trainer_class[9]}>9 - {$lang_id_tab['warlock']}</option>\r\n                                                    <option value=\"11\" {$trainer_class[11]}>11 - {$lang_id_tab['druid']}</option>\r\n                                                </select>\r\n                                            </td>";
        unset($trainer_class);
        $trainer_race = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 10 => "", 11 => "");
        $trainer_race[$mob['trainer_race']] = " selected=\"selected\" ";
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['race'], $lang_creature['race_desc']) . "</td>\r\n                                            <td>\r\n                                                <select name=\"race\">\r\n                                                    <option value=\"0\" {$trainer_race[0]}>0 - {$lang_creature['none']}</option>\r\n                                                    <option value=\"1\" {$trainer_race[1]}>1 - {$lang_id_tab['human']}</option>\r\n                                                    <option value=\"2\" {$trainer_race[2]}>2 - {$lang_id_tab['orc']}</option>\r\n                                                    <option value=\"3\" {$trainer_race[3]}>3 - {$lang_id_tab['dwarf']}</option>\r\n                                                    <option value=\"4\" {$trainer_race[4]}>4 - {$lang_id_tab['nightelf']}</option>\r\n                                                    <option value=\"5\" {$trainer_race[5]}>5 - {$lang_id_tab['undead']}</option>\r\n                                                    <option value=\"6\" {$trainer_race[6]}>6 - {$lang_id_tab['tauren']}</option>\r\n                                                    <option value=\"7\" {$trainer_race[7]}>7 - {$lang_id_tab['gnome']}</option>\r\n                                                    <option value=\"8\" {$trainer_race[8]}>8 - {$lang_id_tab['troll']}</option>\r\n                                                    <option value=\"10\" {$trainer_race[10]}>10 - {$lang_id_tab['bloodelf']}</option>\r\n                                                    <option value=\"11\" {$trainer_race[11]}>11 - {$lang_id_tab['draenei']}</option>\r\n                                                </select>\r\n                                            </td>";
        if ($mob['RacialLeader']) {
            $RacialLeader = "checked";
        } else {
            $RacialLeader = "";
        }
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['RacialLeader'], $lang_creature['RacialLeader_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"checkbox\" name=\"RacialLeader\" value=\"1\" {$RacialLeader} />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['trainer_spell'], $lang_creature['trainer_spell_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"trainer_spell\" size=\"14\" maxlength=\"11\" value=\"{$mob['trainer_spell']}\" />\r\n                                            </td>";
        unset($trainer_race);
        $InhabitType = array(0 => "", 1 => "", 2 => "", 3 => "");
        $InhabitType[$mob['InhabitType']] = " selected=\"selected\" ";
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['inhabit_type'], $lang_creature['inhabit_type_desc']) . "</td>\r\n                                            <td>\r\n                                                <select name=\"InhabitType\">\r\n                                                    <option value=\"0\" {$InhabitType[0]}>0 - {$lang_creature['none']}</option>\r\n                                                    <option value=\"1\" {$InhabitType[1]}>1 - {$lang_creature['walk']}</option>\r\n                                                    <option value=\"2\" {$InhabitType[2]}>2 - {$lang_creature['swim']}</option>\r\n                                                    <option value=\"3\" {$InhabitType[3]}>3 - {$lang_creature['both']}</option>\r\n                                                </select>\r\n                                            </td>";
        unset($InhabitType);
        $output .= "\r\n                                            <td>" . makeinfocell($lang_creature['flags_extra'], $lang_creature['flags_extra_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"flags_extra\" size=\"8\" maxlength=\"11\" value=\"{$mob['flags_extra']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        <tr>\r\n                                            <td>" . makeinfocell($lang_creature['unit_flags'], $lang_creature['flags_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"unit_flags\" size=\"8\" maxlength=\"11\" value=\"{$mob['unit_flags']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['dynamic_flags'], $lang_creature['dynamic_flags_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"dynamicflags\" size=\"8\" maxlength=\"11\" value=\"{$mob['dynamicflags']}\" />\r\n                                            </td>\r\n                                            <td>" . makeinfocell($lang_creature['flag_1'], $lang_creature['flag_1_desc']) . "</td>\r\n                                            <td>\r\n                                                <input type=\"text\" name=\"type_flags\" size=\"8\" maxlength=\"11\" value=\"{$mob['type_flags']}\" />\r\n                                            </td>\r\n                                        </tr>\r\n                                        </table>\r\n                                        <br /><br />\r\n                                    </div>";
        /*****************
           /  LOCALES
           *****************/
        if ($locales_search_option != 0) {
            if ($do_insert) {
                $result_loc = $sql->query("SELECT '' as `name_loc1`, '' as `name_loc2`, '' as `name_loc3`, '' as `name_loc4`, '' as `name_loc5`, '' as `name_loc6`, '' as `name_loc7`, '' as `name_loc8`, '' as `subname_loc1`, '' as `subname_loc2`, '' as `subname_loc3`, '' as `subname_loc4`, '' as `subname_loc5`, '' as `subname_loc6`, '' as `subname_loc7`, '' as `subname_loc8`");
            } else {
                // update
                $result_loc = $sql->query("SELECT `name_loc1`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc5`, `name_loc6`, `name_loc7`, `name_loc8`, `subname_loc1`, `subname_loc2`, `subname_loc3`, `subname_loc4`, `subname_loc5`, `subname_loc6`, `subname_loc7`, `subname_loc8` FROM `locales_creature` WHERE `entry` = '{$entry}'");
            }
            $loc = $sql->fetch_assoc($result_loc);
            $output .= "\r\n                                    <div id=\"pane11\">\r\n                                        <br /><br />\r\n                                        <table class=\"lined\" style=\"width: 720px;\">\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_global['language_1']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"name_loc1\" size=\"24\" maxlength=\"128\" value=\"{$loc['name_loc1']}\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"subname_loc1\" size=\"24\" maxlength=\"64\" value=\"{$loc['subname_loc1']}\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_global['language_2']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"name_loc2\" size=\"24\" maxlength=\"64\" value=\"{$loc['name_loc2']}\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"subname_loc2\" size=\"24\" maxlength=\"64\" value=\"{$loc['subname_loc2']}\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_global['language_3']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"name_loc3\" size=\"24\" maxlength=\"64\" value=\"{$loc['name_loc3']}\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"subname_loc3\" size=\"24\" maxlength=\"64\" value=\"{$loc['subname_loc3']}\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_global['language_4']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"name_loc4\" size=\"24\" maxlength=\"64\" value=\"{$loc['name_loc4']}\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"subname_loc4\" size=\"24\" maxlength=\"64\" value=\"{$loc['subname_loc4']}\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_global['language_5']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"name_loc5\" size=\"24\" maxlength=\"64\" value=\"{$loc['name_loc5']}\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"subname_loc5\" size=\"24\" maxlength=\"64\" value=\"{$loc['subname_loc5']}\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_global['language_6']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"name_loc6\" size=\"24\" maxlength=\"64\" value=\"{$loc['name_loc6']}\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"subname_loc6\" size=\"24\" maxlength=\"64\" value=\"{$loc['subname_loc6']}\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_global['language_7']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"name_loc7\" size=\"24\" maxlength=\"64\" value=\"{$loc['name_loc7']}\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"subname_loc7\" size=\"24\" maxlength=\"64\" value=\"{$loc['subname_loc7']}\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_global['language_8']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['name'], $lang_creature['name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"name_loc8\" size=\"24\" maxlength=\"64\" value=\"{$loc['name_loc8']}\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['sub_name'], $lang_creature['sub_name_desc']) . "</td>\r\n                                                <td colspan=\"2\">\r\n                                                    <input type=\"text\" name=\"subname_loc8\" size=\"24\" maxlength=\"64\" value=\"{$loc['subname_loc8']}\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                        </table>\r\n                                        <br /><br />\r\n                                    </div>";
        }
        if ($mob['lootid']) {
            $output .= "\r\n                                    <div id=\"pane5\">\r\n                                        <br /><br />\r\n                                        <table class=\"lined\" style=\"width: 720px;\">\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['loot_tmpl_id']}: {$mob['lootid']}</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td colspan=\"6\">";
            $cel_counter = 0;
            $row_flag = 0;
            $output .= "\r\n                                                    <table class=\"hidden\" align=\"center\">\r\n                                                        <tr>";
            $result1 = $sql->query("SELECT item,ChanceOrQuestChance,`groupid`,mincountOrRef,maxcount, lootcondition, condition_value1,condition_value2 FROM creature_loot_template WHERE entry = {$mob['lootid']} ORDER BY ChanceOrQuestChance DESC");
            while ($item = $sql->fetch_row($result1)) {
                $cel_counter++;
                $tooltip = get_item_name($item[0]) . " ({$item['0']})<br />{$lang_creature['drop_chance']}: {$item['1']}%<br />{$lang_creature['quest_drop_chance']}: {$item['2']}%<br />{$lang_creature['drop_chance']}: {$item['3']}-{$item['4']}<br />{$lang_creature['lootcondition']}: {$item['5']}<br />{$lang_creature['condition_value1']}: {$item['6']}<br />{$lang_creature['condition_value2']}: {$item['7']}";
                $output .= "\r\n                                                            <td>";
                $output .= maketooltip("<img src=\"" . get_item_icon($item[0]) . "\" class=\"icon_border\" alt=\"\" />", "{$item_datasite}{$item['0']}", $tooltip, "item_tooltip");
                $output .= "\r\n                                                                <br /><input type=\"checkbox\" name=\"del_loot_items[]\" value=\"{$item['0']}\" />\r\n                                                            </td>";
                if ($cel_counter >= 14) {
                    $cel_counter = 0;
                    $output .= "\r\n                                                        </tr>\r\n                                                        <tr>";
                    $row_flag++;
                }
            }
            if ($row_flag) {
                $output .= "\r\n                                                            <td colspan=\"" . (16 - $cel_counter) . "\"></td>";
            }
            $output .= "\r\n                                                        </tr>\r\n                                                    </table>\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['add_items_to_templ']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['loot_item_id'], $lang_creature['loot_item_id_desc']) . "</td>\r\n                                                <td>\r\n                                                    <input type=\"text\" name=\"item\" size=\"8\" maxlength=\"10\" value=\"\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['loot_drop_chance'], $lang_creature['loot_drop_chance_desc']) . "</td>\r\n                                                <td>\r\n                                                    <input type=\"text\" name=\"ChanceOrQuestChance\" size=\"8\" maxlength=\"11\" value=\"0\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['loot_quest_drop_chance'], $lang_creature['loot_quest_drop_chance_desc']) . "</td>\r\n                                                <td>\r\n                                                    <input type=\"text\" name=\"groupid\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['min_count'], $lang_creature['min_count_desc']) . "</td>\r\n                                                <td>\r\n                                                    <input type=\"text\" name=\"mincountOrRef\" size=\"8\" maxlength=\"3\" value=\"1\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['max_count'], $lang_creature['max_count_desc']) . "</td>\r\n                                                <td>\r\n                                                    <input type=\"text\" name=\"maxcount\" size=\"8\" maxlength=\"3\" value=\"1\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td>" . makeinfocell($lang_creature['lootcondition'], $lang_creature['lootcondition_desc']) . "</td>\r\n                                                <td>\r\n                                                    <input type=\"text\" name=\"lootcondition\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['condition_value1'], $lang_creature['condition_value1_desc']) . "</td>\r\n                                                <td>\r\n                                                    <input type=\"text\" name=\"condition_value1\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                </td>\r\n                                                <td>" . makeinfocell($lang_creature['condition_value2'], $lang_creature['condition_value2_desc']) . "</td>\r\n                                                <td>\r\n                                                    <input type=\"text\" name=\"condition_value2\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                        </table>\r\n                                        <br />{$lang_creature['check_to_delete']}<br /><br />\r\n                                    </div>";
        }
        if ($quest_flag) {
            $output .= "\r\n                                    <div id=\"pane6\">\r\n                                        <br /><br />\r\n                                        <table class=\"lined\" style=\"width: 720px;\">\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_creature['start_quests']}:</td>\r\n                                            </tr>";
            $deplang = get_lang_id();
            $result1 = $sql->query("SELECT quest FROM creature_questrelation WHERE id = {$mob['entry']}");
            while ($quest = $sql->fetch_row($result1)) {
                $query1 = $sql->query("SELECT QuestLevel,IFNULL(" . ($deplang != 0 ? "title_loc{$deplang}" : "NULL") . ",`title`) as title FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE quest_template.entry ='{$quest['0']}'");
                $quest_templ = $sql->fetch_row($query1);
                $output .= "\r\n                                            <tr>\r\n                                                <td width=\"5%\">\r\n                                                    <input type=\"checkbox\" name=\"del_questrelation[]\" value=\"{$quest['0']}\" />\r\n                                                </td>\r\n                                                <td width=\"95%\" align=\"left\">\r\n                                                    <a class=\"tooltip\" href=\"{$quest_datasite}{$quest['0']}\" target=\"_blank\">({$quest_templ[0]}) {$quest_templ['1']}</a>\r\n                                                </td>\r\n                                            </tr>";
            }
            $output .= "\r\n                                            <tr class=\"large_bold\" align=\"left\">\r\n                                                <td colspan=\"2\" class=\"hidden\">{$lang_creature['add_starts_quests']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td colspan=\"2\" align=\"left\">" . makeinfocell($lang_creature['quest_id'], $lang_creature['quest_id_desc']) . " :\r\n                                                    <input type=\"text\" name=\"questrelation\" size=\"8\" maxlength=\"8\" value=\"\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr class=\"large_bold\">\r\n                                                <td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_creature['ends_quests']}:</td>\r\n                                            </tr>";
            $result1 = $sql->query("SELECT quest FROM creature_involvedrelation WHERE id = {$mob['entry']}");
            while ($quest = $sql->fetch_row($result1)) {
                $query1 = $sql->query("SELECT QuestLevel,IFNULL(" . ($deplang != 0 ? "title_loc{$deplang}" : "NULL") . ",`title`) as title FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE quest_template.entry ='{$quest['0']}'");
                $quest_templ = $sql->fetch_row($query1);
                $output .= "\r\n                                            <tr>\r\n                                                <td width=\"5%\">\r\n                                                    <input type=\"checkbox\" name=\"del_involvedrelation[]\" value=\"{$quest['0']}\" />\r\n                                                </td>\r\n                                                <td width=\"95%\" align=\"left\">\r\n                                                    <a class=\"tooltip\" href=\"{$quest_datasite}{$quest['0']}\" target=\"_blank\">({$quest_templ[0]}) {$quest_templ['1']}</a>\r\n                                                </td>\r\n                                            </tr>";
            }
            $output .= "\r\n                                            <tr class=\"large_bold\" align=\"left\">\r\n                                                <td colspan=\"2\" class=\"hidden\">{$lang_creature['add_ends_quests']}:</td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td colspan=\"2\" align=\"left\">" . makeinfocell($lang_creature['quest_id'], $lang_creature['quest_id_desc']) . " :\r\n                                                    <input type=\"text\" name=\"involvedrelation\" size=\"8\" maxlength=\"8\" value=\"\" />\r\n                                                </td>\r\n                                            </tr>\r\n                                            </table>\r\n                                            <br />{$lang_creature['check_to_delete']}<br /><br />\r\n                                        </div>";
        }
        if ($vendor_flag) {
            $output .= "\r\n                                        <div id=\"pane7\">\r\n                                            <br /><br />\r\n                                            <table class=\"lined\" style=\"width: 720px;\">\r\n                                                <tr class=\"large_bold\">\r\n                                                    <td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_creature['sells']}:</td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                </tr>\r\n                                                    <td colspan=\"8\">";
            $cel_counter = 0;
            $row_flag = 0;
            $output .= "\r\n                                                        <table class=\"hidden\" align=\"center\">\r\n                                                            <tr>";
            $result1 = $sql->query("SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry = {$mob['entry']}");
            while ($item = $sql->fetch_row($result1)) {
                $cel_counter++;
                if (!$item[1]) {
                    $count = "{$lang_creature['unlimited']}";
                } else {
                    $count = $item[1];
                }
                $tooltip = get_item_name($item[0]) . "<br />{$lang_creature['count']} : {$count}<br />{$lang_creature['vendor_incrtime']} : {$item['2']}";
                $output .= "\r\n                                                                <td>";
                $output .= maketooltip("<img src=\"" . get_item_icon($item[0]) . "\" class=\"icon_border\" alt=\"\" />", "{$item_datasite}{$item['0']}", $tooltip, "item_tooltip");
                $output .= "\r\n                                                                    <br />\r\n                                                                    <input type=\"checkbox\" name=\"del_vendor_item[]\" value=\"{$item['0']}\" />\r\n                                                                </td>";
                if ($cel_counter >= 14) {
                    $cel_counter = 0;
                    $output .= "\r\n                                                            </tr>\r\n                                                            <tr>";
                    $row_flag++;
                }
            }
            if ($row_flag) {
                $output .= "<td colspan=\"" . (16 - $cel_counter) . "\"></td>";
            }
            $output .= "\r\n                                                            </tr>\r\n                                                        </table>\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">{$lang_creature['add_items_to_vendor']}:</td></tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['vendor_item_id'], $lang_creature['vendor_item_id_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"vendor_item\" size=\"8\" maxlength=\"10\" value=\"\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['vendor_max_count'], $lang_creature['vendor_max_count_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"vendor_maxcount\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['vendor_incrtime'], $lang_creature['vendor_incrtime_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"vendor_incrtime\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['vendor_extended_cost'], $lang_creature['vendor_extended_cost_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"vendor_extended_cost\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                            </table><br />{$lang_creature['check_to_delete']}<br /><br />\r\n                                        </div>";
        }
        if ($trainer_flag) {
            $output .= "\r\n                                        <div id=\"pane8\">\r\n                                            <br /><br />\r\n                                            <table class=\"lined\" style=\"width: 720px;\">\r\n                                                <tr class=\"large_bold\">\r\n                                                    <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['trains']}:</td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td colspan=\"6\">";
            $cel_counter = 0;
            $row_flag = 0;
            $output .= "\r\n                                                        <table class=\"hidden\" align=\"center\">\r\n                                                            <tr>";
            $result1 = $sql->query("SELECT spell, spellcost, reqskill, reqskillvalue, reqlevel FROM npc_trainer WHERE entry = {$mob['entry']} ORDER BY reqlevel");
            while ($spell = $sql->fetch_row($result1)) {
                $cel_counter++;
                $tooltip = "{$lang_creature['spell_id']} : {$spell['0']}<br />{$lang_creature['cost']} :  {$spell['1']}(c)<br />{$lang_creature['req_skill']} : {$spell['2']}<br />{$lang_creature['req_skill_lvl']} :  {$spell['3']}<br />{$lang_creature['req_level']} {$spell['4']}";
                $output .= "\r\n                                                                <td>";
                $output .= maketooltip($spell[0], "{$spell_datasite}{$spell['0']}", $tooltip, "info_tooltip");
                $output .= "\r\n                                                                    <br /><input type=\"checkbox\" name=\"del_trainer_spell[]\" value=\"{$spell['0']}\" />\r\n                                                                </td>";
                if ($cel_counter >= 16) {
                    $cel_counter = 0;
                    $output .= "\r\n                                                            </tr>\r\n                                                            <tr>";
                    $row_flag++;
                }
            }
            if ($row_flag) {
                $output .= "\r\n                                                                <td colspan=\"" . (16 - $cel_counter) . "\"></td>";
            }
            $output .= "\r\n                                                            </tr>\r\n                                                        </table>\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['add_spell_to_trainer']}:</td></tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['train_spell_id'], $lang_creature['train_spell_id_desc']) . "</td>\r\n                                                    <td colspan=\"3\">\r\n                                                        <input type=\"text\" name=\"trainer_spell\" size=\"40\" maxlength=\"10\" value=\"\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['train_cost'], $lang_creature['train_cost_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"spellcost\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['req_skill'], $lang_creature['req_skill_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"reqskill\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['req_skill_value'], $lang_creature['req_skill_value_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"reqskillvalue\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['req_level'], $lang_creature['req_level_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"reqlevel\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                            </table>\r\n                                            <br />{$lang_creature['check_to_delete']}<br /><br />\r\n                                        </div>";
        }
        if ($mob['skinloot']) {
            $output .= "\r\n                                        <div id=\"pane9\">\r\n                                            <br /><br />\r\n                                            <table class=\"lined\" style=\"width: 720px;\">\r\n                                                <tr class=\"large_bold\">\r\n                                                    <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['skinning_loot_tmpl_id']}: {$mob['skinloot']}</td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td colspan=\"6\">";
            $cel_counter = 0;
            $row_flag = 0;
            $output .= "\r\n                                                        <table class=\"hidden\" align=\"center\">\r\n                                                            <tr>";
            $result1 = $sql->query("SELECT item,ChanceOrQuestChance,`groupid`,mincountOrRef,maxcount, lootcondition, condition_value1, condition_value2 FROM skinning_loot_template WHERE entry = {$mob['skinloot']} ORDER BY ChanceOrQuestChance DESC");
            while ($item = $sql->fetch_row($result1)) {
                $cel_counter++;
                $tooltip = get_item_name($item[0]) . " ({$item['0']})<br />{$lang_creature['drop_chance']}: {$item['1']}%<br />{$lang_creature['quest_drop_chance']}: {$item['2']}%<br />{$lang_creature['drop_chance']}: {$item['3']}-{$item['4']}<br />{$lang_creature['lootcondition']}: {$item['5']}<br />{$lang_creature['condition_value1']}: {$item['6']}<br />{$lang_creature['condition_value2']}: {$item['7']}";
                $output .= "\r\n                                                                <td>";
                $output .= maketooltip("<img src=\"" . get_item_icon($item[0]) . "\" class=\"icon_border\" alt=\"\" />", "{$item_datasite}{$item['0']}", $tooltip, "item_tooltip");
                $output .= "\r\n                                                                    <br /><input type=\"checkbox\" name=\"del_skin_items[]\" value=\"{$item['0']}\" />\r\n                                                                </td>";
                if ($cel_counter >= 16) {
                    $cel_counter = 0;
                    $output .= "\r\n                                                            </tr>\r\n                                                            <tr>";
                    $row_flag++;
                }
            }
            if ($row_flag) {
                $output .= "\r\n                                                                <td colspan=\"" . (16 - $cel_counter) . "\"></td>";
            }
            $output .= "\r\n                                                            </tr>\r\n                                                        </table>\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['add_items_to_templ']}:</td></tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['loot_item_id'], $lang_creature['loot_item_id_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"skin_item\" size=\"8\" maxlength=\"10\" value=\"\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['loot_drop_chance'], $lang_creature['loot_drop_chance_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"skin_ChanceOrQuestChance\" size=\"8\" maxlength=\"11\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['loot_quest_drop_chance'], $lang_creature['loot_quest_drop_chance_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"skin_groupid\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['min_count'], $lang_creature['min_count_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"skin_mincountOrRef\" size=\"8\" maxlength=\"3\" value=\"1\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['max_count'], $lang_creature['max_count_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"skin_maxcount\" size=\"8\" maxlength=\"3\" value=\"1\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['lootcondition'], $lang_creature['lootcondition_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"skin_lootcondition\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['condition_value1'], $lang_creature['condition_value1_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"skin_condition_value1\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['condition_value2'], $lang_creature['condition_value2_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"skin_condition_value2\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                            </table>\r\n                                            <br />{$lang_creature['check_to_delete']}<br /><br />\r\n                                        </div>";
        }
        if ($mob['pickpocketloot']) {
            $output .= "\r\n                                        <div id=\"pane10\">\r\n                                            <br /><br />\r\n                                            <table class=\"lined\" style=\"width: 720px;\">\r\n                                                <tr class=\"large_bold\">\r\n                                                    <td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['pickpocketloot_tmpl_id']}: {$mob['pickpocketloot']}</td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td colspan=\"6\">";
            $cel_counter = 0;
            $row_flag = 0;
            $output .= "\r\n                                                        <table class=\"hidden\" align=\"center\">\r\n                                                            <tr>";
            $result1 = $sql->query("SELECT item,ChanceOrQuestChance,`groupid`,mincountOrRef,maxcount, lootcondition, condition_value1, condition_value2 FROM pickpocketing_loot_template WHERE entry = {$mob['pickpocketloot']} ORDER BY ChanceOrQuestChance DESC");
            while ($item = $sql->fetch_row($result1)) {
                $cel_counter++;
                $tooltip = get_item_name($item[0]) . " ({$item['0']})<br />{$lang_creature['drop_chance']}: {$item['1']}%<br />{$lang_creature['quest_drop_chance']}: {$item['2']}%<br />{$lang_creature['drop_chance']}: {$item['3']}-{$item['4']}<br />{$lang_creature['lootcondition']}: {$item['5']}<br />{$lang_creature['condition_value1']}: {$item['6']}<br />{$lang_creature['condition_value2']}: {$item['7']}";
                $output .= "\r\n                                                                <td>";
                $output .= maketooltip("<img src=\"" . get_item_icon($item[0]) . "\" class=\"icon_border\" alt=\"\" />", "{$item_datasite}{$item['0']}", $tooltip, "item_tooltip");
                $output .= "\r\n                                                                    <br /><input type=\"checkbox\" name=\"del_pp_items[]\" value=\"{$item['0']}\" />\r\n                                                                </td>";
                if ($cel_counter >= 16) {
                    $cel_counter = 0;
                    $output .= "\r\n                                                            </tr>\r\n                                                            <tr>";
                    $row_flag++;
                }
            }
            if ($row_flag) {
                $output .= "<td colspan=\"" . (16 - $cel_counter) . "\"></td>";
            }
            $output .= "\r\n                                                            </tr>\r\n                                                        </table>\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_creature['add_items_to_templ']}:</td></tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['loot_item_id'], $lang_creature['loot_item_id_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"pp_item\" size=\"8\" maxlength=\"10\" value=\"\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['loot_drop_chance'], $lang_creature['loot_drop_chance_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"pp_ChanceOrQuestChance\" size=\"8\" maxlength=\"11\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['loot_quest_drop_chance'], $lang_creature['loot_quest_drop_chance_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"pp_groupid\" size=\"8\" maxlength=\"10\" value=\"0\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['min_count'], $lang_creature['min_count_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"pp_mincountOrRef\" size=\"8\" maxlength=\"3\" value=\"1\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['max_count'], $lang_creature['max_count_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"pp_maxcount\" size=\"8\" maxlength=\"3\" value=\"1\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                                <tr>\r\n                                                    <td>" . makeinfocell($lang_creature['lootcondition'], $lang_creature['lootcondition_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"pp_lootcondition\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['condition_value1'], $lang_creature['condition_value1_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"pp_condition_value1\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                    </td>\r\n                                                    <td>" . makeinfocell($lang_creature['condition_value2'], $lang_creature['condition_value2_desc']) . "</td>\r\n                                                    <td>\r\n                                                        <input type=\"text\" name=\"pp_condition_value2\" size=\"8\" maxlength=\"3\" value=\"0\" />\r\n                                                    </td>\r\n                                                </tr>\r\n                                            </table>\r\n                                            <br />{$lang_creature['check_to_delete']}<br /><br />\r\n                                        </div>";
        }
        $output .= "\r\n                                    </div>\r\n                                    </div>\r\n                                    <br />\r\n                                </form>\r\n                                <script type=\"text/javascript\">setupPanes(\"container\", \"tab1\")</script>\r\n                                <table class=\"hidden\">\r\n                                    <tr>\r\n                                        <td>";
        if ($do_insert) {
            if ($user_lvl >= $action_permission['insert'] && $do_insert) {
                makebutton($lang_creature['save_to_db'], "javascript:do_submit('form1',0)", 180);
            }
        } else {
            if ($user_lvl >= $action_permission['insert']) {
                makebutton($lang_creature['save_to_db'], "javascript:do_submit('form1',0)", 180);
            }
            if ($user_lvl >= $action_permission['delete']) {
                makebutton($lang_creature['del_creature'], "creature.php?action=delete&amp;entry={$entry}", 180);
            }
            if ($user_lvl >= $action_permission['delete']) {
                makebutton($lang_creature['del_spawns'], "creature.php?action=delete_spwn&amp;entry={$entry}", 180);
            }
        }
        // scripts/export should be okay without permission check
        makebutton($lang_creature['save_to_script'], "javascript:do_submit('form1',1)", 180);
        $output .= "\r\n                                        </td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td>";
        makebutton($lang_creature['lookup_creature'], "creature.php", 760);
        $output .= "\r\n                                        </td>\r\n                                    </tr>\r\n                                </table>\r\n                            </center>";
        $sql->close();
        unset($sql);
    } else {
        $sql->close();
        unset($sql);
        error($lang_creature['item_not_found']);
        exit;
    }
}
Beispiel #3
0
function do_insert_update($do_insert)
{
    global $output, $world_db, $realm_id, $creature_datasite, $item_datasite, $quest_datasite, $spell_datasite, $action_permission, $user_lvl, $locales_search_option, $arcm_db, $sqlm, $sqlw, $sqld;
    //wowhead_tt();
    require_once "./libs/get_lib.php";
    require_once 'libs/item_lib.php';
    // entry only needed on update
    if (!$do_insert) {
        if (!isset($_GET['entry'])) {
            redirect("vendor.php?error=1");
        }
        $entry = is_numeric($_GET['entry']) ? $sqlw->quote_smart($_GET['entry']) : redirect("vendor.php?error=8");
        $vend_query = "SELECT * FROM vendors WHERE entry = '{$entry}'";
        $vend_restrict_query = "SELECT * FROM vendor_restrictions WHERE entry = '{$entry}'";
        $vend_result = $sqlw->query($vend_query);
        $vend_restrict_result = $sqlw->query($vend_restrict_query);
    } else {
        // get new free id
        $result = $sqlw->query("SELECT max(entry)+1 as newentry from creature_proto");
        $entry = $sqlw->result($result, 0, 'newentry');
        $result = $sqlw->query("SELECT {$entry} as `entry`, 0 as `heroic_entry`, 0 as `KillCredit1`, 0 as `KillCredit2`, 0 as `modelid_A`, 0 as `modelid_A2`, 0 as `modelid_H`, 0 as `modelid_H2`, 'new creature' as`name`,'' as `subname`, '' as `IconName`, 1 as `minlevel`, 1 as `maxlevel`, 1 as `minhealth`, 1 as `maxhealth`, 0 as `minmana`, 0 as `maxmana`, 0 as `armor`,0 as `faction_A`, 0 as `faction_H`, 0 as `npcflag`, 1 as `speed`, 1 as `scale`,0 as `rank`, 1 as `mindmg`, 1 as `maxdmg`, 0 as `dmgschool`, 0 as `attackpower`, 2000 as `baseattacktime`, 0 as `rangeattacktime`, 0 as `unit_flags`,0 as `dynamicflags`, 0 as `family`, 0 as `trainer_type`, 0 as `trainer_spell`, 0 as `trainer_class`,0 as `trainer_race`,0 as `minrangedmg`, 0 as `maxrangedmg`, 0 as `rangedattackpower`, 0 as `type`,0 as `type_flags`,0 as `lootid`, 0 as `pickpocketloot`, 0 as `skinloot`, 0 as `resistance1`, 0 as `resistance2`, 0 as `resistance3`, 0 as `resistance4`, 0 as `resistance5`, 0 as `resistance6`, 0 as`spell1`, 0 as`spell2`, 0 as `spell3`, 0 as `spell4`, 0 as `PetSpellDataId`, 100 as `mingold`, 250 as `maxgold`, '' as `AIName`, 0 as `MovementType`, 1 as `InhabitType`, 0 as `RacialLeader`, 1 as `RegenHealth`, 0 as `equipment_id`, 0 as `mechanic_immune_mask`, 0 as `flags_extra`, '' as `ScriptName`");
        // use id for new creature_template
    }
    $total_found = $sqlw->num_rows($vend_result);
    if ($mob = $sqlw->fetch_assoc($vend_result)) {
        $name_query = "SELECT name FROM creature_names WHERE entry = '" . $mob['entry'] . "'";
        $name_result = $sqlw->query($name_query);
        $vendor_name = $sqlw->fetch_assoc($name_result);
        $output .= "\r\n  <script type=\"text/javascript\" src=\"libs/js/tab.js\"></script>\r\n  <center>\r\n    <span class='large_bold'>\r\n      <a href=\"{$creature_datasite}" . $mob['entry'] . "\">" . $vendor_name['name'] . "</a>\r\n    </span>\r\n    <br />\r\n    <br />\r\n    <br />\r\n    <br />\r\n    <form method=\"post\" action=\"vendor.php?action=del_item\" name=\"form1\">\r\n      <input type=\"hidden\" name=\"backup_op\" value=\"0\"/>\r\n      <input type=\"hidden\" name=\"entry\" value=\"{$entry}\"/>\r\n      <input type=\"hidden\" name=\"insert\" value=\"{$do_insert}\"/>\r\n\r\n      <div class=\"jtab-container\" id=\"container\">\r\n        <ul class=\"jtabs\">\r\n          <li>\r\n            <a href=\"#\" onclick=\"return showPane('pane1', this)\" id=\"tab1\">" . lang('vendor', 'sells') . "</a>\r\n          </li>\r\n          <li>\r\n            <a href=\"#\" onclick=\"return showPane('pane3', this)\">" . lang('vendor', 'restrictions') . "</a>\r\n          </li>";
        $quest_flag = 0;
        $vendor_flag = 0;
        $trainer_flag = 0;
        $output .= "\r\n        </ul>\r\n          <div class=\"jtab-panes\">";
        $output .= "\r\n            <div id=\"pane1\">\r\n              <br />\r\n              <center>";
        $output .= "\r\n                <table class=\"lined\" id=\"vendor_edit_vendor\">\r\n                  <tr>\r\n                    <th width='3%'>&nbsp;</th>\r\n                    <th width='9%'></th>\r\n                    <th width='28%'>" . lang('vendor', 'itemname') . "</th>\r\n                    <th width='15%'>" . lang('vendor', 'quantity') . "</th>\r\n                    <th width='15%'>" . lang('vendor', 'maxquantity') . "</th>\r\n                    <th width='15%'>" . lang('vendor', 'inctime') . "</th>\r\n                    <th width='15%'>" . lang('vendor', 'extcost') . "</th>\r\n                  </tr>";
        $cur_vend = '';
        $vend_result2 = $sqlw->query($vend_query);
        for ($i = 1; $i <= $total_found; $i++) {
            $vendor = $sqlw->fetch_assoc($vend_result2);
            $item_query = "SELECT name1 FROM items WHERE entry = '" . $vendor['item'] . "'";
            $item_result = $sqlw->query($item_query);
            $item_name = $sqlw->fetch_assoc($item_result);
            if ($vendor['extended_cost'] != 0) {
                $extcost_query = "SELECT * FROM itemextendedcost WHERE id = '" . $vendor['extended_cost'] . "'";
                $extcost_result = $sqld->query($extcost_query);
                $extcost = $sqld->fetch_assoc($extcost_result);
                $ext_cost = "";
                $reqHonor = $extcost['ReqHonorPoints'];
                $reqArena = $extcost['ReqArenaPoints'];
                $reqItem1 = $extcost['RequiredItem1'];
                $reqItem2 = $extcost['RequiredItem2'];
                $reqItem3 = $extcost['RequiredItem3'];
                $reqItem4 = $extcost['RequiredItem4'];
                $reqItem5 = $extcost['RequiredItem5'];
                $reqItemCount1 = $extcost['RequiredItemCount1'];
                $reqItemCount2 = $extcost['RequiredItemCount2'];
                $reqItemCount3 = $extcost['RequiredItemCount3'];
                $reqItemCount4 = $extcost['RequiredItemCount4'];
                $reqItemCount5 = $extcost['RequiredItemCount5'];
                if ($reqHonor != 0) {
                    $ext_cost .= $reqHonor . "<img src='./img/money_alliance.gif' alt='Honor' /> ";
                }
                if ($reqArena != 0) {
                    $ext_cost .= $reqArena . "<img src='./img/money_arena.gif' alt='Arena' /> ";
                }
                if ($reqItem1 != 0) {
                    $ext_cost .= "\r\n            <a id='vend_req_item' href='" . $item_datasite . $reqItem1 . "' target='_blank'>\r\n              " . $reqItemCount1 . " <img src='" . get_item_icon($reqItem1) . "' width=16 height=16 alt='" . get_item_name($ReqItem1) . "' /> \r\n            </a>";
                }
                if ($reqItem2 != 0) {
                    $ext_cost .= "\r\n            <a id='vend_req_item' href='" . $item_datasite . $reqItem2 . "' target='_blank'>\r\n              " . $reqItemCount2 . " <img src='" . get_item_icon($reqItem2) . "' width=16 height=16 alt='" . get_item_name($ReqItem2) . "' /> \r\n            </a>";
                }
                if ($reqItem3 != 0) {
                    $ext_cost .= "\r\n            <a id='vend_req_item' href='" . $item_datasite . $reqItem3 . "' target='_blank'>\r\n              " . $reqItemCount3 . " <img src='" . get_item_icon($reqItem3) . "' width=16 height=16 alt='" . get_item_name($ReqItem3) . "' /> \r\n            </a>";
                }
                if ($reqItem4 != 0) {
                    $ext_cost .= "\r\n            <a id='vend_req_item' href='" . $item_datasite . $reqItem4 . "' target='_blank'>\r\n              " . $reqItemCount4 . " <img src='" . get_item_icon($reqItem4) . "' width=16 height=16 alt='" . get_item_name($ReqItem4) . "' /> \r\n            </a>";
                }
                if ($reqItem5 != 0) {
                    $ext_cost .= "\r\n            <a id='vend_req_item' href='" . $item_datasite . $reqItem5 . "' target='_blank'>\r\n              " . $reqItemCount5 . " <img src='" . get_item_icon($reqItem5) . "' width=16 height=16 alt='" . get_item_name($ReqItem5) . "' /> \r\n            </a>";
                }
            }
            //$output .= "<tr>
            //<td><a href=\"$creature_datasite".$creature['entry']."\" target=\"_blank\">".$vendor_name['name']."</a></td>";
            //$output .= "<td></td>";
            if ($user_lvl >= $action_permission['delete']) {
                $output .= '
                <tr>
                  <td>
                    <input type="checkbox" name="check[]" value="' . $vendor['item'] . '" onclick="CheckCheckAll(document.form1);" />
                  </td>';
            } else {
                $output .= '
                  <td></td>';
            }
            $output .= "\r\n                  <td>\r\n                    <a id=\"vendor_item_icon\" href=\"{$item_datasite}" . $vendor['item'] . "\" target=\"_blank\">\r\n                      <img src=\"" . get_item_icon($vendor['item']) . "\" class=\"" . get_item_border($vendor['item']) . "\" alt=\"\" />\r\n                    </a>\r\n                  </td>\r\n                  <td>\r\n                    <a href=\"item.php?action=edit&entry=" . $mob['item'] . "&amp;error=4\">" . $item_name['name1'] . "</a>\r\n                  </td>";
            $output .= "\r\n                  <td>" . $vendor['amount'] . "</td>\r\n                  <td>" . $vendor['max_amount'] . "</td>\r\n                  <td>" . $vendor['inctime'] . "</td>\r\n                  <td>" . $ext_cost . "</td>\r\n                </tr>";
        }
        $output .= "\r\n              </table>\r\n            </center>\r\n            <br />";
        if ($user_lvl >= $action_permission['delete']) {
            makebutton(lang('vendor', 'del_item'), 'javascript:do_submit(\'form1\',0)" type="wrn', 200);
        }
        if ($user_lvl >= $action_permission['insert']) {
            makebutton(lang('vendor', 'add_item'), 'vendor.php?action=add_item&error=10', 130);
        }
        if ($user_lvl >= $action_permission['insert']) {
            makebutton(lang('vendor', 'edit_item'), 'vendor.php?action=add_item&error=10', 150);
        }
        $output .= "\r\n            <br />\r\n            <br />\r\n          </div>\r\n        </form>";
        $vend_restrict = $sqlw->fetch_assoc($vend_restrict_result);
        $output .= "\r\n        <div id=\"pane3\">\r\n          <br />\r\n          <br />\r\n          <form method=\"post\" action=\"vendor.php?action=do_rest_update\" name=\"form2\">\r\n            <input type=\"hidden\" name=\"backup_op\" value=\"0\"/>\r\n            <input type=\"hidden\" name=\"entry\" value=\"{$entry}\"/>\r\n            <input type=\"hidden\" name=\"insert\" value=\"{$do_insert}\"/>\r\n            <table class=\"lined\" id=\"vendor_restrictions\">";
        $output .= "\r\n              <tr>\r\n                <td>" . makeinfocell(lang('vendor', 'racemask'), lang('vendor', 'racemaskdesc')) . "</td>\r\n                <td colspan=\"1\"><input type=\"text\" name=\"racemask\" size=\"12\" maxlength=\"10\" value=\"{$vend_restrict['racemask']}\" /></td>\r\n\r\n                <td></td>\r\n                <td colspan=\"2\"></td>\r\n              </tr>\r\n              <tr>\r\n                <td>" . makeinfocell(lang('vendor', 'reqrepfactionvalue'), lang('vendor', 'reqrepfactionvaluedesc')) . "</td>\r\n                <td><input type=\"text\" name=\"reqrepfactionvalue\" size=\"8\" maxlength=\"45\" value=\"{$vend_restrict['reqrepfactionvalue']}\" /></td>\r\n\r\n                <td>" . makeinfocell(lang('vendor', 'reqrepfaction'), lang('vendor', 'reqrepfactiondesc')) . "</td>\r\n                <td><input type=\"text\" name=\"reqrepfaction\" size=\"8\" maxlength=\"45\" value=\"{$vend_restrict['reqrepfaction']}\" /></td>\r\n              </tr>\r\n              <tr>\r\n                <td>" . makeinfocell(lang('vendor', 'canbuyattextid'), lang('vendor', 'canbuyattextiddesc')) . "</td>\r\n                <td><input type=\"text\" name=\"canbuyattextid\" size=\"8\" maxlength=\"45\" value=\"{$vend_restrict['canbuyattextid']}\" /></td>\r\n\r\n                <td>" . makeinfocell(lang('vendor', 'cannotbuyattextid'), lang('vendor', 'cannotbuyattextiddesc')) . "</td>\r\n                <td><input type=\"text\" name=\"cannotbuyattextid\" size=\"8\" maxlength=\"45\" value=\"{$vend_restrict['cannotbuyattextid']}\" /></td>\r\n              </tr>";
        $output .= "\r\n            </table>\r\n            <br />\r\n            <br />";
        if ($user_lvl >= $action_permission['insert']) {
            makebutton(lang('vendor', 'save_to_db'), "javascript:do_submit('form2',0)", 180);
        }
        $output .= "\r\n          </div>";
        $output .= "\r\n        </div>\r\n      </div>\r\n      <br />\r\n    </form>\r\n\r\n    <script type=\"text/javascript\">setupPanes(\"container\", \"tab1\")</script>\r\n    <table class=\"hidden\">\r\n      <tr>\r\n        <td>";
        if ($do_insert) {
            if ($user_lvl >= $action_permission['insert'] && $do_insert) {
                makebutton(lang('vendor', 'save_to_db'), "javascript:do_submit('form1',0)", 180);
            }
        } else {
            if ($user_lvl >= $action_permission['delete']) {
                makebutton(lang('vendor', 'del_creature'), "vendor.php?action=delete&amp;entry={$entry}", 180);
            }
            //if ($user_lvl >= $action_permission['delete']) makebutton($lang_vendor['del_spawns'], "vendor.php?action=delete_spwn&amp;entry=$entry",180);
        }
        // scripts/export should be okay without permission check
        makebutton(lang('vendor', 'save_to_script'), "javascript:do_submit('form1',1)", 180);
        $output .= "\r\n        </td>\r\n      </tr>\r\n      <tr>\r\n        <td>";
        makebutton(lang('vendor', 'lookup_vendor'), "vendor.php", 760);
        $output .= "\r\n        </td>\r\n      </tr>\r\n    </table>\r\n  </center>";
    } else {
        error(lang('vendor', 'item_not_found'));
        exit;
    }
}
function edit()
{
    global $lang_global, $lang_game_object, $output, $world_db, $realm_id, $item_datasite, $go_datasite, $go_type, $quest_datasite;
    wowhead_tt();
    if (!isset($_GET['entry'])) {
        redirect("game_object.php?error=1");
    }
    $sql = new SQL();
    $sql->connect($world_db[$realm_id]['addr'], $world_db[$realm_id]['user'], $world_db[$realm_id]['pass'], $world_db[$realm_id]['name']);
    $entry = $sql->quote_smart($_GET['entry']);
    require_once "./scripts/get_lib.php";
    $deplang = get_lang_id();
    $result = $sql->query("SELECT gameobject_template.`entry`,`type`,`displayId`,IFNULL(" . ($deplang != 0 ? "name_loc{$deplang}" : "NULL") . ",`name`) as name,`faction`,`flags`,`size`,`data0`,`data1`,`data2`,`data3`,`data4`,`data5`,`data6`,`data7`,`data8`,`data9`,`data10`,`data11`,`data12`,`data13`,`data14`,`data15`,`data16`,`data17`,`data18`,`data19`,`data20`,`data21`,`data22`,`data23`,`ScriptName` FROM gameobject_template LEFT JOIN locales_gameobject ON gameobject_template.entry = locales_gameobject.entry WHERE gameobject_template.entry = '{$entry}'");
    if ($go = $sql->fetch_assoc($result)) {
        $output .= "<script type=\"text/javascript\" src=\"libs/js/tab.js\"></script>\r\n   <center>\r\n    <br /><br /><br />\r\n    <form method=\"post\" action=\"game_object.php?action=do_update\" name=\"form1\">\r\n    <input type=\"hidden\" name=\"backup_op\" value=\"0\"/>\r\n    <input type=\"hidden\" name=\"opp_type\" value=\"edit\"/>\r\n    <input type=\"hidden\" name=\"entry\" value=\"{$entry}\"/>\r\n\r\n<div class=\"jtab-container\" id=\"container\">\r\n  <ul class=\"jtabs\">\r\n    <li><a href=\"#\" onclick=\"return showPane('pane1', this)\" id=\"tab1\">{$lang_game_object['general']}</a></li>\r\n    <li><a href=\"#\" onclick=\"return showPane('pane2', this)\">{$lang_game_object['datas']}</a></li>";
        if ($go['type'] == 3) {
            $output .= "<li><a href=\"#\" onclick=\"return showPane('pane3', this)\">{$lang_game_object['loot']}</a></li>";
        }
        $output .= "<li><a href=\"#\" onclick=\"return showPane('pane4', this)\">{$lang_game_object['quests']}</a></li>\r\n  </ul>\r\n  <div class=\"jtab-panes\">";
        $output .= "<div id=\"pane1\"><br /><br />\r\n<table class=\"lined\" style=\"width: 720px;\">\r\n<tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_game_object['general']}:</td></tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['entry'], $lang_game_object['entry_desc']) . "</td>\r\n <td><a href=\"{$go_datasite}{$go['entry']}\" target=\"_blank\">{$go['entry']}</a></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['name'], $lang_game_object['name_desc']) . "</td>\r\n <td ><input type=\"text\" name=\"name\" size=\"25\" maxlength=\"100\" value=\"{$go['name']}\" /></td>\r\n\r\n  <td>" . makeinfocell($lang_game_object['faction'], $lang_game_object['faction_desc']) . "</td>\r\n <td><input type=\"text\" name=\"faction\" size=\"10\" maxlength=\"4\" value=\"{$go['faction']}\" /></td>\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['type'], $lang_game_object['type_desc']) . "</td>\r\n <td colspan=\"3\"><select name=\"type\">";
        foreach ($go_type as $type) {
            $output .= "<option value=\"{$type['0']}\" ";
            if ($type[0] == $go['type']) {
                $output .= "selected=\"selected\" ";
            }
            $output .= ">({$type['0']}) {$type['1']}</option>";
        }
        $output .= "</select></td>\r\n <td>" . makeinfocell($lang_game_object['displayId'], $lang_game_object['displayId_desc']) . "</td>\r\n <td><input type=\"text\" name=\"displayId\" size=\"10\" maxlength=\"11\" value=\"{$go['displayId']}\" /></td>\r\n\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['flags'], $lang_game_object['flags_desc']) . "</td>\r\n <td><input type=\"text\" name=\"flags\" size=\"10\" maxlength=\"4\" value=\"{$go['flags']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['size'], $lang_game_object['size_desc']) . "</td>\r\n <td><input type=\"text\" name=\"size\" size=\"10\" maxlength=\"25\" value=\"{$go['size']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['script_name'], $lang_game_object['ScriptName_desc']) . "</td>\r\n <td><input type=\"text\" name=\"ScriptName\" size=\"10\" maxlength=\"100\" value=\"{$go['ScriptName']}\" /></td>\r\n</tr>\r\n\r\n<tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_game_object['data']}:</td></tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['data'] . " 0", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data0\" size=\"10\" maxlength=\"11\" value=\"{$go['data0']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 1", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data1\" size=\"10\" maxlength=\"11\" value=\"{$go['data1']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 2", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data2\" size=\"10\" maxlength=\"11\" value=\"{$go['data2']}\" /></td>\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['data'] . " 3", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data3\" size=\"10\" maxlength=\"11\" value=\"{$go['data3']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 4", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data4\" size=\"10\" maxlength=\"11\" value=\"{$go['data4']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 5", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data5\" size=\"10\" maxlength=\"11\" value=\"{$go['data5']}\" /></td>\r\n</tr>\r\n</table><br />";
        $result1 = $sql->query("SELECT COUNT(*) FROM gameobject WHERE id = '{$go['entry']}'");
        $output .= "<tr><td colspan=\"6\">{$lang_game_object['go_swapned']} : " . $sql->result($result1, 0) . " {$lang_game_object['times']}.</td></tr>\r\n\r\n<br />\r\n</div>\r\n\r\n<div id=\"pane2\">\r\n  <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n\r\n<tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_game_object['data']}:</td></tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['data'] . " 6", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data6\" size=\"10\" maxlength=\"11\" value=\"{$go['data6']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 7", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data7\" size=\"10\" maxlength=\"11\" value=\"{$go['data7']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 8", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data8\" size=\"10\" maxlength=\"11\" value=\"{$go['data8']}\" /></td>\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['data'] . " 9", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data9\" size=\"10\" maxlength=\"11\" value=\"{$go['data9']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 10", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data10\" size=\"10\" maxlength=\"11\" value=\"{$go['data10']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 11", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data11\" size=\"10\" maxlength=\"11\" value=\"{$go['data11']}\" /></td>\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['data'] . " 12", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data12\" size=\"10\" maxlength=\"11\" value=\"{$go['data12']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 13", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data13\" size=\"10\" maxlength=\"11\" value=\"{$go['data13']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 14", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data14\" size=\"10\" maxlength=\"11\" value=\"{$go['data14']}\" /></td>\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['data'] . " 15", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data15\" size=\"10\" maxlength=\"11\" value=\"{$go['data15']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 16", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data16\" size=\"10\" maxlength=\"11\" value=\"{$go['data16']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 17", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data17\" size=\"10\" maxlength=\"11\" value=\"{$go['data17']}\" /></td>\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['data'] . " 18", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data18\" size=\"10\" maxlength=\"11\" value=\"{$go['data18']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 19", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data19\" size=\"10\" maxlength=\"11\" value=\"{$go['data19']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 20", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data20\" size=\"10\" maxlength=\"11\" value=\"{$go['data20']}\" /></td>\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell($lang_game_object['data'] . " 21", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data21\" size=\"10\" maxlength=\"11\" value=\"{$go['data21']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 22", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data22\" size=\"10\" maxlength=\"11\" value=\"{$go['data22']}\" /></td>\r\n\r\n <td>" . makeinfocell($lang_game_object['data'] . " 23", $lang_game_object['data_desc']) . "</td>\r\n <td><input type=\"text\" name=\"data23\" size=\"10\" maxlength=\"11\" value=\"{$go['data23']}\" /></td>\r\n</tr>\r\n</table>\r\n<br />\r\n</div>";
        if ($go['type'] == 3) {
            $output .= "<div id=\"pane3\">\r\n  <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n  <tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_game_object['loot_tmpl_id']}:</td></tr>\r\n<tr>\r\n  <td colspan=\"6\">";
            require_once "scripts/get_lib.php";
            $cel_counter = 0;
            $row_flag = 0;
            $output .= "<table class=\"hidden\" align=\"center\"><tr>";
            $result1 = $sql->query("SELECT item,ChanceOrQuestChance,`groupid`,mincountOrRef,maxcount, lootcondition, condition_value1, condition_value2 FROM gameobject_loot_template WHERE entry = {$go['data1']} ORDER BY ChanceOrQuestChance DESC");
            while ($item = $sql->fetch_row($result1)) {
                $cel_counter++;
                $tooltip = get_item_name($item[0]) . " ({$item['0']})<br />{$lang_game_object['drop_chance']}: {$item['1']}%<br />{$lang_game_object['quest_drop_chance']}: {$item['2']}%<br />{$lang_game_object['drop_chance']}: {$item['3']}-{$item['4']}<br />{$lang_game_object['lootcondition']}: {$item['5']}<br />{$lang_game_object['condition_value1']}: {$item['6']}<br />{$lang_game_object['condition_value2']}: {$item['7']}";
                $output .= "<td>";
                $output .= maketooltip("<img src=\"" . get_item_icon($item[0]) . "\" class=\"icon_border\" alt=\"\" />", "{$item_datasite}{$item['0']}", "{$tooltip}", "item_tooltip", "target=\"_blank\"");
                $output .= "<br /><input type=\"checkbox\" name=\"del_loot_items[]\" value=\"{$item['0']}\" /></td>";
                if ($cel_counter >= 16) {
                    $cel_counter = 0;
                    $output .= "</tr><tr>";
                    $row_flag++;
                }
            }
            if ($row_flag) {
                $output .= "<td colspan=\"" . (16 - $cel_counter) . "\"></td>";
            }
            $output .= "</td></tr></table>\r\n </td>\r\n</tr>\r\n<tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">{$lang_game_object['add_items_to_templ']}:</td></tr>\r\n<tr>\r\n<td>" . makeinfocell($lang_game_object['loot_item_id'], $lang_game_object['loot_item_id_desc']) . "</td>\r\n  <td><input type=\"text\" name=\"item\" size=\"8\" maxlength=\"10\" value=\"\" /></td>\r\n<td>" . makeinfocell($lang_game_object['loot_drop_chance'], $lang_game_object['loot_drop_chance_desc']) . "</td>\r\n  <td><input type=\"text\" name=\"ChanceOrQuestChance\" size=\"8\" maxlength=\"11\" value=\"0\" /></td>\r\n<td>" . makeinfocell($lang_game_object['loot_quest_drop_chance'], $lang_game_object['loot_quest_drop_chance_desc']) . "</td>\r\n  <td><input type=\"text\" name=\"groupid\" size=\"8\" maxlength=\"10\" value=\"0\" /></td>\r\n</tr>\r\n<tr>\r\n<td>" . makeinfocell($lang_game_object['min_count'], $lang_game_object['min_count_desc']) . "</td>\r\n  <td><input type=\"text\" name=\"mincountOrRef\" size=\"8\" maxlength=\"3\" value=\"1\" /></td>\r\n<td>" . makeinfocell($lang_game_object['max_count'], $lang_game_object['max_count_desc']) . "</td>\r\n  <td><input type=\"text\" name=\"maxcount\" size=\"8\" maxlength=\"3\" value=\"1\" /></td>\r\n</tr>\r\n<tr>\r\n<td>" . makeinfocell($lang_game_object['lootcondition'], $lang_game_object['lootcondition_desc']) . "</td>\r\n  <td><input type=\"text\" name=\"lootcondition\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\r\n<td>" . makeinfocell($lang_game_object['condition_value1'], $lang_game_object['condition_value1_desc']) . "</td>\r\n  <td><input type=\"text\" name=\"condition_value1\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\r\n<td>" . makeinfocell($lang_game_object['condition_value2'], $lang_game_object['condition_value2']) . "</td>\r\n  <td><input type=\"text\" name=\"condition_value2\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\r\n</tr>\r\n</table><br />{$lang_game_object['check_to_delete']}<br /><br />\r\n</div>";
        }
        $output .= "<div id=\"pane4\">\r\n  <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n  <tr class=\"large_bold\"><td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_game_object['start_quests']}:</td></tr>";
        $result1 = $sql->query("SELECT quest FROM gameobject_questrelation WHERE id = {$go['entry']}");
        while ($quest = $sql->fetch_row($result1)) {
            $query1 = $sql->query("SELECT QuestLevel, IFNULL(" . ($deplang != 0 ? "title_loc{$deplang}" : "NULL") . ",`title`) as Title FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE quest_template.entry ='{$quest['0']}'");
            $quest_templ = $sql->fetch_row($query1);
            $output .= "<tr><td width=\"5%\"><input type=\"checkbox\" name=\"del_questrelation[]\" value=\"{$quest['0']}\" /></td>\r\n          <td width=\"95%\" align=\"left\"><a class=\"tooltip\" href=\"{$quest_datasite}{$quest['0']}\" target=\"_blank\">({$quest_templ[0]}) {$quest_templ['1']}</a></td></tr>";
        }
        $output .= "<tr class=\"large_bold\" align=\"left\"><td colspan=\"2\" class=\"hidden\">{$lang_game_object['add_starts_quests']}:</td></tr>\r\n  <tr><td colspan=\"2\" align=\"left\">" . makeinfocell($lang_game_object['quest_id'], $lang_game_object['quest_id_desc']) . " :\r\n    <input type=\"text\" name=\"questrelation\" size=\"8\" maxlength=\"8\" value=\"\" /></td></tr>\r\n\r\n<tr class=\"large_bold\"><td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_game_object['ends_quests']}:</td></tr>";
        $result1 = $sql->query("SELECT quest FROM gameobject_involvedrelation WHERE id = {$go['entry']}");
        while ($quest = $sql->fetch_row($result1)) {
            $query1 = $sql->query("SELECT QuestLevel, IFNULL(" . ($deplang != 0 ? "title_loc{$deplang}" : "NULL") . ",`title`) as Title FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE quest_template.entry ='{$quest['0']}'");
            $quest_templ = $sql->fetch_row($query1);
            $output .= "<tr><td width=\"5%\"><input type=\"checkbox\" name=\"del_involvedrelation[]\" value=\"{$quest['0']}\" /></td>\r\n        <td width=\"95%\" align=\"left\"><a class=\"tooltip\" href=\"{$quest_datasite}{$quest['0']}\" target=\"_blank\">({$quest_templ[0]}) {$quest_templ['1']}</a></td></tr>";
        }
        $output .= "<tr class=\"large_bold\" align=\"left\"><td colspan=\"2\" class=\"hidden\">{$lang_game_object['add_ends_quests']}:</td></tr>\r\n  <tr><td colspan=\"2\" align=\"left\">" . makeinfocell($lang_game_object['quest_id'], $lang_game_object['quest_id_desc']) . " :\r\n    <input type=\"text\" name=\"involvedrelation\" size=\"8\" maxlength=\"8\" value=\"\" /></td></tr>\r\n\r\n</table><br />{$lang_game_object['check_to_delete']}<br /><br />\r\n</div>\r\n\r\n</div>\r\n</div>\r\n<br />\r\n</form>\r\n\r\n<script type=\"text/javascript\">setupPanes(\"container\", \"tab1\")</script>";
        $output .= "<table class=\"hidden\">\r\n          <tr><td>";
        makebutton($lang_game_object['save_to_db'], "javascript:do_submit('form1',0)", 180);
        makebutton($lang_game_object['del_go'], "game_object.php?action=delete&amp;entry={$entry}", 180);
        makebutton($lang_game_object['del_spawns'], "game_object.php?action=delete_spwn&amp;entry={$entry}", 180);
        makebutton($lang_game_object['save_to_script'], "javascript:do_submit('form1',1)", 180);
        $output .= "</td></tr><tr><td>";
        makebutton($lang_game_object['lookup_go'], "game_object.php", 760);
        $output .= "</td></tr>\r\n        </table></center>";
        $sql->close();
    } else {
        $sql->close();
        error($lang_game_object['tmpl_not_found']);
        exit;
    }
}
Beispiel #5
0
function edit()
{
    global $output, $world_db, $realm_id, $item_datasite, $lang_id_tab, $quest_datasite, $action_permission, $user_lvl, $creature_datasite, $sqlw;
    //wowhead_tt();
    valid_login($action_permission['view']);
    if (!isset($_GET['entry'])) {
        redirect("item.php?error=1");
    }
    /*$sql = new SQL;
     $sql->connect($world_db[$realm_id]['addr'], $world_db[$realm_id]['user'], $world_db[$realm_id]['pass'], $world_db[$realm_id]['name']);*/
    $entry = $sqlw->quote_smart($_GET['entry']);
    $deplang = get_lang_id();
    // this_is_junk: ArcEmu stores the quantity you get when you buy an item in the vendors table
    //               Both MaNGOS databases that I have (UDB 371 and YTDB 507 have ZERO items with requiredhonorrank that is not ZERO.
    //               Same for requiredcityrank.
    //               I don't know what socketcontent_* does in MaNGOS, it's ZERO unless it equals socketcolor_*
    //                  which is probably why ArcEmu has Unknown columns after each socket_color_* field.
    //               ArcEmu doesn't have a scriptname field.
    //               ArcEmu doesn't seem to have a field like DisenchantID
    //               I'm not sure what minmoneyloot and maxmoneyloot actually do.
    //$result = $sql->query("SELECT `items`.`entry`,`class`,`subclass`,`field4`,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name1`) as name,`displayid`,`Quality`,`Flags`,`BuyPrice`,`SellPrice`,`InventoryType`,`AllowableClass`,`AllowableRace`,`ItemLevel`,`RequiredLevel`,`RequiredSkill`,`RequiredSkillRank`,`requiredspell`,`RequiredFaction`,`RequiredFactionStanding`,`unique`,`maxcount`,`ContainerSlots`,`stat_type1`,`stat_value1`,`stat_type2`,`stat_value2`,`stat_type3`,`stat_value3`,`stat_type4`,`stat_value4`,`stat_type5`,`stat_value5`,`stat_type6`,`stat_value6`,`stat_type7`,`stat_value7`,`stat_type8`,`stat_value8`,`stat_type9`,`stat_value9`,`stat_type10`,`stat_value10`,`dmg_min1`,`dmg_max1`,`dmg_type1`,`dmg_min2`,`dmg_max2`,`dmg_type2`,`armor`,`holy_res`,`fire_res`,`nature_res`,`frost_res`,`shadow_res`,`arcane_res`,`delay`,`ammo_type`,`Range`,`spellid_1`,`spelltrigger_1`,`spellcharges_1`,`spellcooldown_1`,`spellcategory_1`,`spellcategorycooldown_1`,`spellid_2`,`spelltrigger_2`,`spellcharges_2`,`spellcooldown_2`,`spellcategory_2`,`spellcategorycooldown_2`,`spellid_3`,`spelltrigger_3`,`spellcharges_3`,`spellcooldown_3`,`spellcategory_3`,`spellcategorycooldown_3`,`spellid_4`,`spelltrigger_4`,`spellcharges_4`,`spellcooldown_4`,`spellcategory_4`,`spellcategorycooldown_4`,`spellid_5`,`spelltrigger_5`,`spellcharges_5`,`spellcooldown_5`,`spellcategory_5`,`spellcategorycooldown_5`,`bonding`,items.`description`,`Page_id`,`Page_language`,`Page_Material`,`quest_id`,`lock_id`,`lock_Material`,`sheathid`,`RandomProp`,`RandomSuffix`,`block`,`itemset`,`MaxDurability`,`zonenameid`,`Mapid`,`BagFamily`,`TotemCategory`,`socket_Color_1`,`socket_Color_2`,`socket_Color_3`,`socket_Bonus`,`GemProperties`,`ReqDisenchantSkill`,`ArmorDamageModifier`,itempetfood.`Food_Type` FROM items LEFT JOIN items_localized ON items.entry = items_localized.entry LEFT JOIN itempetfood ON items.entry = itempetfood.entry WHERE items.entry = '$entry'");
    $result = $sqlw->query("SELECT `items`.`entry`,`class`,`subclass`,`field4`,`name1`,`displayid`,`Quality`,`Flags`,`BuyPrice`,`SellPrice`,`InventoryType`,`AllowableClass`,`AllowableRace`,`ItemLevel`,`RequiredLevel`,`RequiredSkill`,`RequiredSkillRank`,`requiredspell`,`RequiredFaction`,`RequiredFactionStanding`,`unique`,`maxcount`,`ContainerSlots`,`stat_type1`,`stat_value1`,`stat_type2`,`stat_value2`,`stat_type3`,`stat_value3`,`stat_type4`,`stat_value4`,`stat_type5`,`stat_value5`,`stat_type6`,`stat_value6`,`stat_type7`,`stat_value7`,`stat_type8`,`stat_value8`,`stat_type9`,`stat_value9`,`stat_type10`,`stat_value10`,`dmg_min1`,`dmg_max1`,`dmg_type1`,`dmg_min2`,`dmg_max2`,`dmg_type2`,`armor`,`holy_res`,`fire_res`,`nature_res`,`frost_res`,`shadow_res`,`arcane_res`,`delay`,`ammo_type`,`Range`,`spellid_1`,`spelltrigger_1`,`spellcharges_1`,`spellcooldown_1`,`spellcategory_1`,`spellcategorycooldown_1`,`spellid_2`,`spelltrigger_2`,`spellcharges_2`,`spellcooldown_2`,`spellcategory_2`,`spellcategorycooldown_2`,`spellid_3`,`spelltrigger_3`,`spellcharges_3`,`spellcooldown_3`,`spellcategory_3`,`spellcategorycooldown_3`,`spellid_4`,`spelltrigger_4`,`spellcharges_4`,`spellcooldown_4`,`spellcategory_4`,`spellcategorycooldown_4`,`spellid_5`,`spelltrigger_5`,`spellcharges_5`,`spellcooldown_5`,`spellcategory_5`,`spellcategorycooldown_5`,`bonding`,items.`description`,`Page_id`,`Page_language`,`Page_Material`,`quest_id`,`lock_id`,`lock_Material`,`sheathid`,`RandomProp`,`RandomSuffix`,`block`,`itemset`,`MaxDurability`,`zonenameid`,`Mapid`,`BagFamily`,`TotemCategory`,`socket_Color_1`,`socket_Color_2`,`socket_Color_3`,`socket_Bonus`,`GemProperties`,`ReqDisenchantSkill`,`ArmorDamageModifier` FROM items WHERE items.entry = '{$entry}'");
    if ($result) {
        $item = $sqlw->fetch_assoc($result);
        require_once "libs/get_lib.php";
        //$tooltip = get_item_tooltip($entry);
        $output .= "<script type=\"text/javascript\" src=\"libs/js/tab.js\"></script>\r\n   <center>\r\n    <br /><br /><br />\r\n    <form method=\"post\" action=\"item.php?action=do_update\" name=\"form1\">\r\n    <input type=\"hidden\" name=\"backup_op\" value=\"0\"/>\r\n    <input type=\"hidden\" name=\"type\" value=\"edit\"/>\r\n    <input type=\"hidden\" name=\"entry\" value=\"{$entry}\"/>\r\n\r\n<div class=\"jtab-container\" id=\"container\">\r\n  <ul class=\"jtabs\">\r\n    <li><a href=\"#\" onclick=\"return showPane('pane1', this)\" id=\"tab1\">" . lang('item_edit', 'general_tab') . "</a></li>\r\n    <li><a href=\"#\" onclick=\"return showPane('pane2', this)\">" . lang('item_edit', 'additional_tab') . "</a></li>\r\n    <li><a href=\"#\" onclick=\"return showPane('pane3', this)\">" . lang('item_edit', 'stats_tab') . "</a></li>\r\n  <li><a href=\"#\" onclick=\"return showPane('pane4', this)\">" . lang('item_edit', 'damage_tab') . "</a></li>\r\n  <li><a href=\"#\" onclick=\"return showPane('pane5', this)\">" . lang('item_edit', 'spell_tab') . "</a></li>\r\n  <li><a href=\"#\" onclick=\"return showPane('pane7', this)\">" . lang('item_edit', 'sock_tab') . "</a></li>\r\n  <li><a href=\"#\" onclick=\"return showPane('pane6', this)\">" . lang('item_edit', 'req_tab') . "</a></li>\r\n  <li><a href=\"#\" onclick=\"return showPane('pane8', this)\">" . lang('item_edit', 'info') . "</a></li>";
        if ($item['DisenchantID']) {
            $output .= "<li><a href=\"#\" onclick=\"return showPane('pane9', this)\">" . lang('item_edit', 'disenchant_tab') . "</a></li>";
        }
        $output .= "</ul>\r\n  <div class=\"jtab-panes\">";
        $output .= "<div id=\"pane1\">\r\n    <br /><br />\r\n<table class=\"lined\" style=\"width: 720px;\">\r\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'general') . ":</td></tr>\r\n<tr>\r\n <td>" . makeinfocell(lang('item_edit', 'entry'), lang('item_edit', 'entry_desc')) . "</td>\r\n <td>";
        // this_is_junk: I re-enabled display of item ID, even if it isn't guaranteed to work with wowhead. :P
        $output .= maketooltip($entry, "{$item_datasite}{$entry}", $tooltip, "item_tooltip");
        $output .= "</td>\r\n <td>" . makeinfocell(lang('item_edit', 'display_id'), lang('item_edit', 'display_id_desc')) . "</td>\r\n <td><input type=\"text\" name=\"displayid\" size=\"8\" maxlength=\"11\" value=\"{$item['displayid']}\" /></td>\r\n\r\n <td>" . makeinfocell(lang('item_edit', 'req_level'), lang('item_edit', 'req_level_desc')) . "</td>\r\n <td><input type=\"text\" name=\"RequiredLevel\" size=\"8\" maxlength=\"4\" value=\"{$item['RequiredLevel']}\" /></td>\r\n\r\n <td>" . makeinfocell(lang('item_edit', 'item_level'), lang('item_edit', 'item_level_desc')) . "</td>\r\n <td><input type=\"text\" name=\"ItemLevel\" size=\"8\" maxlength=\"4\" value=\"{$item['ItemLevel']}\" /></td>\r\n</tr>\r\n\r\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'names') . ":</td></tr>\r\n<tr>\r\n <td>" . makeinfocell(lang('item_edit', 'item_name'), lang('item_edit', 'item_name_desc')) . "</td>\r\n <td colspan=\"3\"><input type=\"text\" name=\"name\" size=\"30\" maxlength=\"225\" value=\"" . htmlentities($item['name1']) . "\" /></td>\r\n\r\n <td>" . makeinfocell(lang('item_edit', 'description'), lang('item_edit', 'description_desc')) . "</td>\r\n <td colspan=\"3\"><input type=\"text\" name=\"description\" size=\"30\" maxlength=\"225\" value=\"" . htmlentities($item['description']) . "\" /></td>\r\n</tr>\r\n\r\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'type') . ":</td></tr>\r\n   <tr>";
        $class = array(0 => "", 1 => "", 2 => "", 4 => "", 5 => "", 6 => "", 7 => "", 9 => "", 11 => "", 12 => "", 13 => "", 14 => "", 15 => "");
        $class[$item['class']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'class'), lang('item_edit', 'class_desc')) . "</td>\r\n  <td colspan=\"3\"><select name=\"class\">\r\n    <option value=\"0\" {$class[0]}>0 - " . lang('item', 'consumable') . "</option>\r\n    <option value=\"1\" {$class[1]}>1 - " . lang('item', 'bag') . "</option>\r\n    <option value=\"2\" {$class[2]}>2 - " . lang('item', 'weapon') . "</option>\r\n    <option value=\"4\" {$class[4]}>4 - " . lang('item', 'armor') . "</option>\r\n    <option value=\"5\" {$class[5]}>5 - " . lang('item', 'reagent') . "</option>\r\n    <option value=\"6\" {$class[6]}>6 - " . lang('item', 'projectile') . "</option>\r\n    <option value=\"7\" {$class[7]}>7 - " . lang('item', 'trade_goods') . "s</option>\r\n    <option value=\"9\" {$class[9]}>9 - " . lang('item', 'recipe') . "</option>\r\n    <option value=\"11\" {$class[11]}>11 - " . lang('item', 'quiver') . "</option>\r\n    <option value=\"12\" {$class[12]}>12 - " . lang('item', 'quest') . "</option>\r\n    <option value=\"13\" {$class[13]}>13 - " . lang('item', 'key') . "</option>\r\n    <option value=\"14\" {$class[14]}>14 - " . lang('item', 'permanent') . "</option>\r\n    <option value=\"15\" {$class[15]}>15 - " . lang('item', 'misc_short') . "</option>\r\n     </select></td>";
        unset($class);
        $subclass = array(0 => array(0 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => ""), 1 => array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => ""), 2 => array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 10 => "", 11 => "", 12 => "", 13 => "", 14 => "", 15 => "", 16 => "", 17 => "", 18 => "", 19 => "", 20 => ""), 4 => array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 9 => ""), 6 => array(2 => "", 3 => ""), 7 => array(0 => "", 1 => "", 2 => "", 3 => ""), 9 => array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => ""), 11 => array(2 => "", 3 => ""), 13 => array(0 => "", 1 => ""));
        $subclass[$item['class']][$item['subclass']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'subclass'), lang('item_edit', 'subclass_desc')) . "</td>\r\n  <td colspan=\"3\"><select name=\"subclass\">\r\n    <option value=\"0\" {$subclass[0][0]}>0 - " . lang('item', 'none') . "</option>\r\n    <optgroup label=\"Class 0: " . lang('item', 'consumable') . "\">\r\n    <option value=\"0\" {$subclass[0][0]}>0 - " . lang('item', 'consumable') . "</option>\r\n    <option value=\"3\" {$subclass[0][3]}>3 - " . lang('item', 'potion') . "</option>\r\n    <option value=\"4\" {$subclass[0][4]}>4 - " . lang('item', 'scroll') . "</option>\r\n    <option value=\"5\" {$subclass[0][5]}>5 - " . lang('item', 'bandage') . "</option>\r\n    <option value=\"6\" {$subclass[0][6]}>6 - " . lang('item', 'healthstone') . "</option>\r\n    <option value=\"7\" {$subclass[0][7]}>7 - " . lang('item', 'combat_effect') . "</option>\r\n  <optgroup label=\"Class 1: " . lang('item', 'bag') . "\">\r\n    <option value=\"0\" {$subclass[1][0]}>0 - " . lang('item', 'bag') . "</option>\r\n    <option value=\"1\" {$subclass[1][1]}>1 - " . lang('item', 'soul_shards') . "</option>\r\n    <option value=\"2\" {$subclass[1][2]}>2 - " . lang('item', 'herbs') . "</option>\r\n    <option value=\"3\" {$subclass[1][3]}>3 - " . lang('item', 'enchanting') . "</option>\r\n    <option value=\"4\" {$subclass[1][4]}>4 - " . lang('item', 'engineering') . "</option>\r\n    <option value=\"5\" {$subclass[1][5]}>5 - " . lang('item', 'gems') . "</option>\r\n    <option value=\"6\" {$subclass[1][6]}>6 - " . lang('item', 'mining') . "</option>\r\n  <optgroup label=\"Class 2: " . lang('item', 'weapon') . "\">\r\n    <option value=\"0\" {$subclass[2][0]}>0 - " . lang('item', 'axe_1h') . "</option>\r\n    <option value=\"1\" {$subclass[2][2]}>1 - " . lang('item', 'axe_2h') . "</option>\r\n    <option value=\"2\" {$subclass[2][2]}>2 - " . lang('item', 'bow') . "</option>\r\n    <option value=\"3\" {$subclass[2][2]}>3 - " . lang('item', 'rifle') . "</option>\r\n    <option value=\"4\" {$subclass[2][4]}>4 - " . lang('item', 'mace_1h') . "</option>\r\n    <option value=\"5\" {$subclass[2][5]}>5 - " . lang('item', 'mace_2h') . "</option>\r\n    <option value=\"6\" {$subclass[2][6]}>6 - " . lang('item', 'polearm') . "</option>\r\n    <option value=\"7\" {$subclass[2][7]}>7 - " . lang('item', 'sword_1h') . "</option>\r\n    <option value=\"8\" {$subclass[2][8]}>8 - " . lang('item', 'sword_2h') . "</option>\r\n    <option value=\"10\" {$subclass[2][10]}>10 - " . lang('item', 'staff') . "</option>\r\n    <option value=\"11\" {$subclass[2][11]}>11 - " . lang('item', 'exotic_1h') . "</option>\r\n    <option value=\"12\" {$subclass[2][12]}>12 - " . lang('item', 'exotic_2h') . "</option>\r\n    <option value=\"13\" {$subclass[2][13]}>13 - " . lang('item', 'fist_weapon') . "</option>\r\n    <option value=\"14\" {$subclass[2][14]}>14 - " . lang('item', 'misc_weapon') . "</option>\r\n    <option value=\"15\" {$subclass[2][15]}>15 - " . lang('item', 'dagger') . "</option>\r\n    <option value=\"16\" {$subclass[2][16]}>16 - " . lang('item', 'thrown') . "</option>\r\n    <option value=\"17\" {$subclass[2][17]}>17 - " . lang('item', 'spear') . "</option>\r\n    <option value=\"18\" {$subclass[2][18]}>18 - " . lang('item', 'crossbow') . "</option>\r\n    <option value=\"19\" {$subclass[2][19]}>19 - " . lang('item', 'wand') . "</option>\r\n    <option value=\"20\" {$subclass[2][20]}>20 - " . lang('item', 'fishing_pole') . "</option>\r\n  </optgroup>\r\n  <optgroup label=\"Class 4: " . lang('item', 'armor') . "\">\r\n    <option value=\"0\" {$subclass[4][0]}>0 - " . lang('item', 'misc') . "</option>\r\n    <option value=\"1\" {$subclass[4][1]}>1 - " . lang('item', 'cloth') . "</option>\r\n    <option value=\"2\" {$subclass[4][2]}>2 - " . lang('item', 'leather') . "</option>\r\n    <option value=\"3\" {$subclass[4][3]}>3 - " . lang('item', 'mail') . "</option>\r\n    <option value=\"4\" {$subclass[4][4]}>4 - " . lang('item', 'plate') . "</option>\r\n    <option value=\"5\" {$subclass[4][5]}>5 - " . lang('item', 'buckler') . "</option>\r\n    <option value=\"6\" {$subclass[4][6]}>6 - " . lang('item', 'shield') . "</option>\r\n    <option value=\"7\" {$subclass[4][7]}>7 - " . lang('item', 'libram') . "</option>\r\n    <option value=\"8\" {$subclass[4][8]}>8 - " . lang('item', 'idol') . "</option>\r\n    <option value=\"9\" {$subclass[4][9]}>9 - " . lang('item', 'totem') . "</option>\r\n  </optgroup>\r\n  <optgroup label=\"Class 6: " . lang('item', 'projectile') . "\">\r\n    <option value=\"2\" {$subclass[6][2]}>2 - " . lang('item', 'arrows') . "</option>\r\n    <option value=\"3\" {$subclass[6][3]}>3 - " . lang('item', 'bullets') . "</option>\r\n  </optgroup>\r\n  <optgroup label=\"Class 7: " . lang('item', 'trade_goods') . "\">\r\n    <option value=\"0\" {$subclass[7][0]}>0 - " . lang('item', 'trade_goods') . "</option>\r\n    <option value=\"1\" {$subclass[7][1]}>1 - " . lang('item', 'parts') . "</option>\r\n    <option value=\"2\" {$subclass[7][2]}>2 - " . lang('item', 'explosives') . "</option>\r\n    <option value=\"3\" {$subclass[7][3]}>3 - " . lang('item', 'devices') . "</option>\r\n  </optgroup>\r\n  <optgroup label=\"Class 9: " . lang('item', 'recipe') . "\">\r\n    <option value=\"0\" {$subclass[9][0]}>0 - " . lang('item', 'book') . "</option>\r\n    <option value=\"1\" {$subclass[9][1]}>1 - " . lang('item', 'LW_pattern') . "</option>\r\n    <option value=\"2\" {$subclass[9][2]}>2 - " . lang('item', 'tailoring_pattern') . "</option>\r\n    <option value=\"3\" {$subclass[9][3]}>3 - " . lang('item', 'ENG_Schematic') . "</option>\r\n    <option value=\"4\" {$subclass[9][4]}>4 - " . lang('item', 'BS_plans') . "</option>\r\n    <option value=\"5\" {$subclass[9][5]}>5 - " . lang('item', 'cooking_recipe') . "</option>\r\n    <option value=\"6\" {$subclass[9][6]}>6 - " . lang('item', 'alchemy_recipe') . "</option>\r\n    <option value=\"7\" {$subclass[9][7]}>7 - " . lang('item', 'FA_manual') . "</option>\r\n    <option value=\"8\" {$subclass[9][8]}>8 - " . lang('item', 'ench_formula') . "</option>\r\n    <option value=\"9\" {$subclass[9][9]}>9 - " . lang('item', 'fishing_manual') . "</option>\r\n    <option value=\"10\" {$subclass[9][10]}>10 - " . lang('item', 'JC_formula') . "</option>\r\n  </optgroup>\r\n  <optgroup label=\"Class 11: " . lang('item', 'quiver') . "\">\r\n    <option value=\"2\" {$subclass[11][2]}>2 - " . lang('item', 'quiver') . "</option>\r\n    <option value=\"3\" {$subclass[11][3]}>3 - " . lang('item', 'ammo_pouch') . "</option>\r\n  </optgroup>\r\n  <optgroup label=\"Class 13: " . lang('item', 'key') . "\">\r\n    <option value=\"0\" {$subclass[13][0]}>0 - " . lang('item', 'key') . "</option>\r\n    <option value=\"1\" {$subclass[13][1]}>1 - " . lang('item', 'lockpick') . "</option>\r\n  </optgroup>\r\n </select></td>\r\n</tr>\r\n<tr>";
        unset($subclass);
        $quality = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "");
        $quality[$item['Quality']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'quality'), lang('item_edit', 'quality_desc')) . "</td>\r\n   <td colspan=\"2\"><select name=\"Quality\">\r\n    <option value=\"0\" {$quality[0]}>0 - " . lang('item', 'poor') . "</option>\r\n    <option value=\"1\" {$quality[1]}>1 - " . lang('item', 'common') . "</option>\r\n    <option value=\"2\" {$quality[2]}>2 - " . lang('item', 'uncommon') . "</option>\r\n    <option value=\"3\" {$quality[3]}>3 - " . lang('item', 'rare') . "</option>\r\n    <option value=\"4\" {$quality[4]}>4 - " . lang('item', 'epic') . "</option>\r\n    <option value=\"5\" {$quality[5]}>5 - " . lang('item', 'legendary') . "</option>\r\n    <option value=\"6\" {$quality[6]}>6 - " . lang('item', 'artifact') . "</option>\r\n    <option value=\"7\" {$quality[7]}>7 - " . lang('item', 'heirloom') . "</option>\r\n     </select></td>";
        unset($quality);
        $inv_type = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => "", 11 => "", 12 => "", 13 => "", 14 => "", 15 => "", 16 => "", 17 => "", 18 => "", 19 => "", 20 => "", 21 => "", 22 => "", 23 => "", 24 => "", 25 => "", 26 => "");
        $inv_type[$item['InventoryType']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'inv_type'), lang('item_edit', 'inv_type_desc')) . "</td>\r\n    <td colspan=\"2\"><select name=\"InventoryType\">\r\n    <option value=\"0\" {$inv_type[0]}>0 - " . lang('item', 'other') . "</option>\r\n    <option value=\"1\" {$inv_type[1]}>1 - " . lang('item', 'head') . "</option>\r\n    <option value=\"2\" {$inv_type[2]}>2 - " . lang('item', 'neck') . "</option>\r\n    <option value=\"3\" {$inv_type[3]}>3 - " . lang('item', 'shoulder') . "</option>\r\n    <option value=\"4\" {$inv_type[4]}>4 - " . lang('item', 'shirt') . "</option>\r\n    <option value=\"5\" {$inv_type[5]}>5 - " . lang('item', 'chest') . "</option>\r\n    <option value=\"6\" {$inv_type[6]}>6 - " . lang('item', 'belt') . "</option>\r\n    <option value=\"7\" {$inv_type[7]}>7 - " . lang('item', 'legs') . "</option>\r\n    <option value=\"8\" {$inv_type[8]}>8 - " . lang('item', 'feet') . "</option>\r\n    <option value=\"9\" {$inv_type[9]}>9 - " . lang('item', 'belt') . "</option>\r\n    <option value=\"10\" {$inv_type[10]}>10 - " . lang('item', 'gloves') . "</option>\r\n    <option value=\"11\" {$inv_type[11]}>11 - " . lang('item', 'finger') . "</option>\r\n    <option value=\"12\" {$inv_type[12]}>12 - " . lang('item', 'trinket') . "</option>\r\n    <option value=\"13\" {$inv_type[13]}>13 - " . lang('item', 'one_hand') . "</option>\r\n    <option value=\"14\" {$inv_type[14]}>14 - " . lang('item', 'off_hand') . "</option>\r\n    <option value=\"15\" {$inv_type[15]}>15 - " . lang('item', 'bow') . "</option>\r\n    <option value=\"16\" {$inv_type[16]}>16 - " . lang('item', 'back') . "</option>\r\n    <option value=\"17\" {$inv_type[17]}>17 - " . lang('item', 'two_hand') . "</option>\r\n    <option value=\"18\" {$inv_type[18]}>18 - " . lang('item', 'bag') . "</option>\r\n    <option value=\"19\" {$inv_type[19]}>19 - " . lang('item', 'tabard') . "</option>\r\n    <option value=\"20\" {$inv_type[20]}>20 - " . lang('item', 'robe') . "</option>\r\n    <option value=\"21\" {$inv_type[21]}>21 - " . lang('item', 'main_hand') . "</option>\r\n    <option value=\"22\" {$inv_type[22]}>22 - " . lang('item', 'off_misc') . "</option>\r\n    <option value=\"23\" {$inv_type[23]}>23 - " . lang('item', 'tome') . "</option>\r\n    <option value=\"24\" {$inv_type[24]}>24 - " . lang('item', 'projectile') . "</option>\r\n    <option value=\"25\" {$inv_type[25]}>25 - " . lang('item', 'thrown') . "</option>\r\n    <option value=\"26\" {$inv_type[26]}>26 - " . lang('item', 'rifle') . "</option>\r\n     </select></td>\r\n\r\n     <td>" . makeinfocell(lang('item_edit', 'flags'), lang('item_edit', 'flags_desc')) . "</td>\r\n     <td><input type=\"text\" name=\"Flags\" size=\"10\" maxlength=\"30\" value=\"{$item['Flags']}\" /></td>\r\n     </tr>\r\n\r\n     <tr>\r\n     <td>" . makeinfocell(lang('item_edit', 'item_set'), lang('item_edit', 'item_set_desc')) . "</td>\r\n     <td><input type=\"text\" name=\"itemset\" size=\"10\" maxlength=\"30\" value=\"{$item['itemset']}\" /></td>";
        unset($inv_type);
        $bonding = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "");
        $bonding[$item['bonding']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'bonding'), lang('item_edit', 'bonding_desc')) . "</td>\r\n   <td colspan=\"3\"><select name=\"bonding\">\r\n    <option value=\"0\" {$bonding[0]}>0 - " . lang('item', 'no_bind') . "</option>\r\n    <option value=\"1\" {$bonding[1]}>1 - " . lang('item', 'bop') . "</option>\r\n    <option value=\"2\" {$bonding[2]}>2 - " . lang('item', 'boe') . "</option>\r\n    <option value=\"3\" {$bonding[3]}>3 - " . lang('item', 'bou') . "</option>\r\n    <option value=\"4\" {$bonding[4]}>4 - " . lang('item', 'quest_item') . "</option>\r\n    <option value=\"5\" {$bonding[5]}>5 - " . lang('item', 'quest_item') . "1</option>\r\n     </select></td>\r\n\r\n<td>" . makeinfocell(lang('item_edit', 'start_quest'), lang('item_edit', 'start_quest_desc')) . "</td>\r\n<td><input type=\"text\" name=\"startquest\" size=\"10\" maxlength=\"30\" value=\"{$item['quest_id']}\" /></td>\r\n\r\n</tr>\r\n</table>\r\n<br />" . lang('item_edit', 'short_rules_desc') . "<br /><br />\r\n</div>";
        unset($bonding);
        $split_buy = substr($item['BuyPrice'], 0, -4) . " " . substr($item['BuyPrice'], -4, 2) . " " . substr($item['BuyPrice'], -2) . "";
        $split_sell = substr($item['SellPrice'], 0, -4) . " " . substr($item['SellPrice'], -4, 2) . " " . substr($item['SellPrice'], -2) . "";
        $output .= "<div id=\"pane2\">\r\n  <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'vendor') . ":</td></tr>\r\n  <tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'buy_price'), lang('item_edit', 'buy_price_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"BuyPrice\" size=\"8\" maxlength=\"30\" value=\"{$split_buy}\" /></td>\r\n   <td>" . makeinfocell(lang('item_edit', 'sell_price'), lang('item_edit', 'sell_price_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"SellPrice\" size=\"8\" maxlength=\"30\" value=\"{$split_sell}\" /></td>\r\n   <td></td><td></td>\r\n   <td></td><td></td>\r\n  </tr>\r\n\r\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'container') . ":</td></tr>\r\n  <tr>\r\n\r\n    <td>" . makeinfocell(lang('item_edit', 'max_count'), lang('item_edit', 'max_count_desc')) . "</td>\r\n    <td><input type=\"text\" name=\"maxcount\" size=\"6\" maxlength=\"5\" value=\"{$item['maxcount']}\" /></td>\r\n\r\n    <td>" . makeinfocell(lang('item_edit', 'bag_family'), lang('item_edit', 'bag_family_desc')) . "</td>";
        $bagfamily = array(0 => "", 1 => "", 2 => "", 3 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => "", 12 => "");
        $bagfamily[$item['BagFamily']] = " selected=\"selected\" ";
        $output .= "<td><select name=\"BagFamily\">\r\n    <option value=\"0\" {$bagfamily[0]}>0 - " . lang('item', 'none') . "</option>\r\n    <option value=\"1\" {$bagfamily[1]}>1 - " . lang('item', 'arrows') . "</option>\r\n    <option value=\"2\" {$bagfamily[2]}>2 - " . lang('item', 'bullets') . "</option>\r\n    <option value=\"3\" {$bagfamily[3]}>3 - " . lang('item', 'soul_shards') . "</option>\r\n    <option value=\"6\" {$bagfamily[6]}>6 - " . lang('item', 'herbs') . "</option>\r\n    <option value=\"7\" {$bagfamily[7]}>7 - " . lang('item', 'enchanting') . "</option>\r\n    <option value=\"8\" {$bagfamily[8]}>8 - " . lang('item', 'engineering') . "</option>\r\n    <option value=\"9\" {$bagfamily[9]}>9 - " . lang('item', 'keys') . "</option>\r\n    <option value=\"10\" {$bagfamily[10]}>10 - " . lang('item', 'gems') . "</option>\r\n    <option value=\"12\" {$bagfamily[12]}>12 - " . lang('item', 'mining') . "</option>\r\n     </select></td>\r\n  <td>" . makeinfocell(lang('item_edit', 'bag_slots'), lang('item_edit', 'bag_slots_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"ContainerSlots\" size=\"10\" maxlength=\"3\" value=\"{$item['ContainerSlots']}\" /></td>\r\n\r\n    <td></td>\r\n    <td></td>\r\n  </tr>\r\n  <tr>\r\n\r\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'materials') . ":</td></tr>";
        unset($bagfamily);
        $Material = array(-1 => "", 0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "", 8 => "");
        $Material[$item['lock_Material']] = " selected=\"selected\" ";
        $output .= "<tr>\r\n  <td>" . makeinfocell(lang('item_edit', 'material'), lang('item_edit', 'material_desc')) . "</td>\r\n   <td colspan=\"2\"><select name=\"Material\">\r\n    <option value=\"-1\" {$Material[-1]}>-1 - " . lang('item_edit', 'consumables') . "</option>\r\n    <option value=\"0\" {$Material[0]}>0 - " . lang('item_edit', 'none') . "</option>\r\n    <option value=\"1\" {$Material[1]}>1 - " . lang('item_edit', 'metal') . "</option>\r\n    <option value=\"2\" {$Material[2]}>2 - " . lang('item_edit', 'wood') . "</option>\r\n    <option value=\"3\" {$Material[3]}>3 - " . lang('item_edit', 'liquid') . "</option>\r\n    <option value=\"4\" {$Material[4]}>4 - " . lang('item_edit', 'jewelry') . "</option>\r\n    <option value=\"5\" {$Material[5]}>5 - " . lang('item_edit', 'chain') . "</option>\r\n    <option value=\"6\" {$Material[6]}>6 - " . lang('item_edit', 'plate') . "</option>\r\n    <option value=\"7\" {$Material[7]}>7 - " . lang('item_edit', 'cloth') . "</option>\r\n    <option value=\"8\" {$Material[8]}>8 - " . lang('item_edit', 'leather') . "</option>\r\n     </select></td>";
        unset($Material);
        $PageMaterial = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "");
        $PageMaterial[$item['Page_Material']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'page_material'), lang('item_edit', 'page_material_desc')) . "</td>\r\n   <td colspan=\"2\"><select name=\"PageMaterial\">\r\n    <option value=\"0\" {$PageMaterial[0]}>0 - " . lang('item_edit', 'none') . "</option>\r\n    <option value=\"1\" {$PageMaterial[1]}>1 - " . lang('item_edit', 'parchment') . "</option>\r\n    <option value=\"2\" {$PageMaterial[2]}>2 - " . lang('item_edit', 'stone') . "</option>\r\n    <option value=\"3\" {$PageMaterial[3]}>3 - " . lang('item_edit', 'marble') . "</option>\r\n    <option value=\"4\" {$PageMaterial[4]}>4 - " . lang('item_edit', 'silver') . "</option>\r\n    <option value=\"5\" {$PageMaterial[5]}>5 - " . lang('item_edit', 'bronze') . "</option>\r\n     </select></td>";
        unset($PageMaterial);
        $output .= "<td>" . makeinfocell(lang('item_edit', 'max_durability'), lang('item_edit', 'max_durability_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"MaxDurability\" size=\"8\" maxlength=\"30\" value=\"{$item['MaxDurability']}\" /></td>\r\n</tr>\r\n\r\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'RandomProperty') . ":</td></tr>\r\n<tr>\r\n   <td colspan=\"2\">" . makeinfocell(lang('item_edit', 'RandomProperty'), lang('item_edit', 'RandomProperty_desc')) . "</td>\r\n   <td colspan=\"2\"><input type=\"text\" name=\"RandomProperty\" size=\"8\" maxlength=\"30\" value=\"{$item['RandomProp']}\" /></td>\r\n\r\n   <td colspan=\"2\">" . makeinfocell(lang('item_edit', 'RandomSuffix'), lang('item_edit', 'RandomSuffix_desc')) . "</td>\r\n   <td colspan=\"2\"><input type=\"text\" name=\"RandomSuffix\" size=\"8\" maxlength=\"10\" value=\"{$item['RandomSuffix']}\" /></td>\r\n</tr>\r\n\r\n\r\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'other') . ":</td></tr>\r\n  <tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'area'), lang('item_edit', 'area_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"area\" size=\"8\" maxlength=\"10\" value=\"{$item['zonenameid']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'map'), lang('item_edit', 'map_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"Map\" size=\"8\" maxlength=\"10\" value=\"{$item['Mapid']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'page_text'), lang('item_edit', 'page_text_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"PageText\" size=\"6\" maxlength=\"30\" value=\"{$item['Page_id']}\" /></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n  </tr>\r\n  <tr>\r\n\r\n    <tr>\r\n\r\n   <td colspan=\"2\">" . makeinfocell(lang('item_edit', 'req_skill_disenchant'), lang('item_edit', 'req_skill_disenchant_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"RequiredDisenchantSkill\" size=\"10\" maxlength=\"10\" value=\"{$item['ReqDisenchantSkill']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'lock_id'), lang('item_edit', 'lock_id_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"lock_id\" size=\"8\" maxlength=\"30\" value=\"{$item['lock_id']}\" /></td>\r\n   <td colspan=\"2\"></td>\r\n   <td></td>\r\n  </tr>";
        $LanguageID = array(0 => "", 1 => "", 2 => "", 3 => "", 6 => "", 7 => "", 8 => "", 9 => "", 10 => "", 11 => "", 12 => "", 13 => "", 14 => "", 33 => "");
        $LanguageID[$item['page_Language']] = " selected=\"selected\" ";
        $output .= "<tr>\r\n  <td>" . makeinfocell(lang('item_edit', 'lang_id'), lang('item_edit', 'lang_id_desc')) . "</td>\r\n   <td colspan=\"2\"><select name=\"LanguageID\">\r\n    <option value=\"0\" {$LanguageID[0]}>0 - " . lang('item_edit', 'other') . "</option>\r\n    <option value=\"1\" {$LanguageID[1]}>1 - Orcish</option>\r\n    <option value=\"2\" {$LanguageID[2]}>2 - Darnassian</option>\r\n    <option value=\"3\" {$LanguageID[3]}>3 - Taurahe</option>\r\n    <option value=\"6\" {$LanguageID[6]}>6 - Dwarvish</option>\r\n    <option value=\"7\" {$LanguageID[7]}>7 - Common</option>\r\n    <option value=\"8\" {$LanguageID[8]}>8 - Demonic</option>\r\n    <option value=\"9\" {$LanguageID[9]}>9 - Titan</option>\r\n    <option value=\"10\" {$LanguageID[10]}>10 - Thelassian</option>\r\n    <option value=\"11\" {$LanguageID[11]}>11 - Draconic</option>\r\n    <option value=\"12\" {$LanguageID[12]}>12 - Kalimag</option>\r\n    <option value=\"13\" {$LanguageID[13]}>13 - Gnomish</option>\r\n    <option value=\"14\" {$LanguageID[14]}>14 - Troll</option>\r\n    <option value=\"33\" {$LanguageID[33]}>33 - Gutterspeak</option>\r\n     </select></td>";
        unset($LanguageID);
        $sheath = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 7 => "");
        $sheath[$item['sheathid']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'sheath'), lang('item_edit', 'sheath_desc')) . "</td>\r\n   <td colspan=\"2\"><select name=\"sheath\">\r\n    <option value=\"0\" {$sheath[0]}>0 - " . lang('item_edit', 'other') . "</option>\r\n    <option value=\"1\" {$sheath[1]}>1 - " . lang('item', 'sword_2h') . "</option>\r\n    <option value=\"2\" {$sheath[2]}>2 - " . lang('item', 'staff') . "</option>\r\n    <option value=\"3\" {$sheath[3]}>3 - " . lang('item', 'sword_1h') . "</option>\r\n    <option value=\"4\" {$sheath[4]}>4 - " . lang('item', 'shield') . "</option>\r\n    <option value=\"5\" {$sheath[5]}>5 - " . lang('item', 'rod') . "</option>\r\n    <option value=\"7\" {$sheath[7]}>7 - " . lang('item', 'off_hand') . "</option>\r\n     </select></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'totem_category'), lang('item_edit', 'totem_category_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"TotemCategory\" size=\"8\" maxlength=\"10\" value=\"{$item['TotemCategory']}\" /></td>\r\n  </tr>\r\n\r\n   </table><br /><br />\r\n    </div>";
        unset($sheath);
        $output .= "<div id=\"pane3\">\r\n   <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'stats') . ":</td></tr>\r\n  <tr>\r\n\r\n  <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 1", lang('item_edit', 'stat_type_desc')) . "</td>\r\n   <td><select name=\"stat_type1\">";
        output_status_options($item['stat_type1']);
        $output .= "</select></td>\r\n\r\n  <td><input type=\"text\" name=\"stat_value1\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value1']}\" /></td>\r\n  <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 2", lang('item_edit', 'stat_type_desc')) . "</td>\r\n   <td><select name=\"stat_type2\">";
        output_status_options($item['stat_type2']);
        $output .= "</select></td>\r\n\r\n   <td><input type=\"text\" name=\"stat_value2\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value2']}\" /></td>\r\n  </tr>\r\n <tr>\r\n  <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 3", lang('item_edit', 'stat_type_desc')) . "</td>\r\n  <td><select name=\"stat_type3\">";
        output_status_options($item['stat_type3']);
        $output .= "</select></td>\r\n\r\n  <td><input type=\"text\" name=\"stat_value3\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value3']}\" /></td>\r\n  <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 4", lang('item_edit', 'stat_type_desc')) . "</td>\r\n   <td><select name=\"stat_type4\">";
        output_status_options($item['stat_type4']);
        $output .= "</select></td>\r\n\r\n   <td><input type=\"text\" name=\"stat_value4\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value4']}\" /></td>\r\n  </tr>\r\n<tr>\r\n <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 5", lang('item_edit', 'stat_type_desc')) . "</td>\r\n <td><select name=\"stat_type5\">";
        output_status_options($item['stat_type5']);
        $output .= "</select></td>\r\n\r\n   <td><input type=\"text\" name=\"stat_value5\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value5']}\" /></td>\r\n  <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 6", lang('item_edit', 'stat_type_desc')) . "</td>\r\n   <td><select name=\"stat_type6\">";
        output_status_options($item['stat_type1']);
        $output .= "</select></td>\r\n\r\n   <td><input type=\"text\" name=\"stat_value6\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value6']}\" /></td>\r\n  </tr>\r\n<tr>\r\n <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 7", lang('item_edit', 'stat_type_desc')) . "</td>\r\n   <td><select name=\"stat_type7\">";
        output_status_options($item['stat_type7']);
        $output .= "</select></td>\r\n  <td><input type=\"text\" name=\"stat_value7\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value7']}\" /></td>\r\n  <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 8", lang('item_edit', 'stat_type_desc')) . "</td>\r\n   <td><select name=\"stat_type8\">";
        output_status_options($item['stat_type8']);
        $output .= "</select></td>\r\n\r\n   <td><input type=\"text\" name=\"stat_value8\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value8']}\" /></td>\r\n  </tr>\r\n<tr>\r\n  <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 9", lang('item_edit', 'stat_type_desc')) . "</td>\r\n  <td><select name=\"stat_type9\">";
        output_status_options($item['stat_type9']);
        $output .= "</select></td>\r\n  <td><input type=\"text\" name=\"stat_value9\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value9']}\" /></td>\r\n  <td>" . makeinfocell(lang('item_edit', 'stat_type') . " 10", lang('item_edit', 'stat_type_desc')) . "</td>\r\n   <td><select name=\"stat_type10\">";
        output_status_options($item['stat_type10']);
        $output .= "</select></td>\r\n\r\n   <td><input type=\"text\" name=\"stat_value10\" size=\"10\" maxlength=\"6\" value=\"{$item['stat_value10']}\" /></td>\r\n  </tr>\r\n\r\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'resis_armor') . ":</td></tr>\r\n   <tr>\r\n   <td colspan=\"2\">" . makeinfocell(lang('item', 'armor'), lang('item_edit', 'armor_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"armor\" size=\"10\" maxlength=\"30\" value=\"{$item['armor']}\" /></td>\r\n\r\n   <td colspan=\"2\">" . makeinfocell(lang('item', 'block'), lang('item_edit', 'block_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"block\" size=\"10\" maxlength=\"30\" value=\"{$item['block']}\" /></td>\r\n   </tr>\r\n   <tr>\r\n   <td colspan=\"2\">" . makeinfocell(lang('item', 'res_holy'), lang('item_edit', 'res_holy_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"holy_res\" size=\"10\" maxlength=\"30\" value=\"{$item['holy_res']}\" /></td>\r\n\r\n   <td colspan=\"2\">" . makeinfocell(lang('item', 'res_fire'), lang('item_edit', 'res_fire_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"fire_res\" size=\"10\" maxlength=\"30\" value=\"{$item['fire_res']}\" /></td>\r\n   </tr>\r\n   <tr>\r\n   <td colspan=\"2\">" . makeinfocell(lang('item', 'res_nature'), lang('item_edit', 'res_nature_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"nature_res\" size=\"10\" maxlength=\"30\" value=\"{$item['nature_res']}\" /></td>\r\n\r\n   <td colspan=\"2\">" . makeinfocell(lang('item', 'res_frost'), lang('item_edit', 'res_frost_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"frost_res\" size=\"10\" maxlength=\"30\" value=\"{$item['frost_res']}\" /></td>\r\n   </tr>\r\n   <tr>\r\n   <td colspan=\"2\">" . makeinfocell(lang('item', 'res_shadow'), lang('item_edit', 'res_shadow_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"shadow_res\" size=\"10\" maxlength=\"30\" value=\"{$item['shadow_res']}\" /></td>\r\n\r\n   <td colspan=\"2\">" . makeinfocell(lang('item', 'res_arcane'), lang('item_edit', 'res_arcane_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"arcane_res\" size=\"10\" maxlength=\"30\" value=\"{$item['arcane_res']}\" /></td>\r\n   </tr>\r\n\r\n    </table><br /><br />\r\n    </div>";
        $output .= "<div id=\"pane4\">\r\n     <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n  <tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'weapon_properties') . ":</td></tr>\r\n<tr>\r\n <td>" . makeinfocell(lang('item_edit', 'delay'), lang('item_edit', 'delay_desc')) . "</td>\r\n <td colspan=\"2\"><input type=\"text\" name=\"delay\" size=\"10\" maxlength=\"11\" value=\"{$item['delay']}\" /></td>\r\n\r\n <td>" . makeinfocell(lang('item_edit', 'ranged_mod'), lang('item_edit', 'ranged_mod_desc')) . "</td>\r\n <td colspan=\"2\"><input type=\"text\" name=\"RangedModRange\" size=\"10\" maxlength=\"40\" value=\"{$item['Range']}\" /></td>\r\n</tr>\r\n<tr>\r\n <td>" . makeinfocell(lang('item_edit', 'armor_dmg_mod'), lang('item_edit', 'armor_dmg_mod_desc')) . "</td>\r\n <td colspan=\"2\"><input type=\"text\" name=\"ArmorDamageModifier\" size=\"10\" maxlength=\"40\" value=\"{$item['ArmorDamageModifier']}\" /></td>";
        $ammo_type = array(0 => "", 2 => "", 3 => "");
        $ammo_type[$item['ammo_type']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'ammo_type'), lang('item_edit', 'ammo_type_desc')) . "</td>\r\n   <td colspan=\"2\"><select name=\"ammo_type\">\r\n    <option value=\"0\" {$ammo_type[0]}>0 - " . lang('item', 'none') . "</option>\r\n    <option value=\"2\" {$ammo_type[2]}>2 - " . lang('item', 'arrows') . "</option>\r\n    <option value=\"3\" {$ammo_type[3]}>3 - " . lang('item', 'bullets') . "</option>\r\n     </select></td>\r\n</tr>\r\n<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'weapon_damage') . ":</td></tr>\r\n<tr>";
        unset($ammo_type);
        $output .= "<td>" . makeinfocell(lang('item_edit', 'damage_type') . " 1", lang('item_edit', 'damage_type_desc')) . "</td>\r\n   <td colspan=\"2\"><select name=\"dmg_type1\">";
        output_dmgtype_options($item['dmg_type1']);
        $output .= "</select></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'dmg_min_max'), lang('item_edit', 'dmg_min_max_desc')) . "</td>\r\n   <td colspan=\"4\"><input type=\"text\" name=\"dmg_min1\" size=\"8\" maxlength=\"45\" value=\"{$item['dmg_min1']}\" /> - <input type=\"text\" name=\"dmg_max1\" size=\"8\" maxlength=\"45\" value=\"{$item['dmg_max1']}\" /></td>\r\n\r\n</tr>\r\n<tr>\r\n  <td>" . makeinfocell(lang('item_edit', 'damage_type') . " 2", lang('item_edit', 'damage_type_desc')) . "</td>\r\n   <td colspan=\"2\"><select name=\"dmg_type2\">";
        output_dmgtype_options($item['dmg_type2']);
        $output .= "</select></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'dmg_min_max'), lang('item_edit', 'dmg_min_max_desc')) . "</td>\r\n   <td colspan=\"4\"><input type=\"text\" name=\"dmg_min2\" size=\"8\" maxlength=\"45\" value=\"{$item['dmg_min2']}\" /> - <input type=\"text\" name=\"dmg_max2\" size=\"8\" maxlength=\"45\" value=\"{$item['dmg_max2']}\" /></td>\r\n\r\n</tr>\r\n</table><br /><br />\r\n    </div>";
        $output .= "<div id=\"pane5\">\r\n     <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n<tr>\r\n   <td colspan=\"2\">" . lang('item_edit', 'item_spell') . " 1</td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_id'), lang('item_edit', 'spell_id_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellid_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_1']}\" /></td>";
        $spelltrigger_1 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_1[$item['spelltrigger_1']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'spell_trigger'), lang('item_edit', 'spell_trigger_desc')) . "</td>\r\n   <td><select name=\"spelltrigger_1\">\r\n    <option value=\"0\" {$spelltrigger_1[0]}>0: " . lang('item', 'spell_use') . "</option>\r\n    <option value=\"1\" {$spelltrigger_1[1]}>1: " . lang('item', 'spell_equip') . "</option>\r\n    <option value=\"2\" {$spelltrigger_1[2]}>2: " . lang('item', 'spell_coh') . "</option>\r\n    <option value=\"4\" {$spelltrigger_1[4]}>4: " . lang('item', 'soul_stone') . "</option>\r\n    </select></td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_charges'), lang('item_edit', 'spell_charges_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcharges_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_1']}\" /></td>\r\n</tr>\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_cooldown'), lang('item_edit', 'spell_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcooldown_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_1']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category'), lang('item_edit', 'spell_category_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategory_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_1']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category_cooldown'), lang('item_edit', 'spell_category_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategorycooldown_1\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_1']}\" /></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n<tr><td colspan=\"6\" class=\"hidden\"></td></tr>\r\n<tr>\r\n   <td colspan=\"2\">" . lang('item_edit', 'item_spell') . " 2</td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_id'), lang('item_edit', 'spell_id_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellid_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_2']}\" /></td>";
        unset($spelltrigger_1);
        $spelltrigger_2 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_2[$item['spelltrigger_2']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'spell_trigger'), lang('item_edit', 'spell_trigger_desc')) . "</td>\r\n   <td><select name=\"spelltrigger_2\">\r\n    <option value=\"0\" {$spelltrigger_2[0]}>0: " . lang('item', 'spell_use') . "</option>\r\n    <option value=\"1\" {$spelltrigger_2[1]}>1: " . lang('item', 'spell_equip') . "</option>\r\n    <option value=\"2\" {$spelltrigger_2[2]}>2: " . lang('item', 'spell_coh') . "</option>\r\n    <option value=\"4\" {$spelltrigger_2[4]}>4: " . lang('item', 'soul_stone') . "</option>\r\n    </select></td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_charges'), lang('item_edit', 'spell_charges_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcharges_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_2']}\" /></td>\r\n</tr>\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_cooldown'), lang('item_edit', 'spell_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcooldown_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_2']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category'), lang('item_edit', 'spell_category_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategory_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_2']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category_cooldown'), lang('item_edit', 'spell_category_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategorycooldown_2\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_2']}\" /></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n<tr><td colspan=\"6\" class=\"hidden\"></td></tr>\r\n<tr>\r\n   <td colspan=\"2\">" . lang('item_edit', 'item_spell') . " 3</td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_id'), lang('item_edit', 'spell_id_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellid_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_3']}\" /></td>";
        unset($spelltrigger_2);
        $spelltrigger_3 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_3[$item['spelltrigger_3']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'spell_trigger'), lang('item_edit', 'spell_trigger_desc')) . "</td>\r\n   <td><select name=\"spelltrigger_3\">\r\n    <option value=\"0\" {$spelltrigger_3[0]}>0: " . lang('item', 'spell_use') . "</option>\r\n    <option value=\"1\" {$spelltrigger_3[1]}>1: " . lang('item', 'spell_equip') . "</option>\r\n    <option value=\"2\" {$spelltrigger_3[2]}>2: " . lang('item', 'spell_coh') . "</option>\r\n    <option value=\"4\" {$spelltrigger_3[4]}>4: " . lang('item', 'soul_stone') . "</option>\r\n    </select></td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_charges'), lang('item_edit', 'spell_charges_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcharges_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_3']}\" /></td>\r\n</tr>\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_cooldown'), lang('item_edit', 'spell_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcooldown_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_3']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category'), lang('item_edit', 'spell_category_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategory_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_3']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category_cooldown'), lang('item_edit', 'spell_category_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategorycooldown_3\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_3']}\" /></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n<tr><td colspan=\"6\" class=\"hidden\"></td></tr>\r\n<tr>\r\n   <td colspan=\"2\">" . lang('item_edit', 'item_spell') . " 4</td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_id'), lang('item_edit', 'spell_id_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellid_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_4']}\" /></td>";
        unset($spelltrigger_3);
        $spelltrigger_4 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_4[$item['spelltrigger_4']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'spell_trigger'), lang('item_edit', 'spell_trigger_desc')) . "</td>\r\n   <td><select name=\"spelltrigger_4\">\r\n    <option value=\"0\" {$spelltrigger_4[0]}>0: " . lang('item', 'spell_use') . "</option>\r\n    <option value=\"1\" {$spelltrigger_4[1]}>1: " . lang('item', 'spell_equip') . "</option>\r\n    <option value=\"2\" {$spelltrigger_4[2]}>2: " . lang('item', 'spell_coh') . "</option>\r\n    <option value=\"4\" {$spelltrigger_4[4]}>4: " . lang('item', 'soul_stone') . "</option>\r\n    </select></td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_charges'), lang('item_edit', 'spell_charges_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcharges_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_4']}\" /></td>\r\n</tr>\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_cooldown'), lang('item_edit', 'spell_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcooldown_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_4']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category'), lang('item_edit', 'spell_category_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategory_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_4']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category_cooldown'), lang('item_edit', 'spell_category_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategorycooldown_4\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_4']}\" /></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n<tr><td colspan=\"6\" class=\"hidden\"></td></tr>\r\n<tr>\r\n   <td colspan=\"2\">" . lang('item_edit', 'item_spell') . " 5</td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_id'), lang('item_edit', 'spell_id_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellid_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellid_5']}\" /></td>";
        unset($spelltrigger_4);
        $spelltrigger_5 = array(0 => "", 1 => "", 2 => "", 4 => "");
        $spelltrigger_5[$item['spelltrigger_5']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'spell_trigger'), lang('item_edit', 'spell_trigger_desc')) . "</td>\r\n   <td><select name=\"spelltrigger_5\">\r\n    <option value=\"0\" {$spelltrigger_5[0]}>0: " . lang('item', 'spell_use') . "</option>\r\n    <option value=\"1\" {$spelltrigger_5[1]}>1: " . lang('item', 'spell_equip') . "</option>\r\n    <option value=\"2\" {$spelltrigger_5[2]}>2: " . lang('item', 'spell_coh') . "</option>\r\n    <option value=\"4\" {$spelltrigger_5[4]}>4: " . lang('item', 'soul_stone') . "</option>\r\n    </select></td>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_charges'), lang('item_edit', 'spell_charges_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcharges_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcharges_5']}\" /></td>\r\n</tr>\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_cooldown'), lang('item_edit', 'spell_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcooldown_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcooldown_5']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category'), lang('item_edit', 'spell_category_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategory_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategory_5']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'spell_category_cooldown'), lang('item_edit', 'spell_category_cooldown_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"spellcategorycooldown_5\" size=\"6\" maxlength=\"30\" value=\"{$item['spellcategorycooldown_5']}\" /></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n\r\n</table>\r\n    </div>";
        unset($spelltrigger_5);
        $output .= "<div id=\"pane6\">\r\n    <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n   <tr>";
        $AllowableClass = array(-1 => "", 1 => "", 2 => "", 4 => "", 8 => "", 16 => "", 32 => "", 64 => "", 128 => "", 256 => "", 512 => "", 1024 => "");
        if ($item['AllowableClass'] == -1) {
            $AllowableClass[-1] = " selected=\"selected\" ";
        } else {
            if ($item['AllowableClass'] & 1) {
                $AllowableClass[1] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 2) {
                $AllowableClass[2] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 4) {
                $AllowableClass[4] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 8) {
                $AllowableClass[8] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 16) {
                $AllowableClass[16] = " selected=\"selected\" ";
            }
            //if ($item['AllowableClass'] & 32) $AllowableClass[32] = " selected=\"selected\" ";
            if ($item['AllowableClass'] & 64) {
                $AllowableClass[64] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 128) {
                $AllowableClass[128] = " selected=\"selected\" ";
            }
            if ($item['AllowableClass'] & 256) {
                $AllowableClass[256] = " selected=\"selected\" ";
            }
            //if ($item['AllowableClass'] & 512) $AllowableClass[512] = " selected=\"selected\" ";
            if ($item['AllowableClass'] & 1024) {
                $AllowableClass[1024] = " selected=\"selected\" ";
            }
        }
        $output .= "<td>" . makeinfocell(lang('item_edit', 'allow_class'), lang('item_edit', 'allow_class_desc')) . "</td>\r\n   <td><select multiple=\"multiple\" name=\"AllowableClass[]\" size=\"5\">\r\n    <option value=\"-1\" {$AllowableClass[-1]}>-1 - " . lang('item_edit', 'all') . "</option>\r\n    <option value=\"1\" {$AllowableClass[1]}>1 - " . lang('id_tab', 'warrior') . "</option>\r\n    <option value=\"2\" {$AllowableClass[2]}>2 - " . lang('id_tab', 'paladin') . "</option>\r\n    <option value=\"4\" {$AllowableClass[4]}>4 - " . lang('id_tab', 'hunter') . "</option>\r\n    <option value=\"8\" {$AllowableClass[8]}>8 - " . lang('id_tab', 'rogue') . "</option>\r\n    <option value=\"16\" {$AllowableClass[16]}>16 - " . lang('id_tab', 'priest') . "</option>\r\n    <!-- option value=\"32\" {$AllowableClass[32]}>32 - FUTURE_1</option -->\r\n    <option value=\"64\" {$AllowableClass[64]}>64 - " . lang('id_tab', 'shaman') . "</option>\r\n    <option value=\"128\" {$AllowableClass[128]}>128 - " . lang('id_tab', 'mage') . "</option>\r\n    <option value=\"256\" {$AllowableClass[256]}>256 - " . lang('id_tab', 'warlock') . "</option>\r\n    <!-- option value=\"512\" {$AllowableClass[512]}>512 - FUTURE_2</option -->\r\n    <option value=\"1024\" {$AllowableClass[1024]}>1024 - " . lang('id_tab', 'druid') . "</option>\r\n     </select></td>";
        unset($AllowableClass);
        $AllowableRace = array(-1 => "", 1 => "", 2 => "", 4 => "", 8 => "", 16 => "", 32 => "", 64 => "", 128 => "", 256 => "", 512 => "");
        if ($item['AllowableRace'] == -1) {
            $AllowableRace[-1] = " selected=\"selected\" ";
        } else {
            if ($item['AllowableRace'] & 1) {
                $AllowableRace[1] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 2) {
                $AllowableRace[2] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 4) {
                $AllowableRace[4] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 8) {
                $AllowableRace[8] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 16) {
                $AllowableRace[16] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 32) {
                $AllowableRace[32] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 64) {
                $AllowableRace[64] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 128) {
                $AllowableRace[128] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 256) {
                $AllowableRace[256] = " selected=\"selected\" ";
            }
            if ($item['AllowableRace'] & 512) {
                $AllowableRace[512] = " selected=\"selected\" ";
            }
        }
        $output .= "<td>" . makeinfocell(lang('item_edit', 'allow_race'), lang('item_edit', 'allow_race_desc')) . "</td>\r\n   <td><select multiple=\"multiple\" name=\"AllowableRace[]\" size=\"5\">\r\n    <option value=\"-1\" {$AllowableRace[-1]}>-1 - " . lang('item_edit', 'all') . "</option>\r\n    <option value=\"1\" {$AllowableRace[1]}>1 - " . lang('id_tab', 'human') . "</option>\r\n    <option value=\"2\" {$AllowableRace[2]}>2 - " . lang('id_tab', 'orc') . "</option>\r\n    <option value=\"4\" {$AllowableRace[4]}>4 - " . lang('id_tab', 'dwarf') . "</option>\r\n    <option value=\"8\" {$AllowableRace[8]}>8 - " . lang('id_tab', 'nightelf') . "</option>\r\n    <option value=\"16\" {$AllowableRace[16]}>16 - " . lang('id_tab', 'undead') . "</option>\r\n    <option value=\"32\" {$AllowableRace[32]}>32 - " . lang('id_tab', 'tauren') . "</option>\r\n    <option value=\"64\" {$AllowableRace[64]}>64 - " . lang('id_tab', 'gnome') . "</option>\r\n    <option value=\"128\" {$AllowableRace[128]}>128 - " . lang('id_tab', 'troll') . "</option>\r\n    <option value=\"256\" {$AllowableRace[256]}>256 - " . lang('id_tab', 'draenei') . "</option>\r\n    <option value=\"512\" {$AllowableRace[512]}>512 - " . lang('id_tab', 'bloodelf') . "</option>\r\n     </select></td>\r\n</tr>\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'req_skill'), lang('item_edit', 'req_skill_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"RequiredSkill\" size=\"15\" maxlength=\"30\" value=\"{$item['RequiredSkill']}\" /></td>\r\n\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'req_skill_rank'), lang('item_edit', 'req_skill_rank_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"RequiredSkillRank\" size=\"15\" maxlength=\"30\" value=\"{$item['RequiredSkillRank']}\" /></td>\r\n</tr>\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'req_spell'), lang('item_edit', 'req_spell_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"requiredspell\" size=\"15\" maxlength=\"30\" value=\"{$item['requiredspell']}\" /></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'req_rep_faction'), lang('item_edit', 'req_rep_faction_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"RequiredReputationFaction\" size=\"15\" maxlength=\"30\" value=\"{$item['RequiredFaction']}\" /></td>";
        unset($AllowableRace);
        $RequiredReputationRank = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "", 6 => "", 7 => "");
        $RequiredReputationRank[$item['RequiredFactionStanding']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'req_rep_rank'), lang('item_edit', 'req_rep_rank_desc')) . "</td>\r\n      <td><select name=\"RequiredReputationRank\">\r\n    <option value=\"0\" {$RequiredReputationRank[0]}>0 - " . lang('item_edit', 'hated') . "</option>\r\n    <option value=\"1\" {$RequiredReputationRank[1]}>1 - " . lang('item_edit', 'hostile') . "</option>\r\n    <option value=\"2\" {$RequiredReputationRank[2]}>2 - " . lang('item_edit', 'unfriendly') . "</option>\r\n    <option value=\"3\" {$RequiredReputationRank[3]}>3 - " . lang('item_edit', 'neutral') . "</option>\r\n    <option value=\"4\" {$RequiredReputationRank[4]}>4 - " . lang('item_edit', 'friendly') . "</option>\r\n    <option value=\"5\" {$RequiredReputationRank[5]}>5 - " . lang('item_edit', 'honored') . "</option>\r\n    <option value=\"6\" {$RequiredReputationRank[6]}>6 - " . lang('item_edit', 'reverted') . "</option>\r\n    <option value=\"7\" {$RequiredReputationRank[7]}>7 - " . lang('item_edit', 'exalted') . "</option>\r\n     </select></td>\r\n</tr>\r\n\r\n   </table><br /><br />\r\n    </div>";
        unset($RequiredReputationRank);
        $output .= "<div id=\"pane7\">\r\n    <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n<tr>";
        $socketColor_1 = array(0 => "", 1 => "", 2 => "", 4 => "", 8 => "");
        $socketColor_1[$item['socket_Color_1']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'socket_color') . " 1", lang('item_edit', 'socket_color_desc')) . "</td>\r\n      <td><select name=\"socketColor_1\">\r\n        <option value=\"0\" {$socketColor_1[0]}>0: " . lang('item', 'none') . "</option>\r\n        <option value=\"1\" {$socketColor_1[1]}>1: " . lang('item', 'socket_meta') . "</option>\r\n        <option value=\"2\" {$socketColor_1[2]}>2: " . lang('item', 'socket_red') . "</option>\r\n        <option value=\"4\" {$socketColor_1[4]}>4: " . lang('item', 'socket_yellow') . "</option>\r\n        <option value=\"8\" {$socketColor_1[8]}>8: " . lang('item', 'socket_blue') . "</option>\r\n      </select></td>\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n<tr>";
        unset($socketColor_1);
        $socketColor_2 = array(0 => "", 1 => "", 2 => "", 4 => "", 8 => "");
        $socketColor_2[$item['socket_Color_2']] = " selected=\"selected\" ";
        $output .= "<td>" . makeinfocell(lang('item_edit', 'socket_color') . " 2", lang('item_edit', 'socket_color_desc')) . "</td>\r\n      <td><select name=\"socketColor_2\">\r\n        <option value=\"0\" {$socketColor_2[0]}>0: " . lang('item', 'none') . "</option>\r\n        <option value=\"1\" {$socketColor_2[1]}>1: " . lang('item', 'socket_meta') . "</option>\r\n        <option value=\"2\" {$socketColor_2[2]}>2: " . lang('item', 'socket_red') . "</option>\r\n        <option value=\"4\" {$socketColor_2[4]}>4: " . lang('item', 'socket_yellow') . "</option>\r\n        <option value=\"8\" {$socketColor_2[8]}>8: " . lang('item', 'socket_blue') . "</option>\r\n      </select></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n<tr>";
        unset($socketColor_2);
        $socketColor_3 = array(0 => "", 1 => "", 2 => "", 4 => "", 8 => "");
        $socketColor_3[$item['socket_Color_3']] = " selected=\"selected\" ";
        // this_is_junk: socket bonus comes from SpellItemEnchantment.dbc... to display it correctly we need that dbc in the CoreManager DB.
        //               gem properties does it too.
        $output .= "<td>" . makeinfocell(lang('item_edit', 'socket_color') . " 3", lang('item_edit', 'socket_color_desc')) . "</td>\r\n      <td><select name=\"socketColor_3\">\r\n        <option value=\"0\" {$socketColor_3[0]}>0: " . lang('item', 'none') . "</option>\r\n        <option value=\"1\" {$socketColor_3[1]}>1: " . lang('item', 'socket_meta') . "</option>\r\n        <option value=\"2\" {$socketColor_3[2]}>2: " . lang('item', 'socket_red') . "</option>\r\n        <option value=\"4\" {$socketColor_3[4]}>4: " . lang('item', 'socket_yellow') . "</option>\r\n        <option value=\"8\" {$socketColor_3[8]}>8: " . lang('item', 'socket_blue') . "</option>\r\n      </select></td>\r\n\r\n   <td></td>\r\n   <td></td>\r\n</tr>\r\n\r\n<tr>\r\n   <td>" . makeinfocell(lang('item_edit', 'socket_bonus'), lang('item_edit', 'socket_bonus_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"socketBonus\" size=\"15\" maxlength=\"10\" value=\"{$item['socket_Bonus']}\" /></td>\r\n\r\n   <td>" . makeinfocell(lang('item_edit', 'gem_properties'), lang('item_edit', 'gem_properties_desc')) . "</td>\r\n   <td><input type=\"text\" name=\"GemProperties\" size=\"15\" maxlength=\"10\" value=\"{$item['GemProperties']}\" /></td>\r\n</tr>\r\n\r\n   </table><br /><br />\r\n    </div>";
        $output .= "<div id=\"pane8\">\r\n    <br /><br /><table class=\"lined\" style=\"width: 720px;\">";
        // DROPPED BY
        // this_is_junk: ArcEmu doesn't have a field to match groupid
        $result2 = $sqlw->query("SELECT entryid,normal10percentchance,normal25percentchance,heroic10percentchance,heroic25percentchance FROM loot_creatures WHERE itemid = {$item['entry']} ORDER BY normal10percentchance DESC");
        if ($sqlw->num_rows($result2)) {
            $output .= "<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'dropped_by') . ": " . lang('item_edit', 'top_x') . "</td></tr>";
            $output .= "<tr>\r\n    <th width=\"1%\">ID</th>\r\n    <th width=\"35%\">" . lang('item_edit', 'mob_name') . "</th>\r\n    <th width=\"10%\">" . lang('item_edit', 'mob_minlevel') . "</th>\r\n    <th width=\"10%\">" . lang('item_edit', 'mob_maxlevel') . "</th>\r\n    <th width=\"6%\">" . lang('item_edit', 'norm10_drop_chance') . "</th>\r\n    <th width=\"6%\">" . lang('item_edit', 'norm25_drop_chance') . "</th>\r\n    <th width=\"6%\">" . lang('item_edit', 'hero10_drop_chance') . "</th>\r\n    <th width=\"7%\">" . lang('item_edit', 'hero25_drop_chance') . "</th>\r\n  </tr>";
            while ($info = $sqlw->fetch_assoc($result2)) {
                //$result3 = $sql->query("SELECT creature_names.entry,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`creature_names`.`name`) as name FROM creature_names LEFT JOIN creature_names_localized ON creature_names.entry = creature_names_localized.id LEFT JOIN loot_creatures ON creature_names.entry = loot_creatures.entryid WHERE itemid = {$info[0]} LIMIT 1");
                $result3 = $sqlw->query("SELECT creature_names.entry,`name`,creature_proto.minlevel,creature_proto.maxlevel FROM creature_names LEFT JOIN creature_proto ON creature_names.entry = creature_proto.entry WHERE creature_names.entry = " . $info['entryid'] . " LIMIT 1");
                while ($mob = $sqlw->fetch_assoc($result3)) {
                    $output .= "<tr><td>";
                    if ($user_lvl >= $action_permission['delete']) {
                        $output .= "<a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry=" . $mob['entry'] . "&amp;error=4\" target=\"_blank\">" . $mob['entry'] . "</a>";
                    } else {
                        $output .= $mob['entry'];
                    }
                    $output .= "</td>\r\n          <td><a class=\"tooltip\" href=\"{$creature_datasite}" . $mob['entry'] . " target=\"_blank\">" . $mob['name'] . "</a></td>\r\n          <td>" . $mob['minlevel'] . "</td>\r\n          <td>" . $mob['maxlevel'] . "</td>\r\n          <td>" . $info['normal10percentchance'] . "%</td>\r\n          <td>" . $info['normal25percentchance'] . "%</td>\r\n          <td>" . $info['heroic10percentchance'] . "%</td>\r\n          <td>" . $info['heroic25percentchance'] . "%</td>";
                }
            }
        }
        // SOLD BY
        //$result2 = $sql->query("SELECT creature_names.entry,IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`creature_names`.`name`) as name FROM creature_names LEFT JOIN creature_names_localized ON creature_names.entry = creature_names_localized.id WHERE creature_names.entry IN (SELECT entry FROM vendors WHERE item = {$item['entry']}) LIMIT 5");
        $result2 = $sqlw->query("SELECT creature_names.entry,`creature_names`.`name` FROM creature_names LEFT JOIN creature_names_localized ON creature_names.entry = creature_names_localized.id WHERE creature_names.entry IN (SELECT entry FROM vendors WHERE item = {$item['entry']})");
        if ($sqlw->num_rows($result2)) {
            $output .= "<tr class=\"large_bold\"><td colspan=\"9\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'sold_by') . "</td></tr>";
            $output .= "<tr>\r\n    <th width=\"1%\">ID</th>\r\n    <th width=\"80%\" align=\"left\">" . lang('item_edit', 'mob_name') . "</th>\r\n  </tr>";
            while ($mob = $sqlw->fetch_row($result2)) {
                $output .= "<tr>\r\n        <td width=\"10%\">";
                if ($user_lvl >= $action_permission['delete']) {
                    $output .= "<a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry={$mob['0']}&amp;error=4\" target=\"_blank\">{$mob['0']}</a>";
                } else {
                    $output .= "{$mob['0']}";
                }
                $output .= "\r\n        \r\n        <td width=\"80%\" colspan=\"8\" align=\"left\">\r\n          <a class=\"tooltip\" href=\"{$creature_datasite}{$mob['0']}\" target=\"_blank\">{$mob['1']}</a></td>\r\n        </td></tr>";
            }
        }
        // QUEST ITEM
        //$result2 = $sql->query("SELECT quests.entry,IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`quests`.`title`) as title,QuestLevel FROM quests LEFT JOIN quests_localized ON quests.entry = quests_localized.entry WHERE ( SrcItem = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR
        $result2 = $sqlw->query("SELECT quests.entry,`quests`.`title`,QuestLevel FROM quests LEFT JOIN quests_localized ON quests.entry = quests_localized.entry WHERE ( SrcItem = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR\r\n              ReqItemId2 = {$item['entry']} OR ReqItemId3 = {$item['entry']} OR ReqItemId4 = {$item['entry']} ) ORDER BY QuestLevel DESC");
        if ($sqlw->num_rows($result2)) {
            $output .= "<tr class=\"large_bold\"><td colspan=\"8\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'involved_in_quests') . ":</td></tr>";
            $output .= "<tr>\r\n    <th width=\"1%\">ID</th>\r\n    <th width=\"80%\">" . lang('item_edit', 'mob_name') . "</th>\r\n  </tr>";
            while ($quest = $sqlw->fetch_row($result2)) {
                $output .= "<tr><td width=\"20%\">id: {$quest['0']}</td>\r\n        <td width=\"80%\" colspan=\"6\" align=\"left\"><a class=\"tooltip\" href=\"{$quest_datasite}{$quest['0']}\" target=\"_blank\">({$quest['2']}) {$quest['1']}</a></td><td></td></tr>";
            }
        }
        // QUEST REWARD
        $result2 = $sqlw->query("SELECT quests.entry,IFNULL(" . ($deplang != 0 ? "title_loc{$deplang}" : "NULL") . ",`quests`.`title`) as title,QuestLevel FROM quests LEFT JOIN quests_localized ON quests.entry = quests_localized.entry WHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR\r\n              RewChoiceItemId3 = {$item['entry']} OR RewChoiceItemId4 = {$item['entry']} OR RewChoiceItemId5 = {$item['entry']} OR RewChoiceItemId6 = {$item['entry']} OR RewItemId1 = {$item['entry']} OR\r\n              RewItemId2 = {$item['entry']} OR RewItemId3 = {$item['entry']} OR RewItemId4 = {$item['entry']} )\r\n              ORDER BY QuestLevel DESC");
        if ($sqlw->num_rows($result2)) {
            $output .= "<tr class=\"large_bold\"><td colspan=\"9\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'reward_from_quest') . ":</td></tr>";
            while ($quest = $sqlw->fetch_row($result2)) {
                $output .= "<tr><td width=\"20%\">id: {$quest['0']}</td>\r\n        <td width=\"80%\" colspan=\"7\" align=\"left\"><a class=\"tooltip\" href=\"{$quest_datasite}{$quest['0']}\" target=\"_blank\">({$quest['2']}) {$quest['1']}</a></td></tr>";
            }
        }
        $output .= "</tr></table><br /><br />\r\n    </div>";
        if ($item['DisenchantID']) {
            $output .= "<div id=\"pane9\">\r\n  <br /><br /><table class=\"lined\" style=\"width: 720px;\">\r\n  <tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'disenchant_templ') . ": {$item['DisenchantID']}</td></tr>\r\n  <tr><td colspan=\"6\">";
            $cel_counter = 0;
            $row_flag = 0;
            $output .= "<table class=\"hidden\" align=\"center\"><tr>";
            $result1 = $sqlw->query("SELECT item,ChanceOrQuestChance,`groupid`,mincountOrRef,maxcount,lootcondition,condition_value1, condition_value2 FROM disenchant_loot_template WHERE entry = {$item['DisenchantID']} ORDER BY ChanceOrQuestChance DESC");
            while ($item = $sqlw->fetch_row($result1)) {
                $cel_counter++;
                $tooltip = get_item_name($item[0]) . " ({$item['0']})<br />" . lang('item_edit', 'drop_chance') . ": {$item['1']}%<br />" . lang('item_edit', 'quest_drop_chance') . ": {$item['2']}%<br />" . lang('item_edit', 'drop_chance') . ": {$item['3']}-{$item['4']}<br />" . lang('item_edit', 'lootcondition') . ": {$item['5']}<br />" . lang('item_edit', 'condition_value1') . ": {$item['6']}<br />" . lang('item_edit', 'condition_value2') . ": {$item['7']}";
                $output .= "<td>";
                $output .= maketooltip("<img src=\"" . get_item_icon($item[0]) . "\" class=\"icon_border\" alt=\"\" />", "{$item_datasite}{$item['0']}", $tooltip, "item_tooltip");
                $output .= "<br /><input type=\"checkbox\" name=\"del_de_items[]\" value=\"{$item['0']}\" /></td>";
                if ($cel_counter >= 16) {
                    $cel_counter = 0;
                    $output .= "</tr><tr>";
                    $row_flag++;
                }
            }
            if ($row_flag) {
                $output .= "<td colspan=\"" . (16 - $cel_counter) . "\"></td>";
            }
            $output .= "</td></tr></table>\r\n </td>\r\n</tr>\r\n<tr class=\"large_bold\"><td colspan=\"6\" class=\"hidden\" align=\"left\">" . lang('item_edit', 'add_items_to_templ') . ":</td></tr>\r\n<tr>\r\n<td>" . makeinfocell(lang('item_edit', 'loot_item_id'), lang('item_edit', 'loot_item_id_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"de_item\" size=\"8\" maxlength=\"10\" value=\"\" /></td>\r\n<td>" . makeinfocell(lang('item_edit', 'loot_drop_chance'), lang('item_edit', 'loot_drop_chance_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"de_ChanceOrQuestChance\" size=\"8\" maxlength=\"11\" value=\"0\" /></td>\r\n<td>" . makeinfocell(lang('item_edit', 'loot_quest_drop_chance'), lang('item_edit', 'loot_quest_drop_chance_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"de_groupid\" size=\"8\" maxlength=\"10\" value=\"0\" /></td>\r\n</tr>\r\n<tr>\r\n<td>" . makeinfocell(lang('item_edit', 'min_count'), lang('item_edit', 'min_count_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"de_mincountOrRef\" size=\"8\" maxlength=\"3\" value=\"1\" /></td>\r\n<td>" . makeinfocell(lang('item_edit', 'max_count'), lang('item_edit', 'max_count_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"de_maxcount\" size=\"8\" maxlength=\"3\" value=\"1\" /></td>\r\n</tr>\r\n<tr>\r\n<td>" . makeinfocell(lang('item_edit', 'lootcondition'), lang('item_edit', 'lootcondition_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"de_lootcondition\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\r\n<td>" . makeinfocell(lang('item_edit', 'condition_value1'), lang('item_edit', 'condition_value1_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"de_condition_value1\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\r\n<td>" . makeinfocell(lang('item_edit', 'condition_value2'), lang('item_edit', 'condition_value2_desc')) . "</td>\r\n  <td><input type=\"text\" name=\"de_condition_value2\" size=\"8\" maxlength=\"3\" value=\"0\" /></td>\r\n</tr>\r\n</table>\r\n</div>";
        }
        $output .= "</div>\r\n</div>\r\n<br />\r\n</form>\r\n\r\n<script type=\"text/javascript\">setupPanes(\"container\", \"tab1\")</script>";
        unset($socketColor_3);
        $output .= "\r\n          <table class=\"hidden\">\r\n            <tr>\r\n              <td>";
        if ($user_lvl >= $action_permission['delete']) {
            makebutton(lang('item_edit', 'del_item'), "item.php?action=delete&amp;entry={$entry}\" type=\"wrn", 180);
        }
        $output .= "\r\n              </td>\r\n              <td>";
        if ($user_lvl >= $action_permission['update']) {
            makebutton(lang('item_edit', 'update'), "javascript:do_submit('form1',0)\" type=\"wrn", 180);
        }
        $output .= "\r\n              </td>\r\n              <td>";
        if ($user_lvl >= $action_permission['insert']) {
            makebutton(lang('item_edit', 'export_sql'), "javascript:do_submit('form1',1)", 180);
        }
        $output .= "\r\n              </td></tr><tr>\r\n              <td>";
        makebutton(lang('global', 'back'), "javascript:window.history.back()", 130);
        $output .= "\r\n              </td>\r\n              <td>";
        makebutton(lang('item_edit', 'new_search'), "item.php", 130);
        $output .= "\r\n              </td>\r\n            </tr>\r\n          </table>\r\n        </center>\r\n";
    } else {
        error(lang('item_edit', 'item_not_found'));
        exit;
    }
}