Changeset 19 for minimanager/item.php


Ignore:
Timestamp:
Aug 13, 2007, 9:05:34 PM (17 years ago)
Author:
george
Message:

Aktualizace MaNGOS Minimanageru na verzi 0.1.4a.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/item.php

    r5 r19  
    2222 global $lang_global, $lang_item, $lang_item_edit, $lang_id_tab, $output, $mangos_db, $realm_id, $itemset_id;
    2323
    24  $mysql = new MySQL;
    25  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    26 
    27  $result = $mysql->query("SELECT count(*) FROM item_template");
    28  $tot_items = $mysql->result($result, 0);
    29  $mysql->close();
     24 $sql = new SQL;
     25 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     26
     27 $result = $sql->query("SELECT count(*) FROM item_template");
     28 $tot_items = $sql->result($result, 0);
     29 $sql->close();
    3030 
    3131 $output .= "<center>
     
    170170        &&(!isset($_POST['ItemLevel'])||$_POST['ItemLevel'] === '')&&(!isset($_POST['itemset'])||$_POST['itemset'] === '')&&(!isset($_POST['Flags'])||$_POST['Flags'] === '')
    171171        &&(!isset($_POST['custom_search'])||$_POST['custom_search'] === ''))
    172         {
    173172        redirect("item.php?error=1");
    174         }
    175 
    176 $mysql = new MySQL;
    177 $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    178 
    179 $class = $mysql->quote_smart($_POST['class']);
    180 $Quality = $mysql->quote_smart($_POST['Quality']);
    181 $InventoryType = $mysql->quote_smart($_POST['InventoryType']);
    182 $bonding = $mysql->quote_smart($_POST['bonding']);
    183 
    184 if ($_POST['entry'] != '') $entry = $mysql->quote_smart($_POST['entry']);
    185 if ($_POST['name'] != '') $name = $mysql->quote_smart($_POST['name']);
    186 if ($_POST['displayid'] != '') $displayid = $mysql->quote_smart($_POST['displayid']);
    187 if ($_POST['RequiredLevel'] != '') $RequiredLevel = $mysql->quote_smart($_POST['RequiredLevel']);
    188 if ($_POST['spellid_1'] != '') $spellid_1 = $mysql->quote_smart($_POST['spellid_1']);
    189 if ($_POST['spellid_2'] != '') $spellid_2 = $mysql->quote_smart($_POST['spellid_2']);
    190 if ($_POST['spellid_3'] != '') $spellid_3 = $mysql->quote_smart($_POST['spellid_3']);
    191 if ($_POST['spellid_4'] != '') $spellid_4 = $mysql->quote_smart($_POST['spellid_4']);
    192 if ($_POST['ItemLevel'] != '') $ItemLevel = $mysql->quote_smart($_POST['ItemLevel']);
    193 if ($_POST['itemset'] != '') $itemset = $mysql->quote_smart($_POST['itemset']);
    194 if ($_POST['Flags'] != '') $Flags = $mysql->quote_smart($_POST['Flags']);
    195 if ($_POST['custom_search'] != '') $custom_search = $mysql->quote_smart($_POST['custom_search']);
     173
     174$sql = new SQL;
     175$sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     176
     177$class = $sql->quote_smart($_POST['class']);
     178$Quality = $sql->quote_smart($_POST['Quality']);
     179$InventoryType = $sql->quote_smart($_POST['InventoryType']);
     180$bonding = $sql->quote_smart($_POST['bonding']);
     181
     182if ($_POST['entry'] != '') $entry = $sql->quote_smart($_POST['entry']);
     183if ($_POST['name'] != '') $name = $sql->quote_smart($_POST['name']);
     184if ($_POST['displayid'] != '') $displayid = $sql->quote_smart($_POST['displayid']);
     185if ($_POST['RequiredLevel'] != '') $RequiredLevel = $sql->quote_smart($_POST['RequiredLevel']);
     186if ($_POST['spellid_1'] != '') $spellid_1 = $sql->quote_smart($_POST['spellid_1']);
     187if ($_POST['spellid_2'] != '') $spellid_2 = $sql->quote_smart($_POST['spellid_2']);
     188if ($_POST['spellid_3'] != '') $spellid_3 = $sql->quote_smart($_POST['spellid_3']);
     189if ($_POST['spellid_4'] != '') $spellid_4 = $sql->quote_smart($_POST['spellid_4']);
     190if ($_POST['ItemLevel'] != '') $ItemLevel = $sql->quote_smart($_POST['ItemLevel']);
     191if ($_POST['itemset'] != '') $itemset = $sql->quote_smart($_POST['itemset']);
     192if ($_POST['Flags'] != '') $Flags = $sql->quote_smart($_POST['Flags']);
     193if ($_POST['custom_search'] != '') $custom_search = $sql->quote_smart($_POST['custom_search']);
    196194        else $custom_search = "";
    197195
     
    218216 if($where == "WHERE entry > 0 ") redirect("item.php?error=1");
    219217
    220  $result = $mysql->query("SELECT entry,displayid,name,RequiredLevel,ItemLevel FROM item_template $where ORDER BY entry LIMIT $sql_search_limit");
    221  $total_items_found = $mysql->num_rows($result);
     218 $result = $sql->query("SELECT entry,displayid,name,RequiredLevel,ItemLevel FROM item_template $where ORDER BY entry LIMIT $sql_search_limit");
     219 $total_items_found = $sql->num_rows($result);
    222220
    223221  $output .= "<center>
     
    231229  $output .= "<table class=\"lined\">
    232230   <tr>
    233         <td width=\"15%\" class=\"head\">{$lang_item_edit['entry']}</td>
    234         <td width=\"10%\" class=\"head\">{$lang_item_edit['display_id']}</td>
    235         <td width=\"55%\" class=\"head\">{$lang_item_edit['item_name']}</td>
    236         <td width=\"10%\" class=\"head\">{$lang_item_edit['req_level']}</td>
    237         <td width=\"10%\" class=\"head\">{$lang_item_edit['item_level']}</td>
     231        <th width=\"15%\">{$lang_item_edit['entry']}</th>
     232        <th width=\"10%\">{$lang_item_edit['display_id']}</th>
     233        <th width=\"55%\">{$lang_item_edit['item_name']}</th>
     234        <th width=\"10%\">{$lang_item_edit['req_level']}</th>
     235        <th width=\"10%\">{$lang_item_edit['item_level']}</th>
    238236  </tr>";
    239237
     
    241239
    242240 for ($i=1; $i<=$total_items_found; $i++){
    243   $item = $mysql->fetch_row($result);
     241  $item = $sql->fetch_row($result);
    244242 
    245243  $tooltip = get_item_tooltip($item[0]);
     
    257255  $output .= "</table></center><br />";
    258256
    259  $mysql->close();
     257 $sql->close();
    260258}
    261259
     
    14481446 if (!isset($_GET['entry'])) redirect("item.php?error=1");
    14491447
    1450  $mysql = new MySQL;
    1451  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    1452  
    1453  $entry = $mysql->quote_smart($_GET['entry']);
    1454  $result = $mysql->query("SELECT * FROM item_template WHERE entry = '$entry'");
     1448 $sql = new SQL;
     1449 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     1450 
     1451 $entry = $sql->quote_smart($_GET['entry']);
     1452 $result = $sql->query("SELECT * FROM item_template WHERE entry = '$entry'");
    14551453
    14561454 if ($result){
    1457         $item = $mysql->fetch_assoc($result);
     1455        $item = $sql->fetch_assoc($result);
    14581456        require_once("scripts/get_lib.php");
    14591457        $tooltip = get_item_tooltip($entry);
     
    28562854        <tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['dropped_by']}: {$lang_item_edit['top_x']}</td></tr>
    28572855        <tr>
    2858                 <td width=\"35%\" class=\"head\">{$lang_item_edit['mob_name']}</td>
    2859                 <td width=\"15%\" class=\"head\">{$lang_item_edit['mob_level']}</td>
    2860                 <td width=\"25%\" class=\"head\">{$lang_item_edit['mob_drop_chance']}</td>
    2861                 <td width=\"25%\" class=\"head\">{$lang_item_edit['mob_quest_drop_chance']}</td>
     2856                <th width=\"35%\">{$lang_item_edit['mob_name']}</th>
     2857                <th width=\"15%\">{$lang_item_edit['mob_level']}</th>
     2858                <th width=\"25%\">{$lang_item_edit['mob_drop_chance']}</th>
     2859                <th width=\"25%\">{$lang_item_edit['mob_quest_drop_chance']}</th>
    28622860        </tr>";
    28632861
    2864  $result2 = $mysql->query("SELECT entry,ChanceOrRef,QuestChanceOrGroup FROM creature_loot_template WHERE item = {$item['entry']} ORDER BY QuestChanceOrGroup,ChanceOrRef DESC LIMIT 5");
    2865  while ($info = $mysql->fetch_row($result2)){
    2866         $result3 = $mysql->query("SELECT entry,name,maxlevel FROM creature_template WHERE lootid = {$info[0]} LIMIT 1");
    2867         while ($mob = $mysql->fetch_row($result3)){
     2862 $result2 = $sql->query("SELECT entry,ChanceOrRef,QuestChanceOrGroup FROM creature_loot_template WHERE item = {$item['entry']} ORDER BY QuestChanceOrGroup,ChanceOrRef DESC LIMIT 5");
     2863 while ($info = $sql->fetch_row($result2)){
     2864        $result3 = $sql->query("SELECT entry,name,maxlevel FROM creature_template WHERE lootid = {$info[0]} LIMIT 1");
     2865        while ($mob = $sql->fetch_row($result3)){
    28682866                $output .= "<tr><td><a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry=$mob[0]&amp;error=4\" target=\"_blank\">$mob[1]</a></td>
    28692867                                        <td>$mob[2]</td>
     
    28732871        }
    28742872
    2875 $result2 = $mysql->query("SELECT entry,name,maxlevel FROM creature_template WHERE entry IN (SELECT entry FROM npc_vendor WHERE item = {$item['entry']}) ORDER BY maxlevel DESC LIMIT 5");
    2876  if ($mysql->num_rows($result2)){
     2873$result2 = $sql->query("SELECT entry,name,maxlevel FROM creature_template WHERE entry IN (SELECT entry FROM npc_vendor WHERE item = {$item['entry']}) ORDER BY maxlevel DESC LIMIT 5");
     2874 if ($sql->num_rows($result2)){
    28772875        $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['soled_by']}: {$lang_item_edit['limit_x']}</td></tr>";
    2878         while ($mob = $mysql->fetch_row($result2)){
     2876        while ($mob = $sql->fetch_row($result2)){
    28792877                $output .= "<tr><td width=\"20%\">$mob[2]</td>
    28802878                                <td width=\"80%\" colspan=\"3\" align=\"left\"><a class=\"tooltip\" href=\"creature.php?action=edit&amp;entry=$mob[0]&amp;error=4\" target=\"_blank\">$mob[1]</a></td></tr>";
     
    28822880}
    28832881
    2884 $result2 = $mysql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( SrcItemId = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR
     2882$result2 = $sql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( SrcItemId = {$item['entry']} OR ReqItemId1 = {$item['entry']} OR
    28852883                                                        ReqItemId2 = {$item['entry']} OR ReqItemId3 = {$item['entry']} OR ReqItemId4 = {$item['entry']} OR RewItemId1 = {$item['entry']} OR
    28862884                                                        RewItemId2 = {$item['entry']} OR RewItemId3 = {$item['entry']} OR RewItemId4 = {$item['entry']} ) ORDER BY QuestLevel DESC");
    2887  if ($mysql->num_rows($result2)){
     2885 if ($sql->num_rows($result2)){
    28882886        $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['involved_in_quests']}:</td></tr>";
    2889         while ($quest = $mysql->fetch_row($result2)){
     2887        while ($quest = $sql->fetch_row($result2)){
    28902888                $output .= "<tr><td width=\"20%\">id: $quest[0]</td>
    28912889                                <td width=\"80%\" colspan=\"3\" align=\"left\"><a class=\"tooltip\" href=\"$quest_datasite$quest[0]\" target=\"_blank\">($quest[2]) $quest[1]</a></td></tr>";
     
    28942892 }
    28952893
    2896 $result2 = $mysql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR
     2894$result2 = $sql->query("SELECT entry,title,QuestLevel FROM quest_template WHERE ( RewChoiceItemId1 = {$item['entry']} OR RewChoiceItemId2 = {$item['entry']} OR
    28972895                                                        RewChoiceItemId3 = {$item['entry']} OR RewChoiceItemId4 = {$item['entry']} OR RewChoiceItemId5 = {$item['entry']} OR RewChoiceItemId6 = {$item['entry']} )
    28982896                                                        ORDER BY QuestLevel DESC");                                     
    2899  if ($mysql->num_rows($result2)){
     2897 if ($sql->num_rows($result2)){
    29002898        $output .= "<tr class=\"large_bold\"><td colspan=\"4\" class=\"hidden\" align=\"left\">{$lang_item_edit['reward_from_quest']}:</td></tr>";
    2901         while ($quest = $mysql->fetch_row($result2)){
     2899        while ($quest = $sql->fetch_row($result2)){
    29022900                $output .= "<tr><td width=\"20%\">id: $quest[0]</td>
    29032901                                <td width=\"80%\" colspan=\"3\" align=\"left\"><a class=\"tooltip\" href=\"$quest_datasite$quest[0]\" target=\"_blank\">($quest[2]) $quest[1]</a></td></tr>";
     
    29162914        $row_flag = 0;
    29172915        $output .= "<table class=\"hidden\" align=\"center\"><tr>";
    2918         $result1 = $mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM disenchant_loot_template WHERE entry = {$item['DisenchantID']} ORDER BY ChanceOrRef DESC");
    2919         while ($item = $mysql->fetch_row($result1)){
     2916        $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM disenchant_loot_template WHERE entry = {$item['DisenchantID']} ORDER BY ChanceOrRef DESC");
     2917        while ($item = $sql->fetch_row($result1)){
    29202918                $cel_counter++;
    29212919                $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['quest_freeforall']}: $item[5]";
     
    29732971 
    29742972
    2975  $mysql->close();
     2973 $sql->close();
    29762974 } else {
    2977                 $mysql->close();
     2975                $sql->close();
    29782976                error($lang_item_edit['item_not_found']);
    29792977                exit();
     
    29912989 if (!isset($_POST['entry']) || $_POST['entry'] === '') redirect("item.php?error=1");
    29922990 
    2993  $mysql = new MySQL;
    2994  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    2995 
    2996  $entry = $mysql->quote_smart($_POST['entry']);
    2997  if (isset($_POST['class']) && $_POST['class'] != '') $class = $mysql->quote_smart($_POST['class']);
     2991 $sql = new SQL;
     2992 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     2993
     2994 $entry = $sql->quote_smart($_POST['entry']);
     2995 if (isset($_POST['class']) && $_POST['class'] != '') $class = $sql->quote_smart($_POST['class']);
    29982996        else $class = 0;
    2999  if (isset($_POST['subclass']) && $_POST['subclass'] != '') $subclass = $mysql->quote_smart($_POST['subclass']);
     2997 if (isset($_POST['subclass']) && $_POST['subclass'] != '') $subclass = $sql->quote_smart($_POST['subclass']);
    30002998        else $subclass = 0;
    3001  if (isset($_POST['name']) && $_POST['name'] != '') $name = $mysql->quote_smart($_POST['name']);
     2999 if (isset($_POST['name']) && $_POST['name'] != '') $name = $sql->quote_smart($_POST['name']);
    30023000        else $name = 0;
    3003  if (isset($_POST['displayid']) && $_POST['displayid'] != '') $displayid = $mysql->quote_smart($_POST['displayid']);
     3001 if (isset($_POST['displayid']) && $_POST['displayid'] != '') $displayid = $sql->quote_smart($_POST['displayid']);
    30043002        else $displayid = 0;
    3005  if (isset($_POST['Quality']) && $_POST['Quality'] != '') $Quality = $mysql->quote_smart($_POST['Quality']);
     3003 if (isset($_POST['Quality']) && $_POST['Quality'] != '') $Quality = $sql->quote_smart($_POST['Quality']);
    30063004        else $Quality = 0;
    3007  if (isset($_POST['Flags']) && $_POST['Flags'] != '') $Flags = $mysql->quote_smart($_POST['Flags']);
     3005 if (isset($_POST['Flags']) && $_POST['Flags'] != '') $Flags = $sql->quote_smart($_POST['Flags']);
    30083006        else $Flags = 0;
    3009  if (isset($_POST['BuyCount']) && $_POST['BuyCount'] != '') $BuyCount = $mysql->quote_smart($_POST['BuyCount']);
     3007 if (isset($_POST['BuyCount']) && $_POST['BuyCount'] != '') $BuyCount = $sql->quote_smart($_POST['BuyCount']);
    30103008        else $BuyCount = 0;
    3011  if (isset($_POST['BuyPrice']) && $_POST['BuyPrice'] != '') $BuyPrice = $mysql->quote_smart($_POST['BuyPrice']);
     3009 if (isset($_POST['BuyPrice']) && $_POST['BuyPrice'] != '') $BuyPrice = $sql->quote_smart($_POST['BuyPrice']);
    30123010        else $BuyPrice = 0;
    3013  if (isset($_POST['SellPrice']) && $_POST['SellPrice'] != '') $SellPrice = $mysql->quote_smart($_POST['SellPrice']);
     3011 if (isset($_POST['SellPrice']) && $_POST['SellPrice'] != '') $SellPrice = $sql->quote_smart($_POST['SellPrice']);
    30143012        else $SellPrice = 0;
    3015  if (isset($_POST['InventoryType']) && $_POST['InventoryType'] != '') $InventoryType = $mysql->quote_smart($_POST['InventoryType']);
     3013 if (isset($_POST['InventoryType']) && $_POST['InventoryType'] != '') $InventoryType = $sql->quote_smart($_POST['InventoryType']);
    30163014        else $AllowableClass = 0;
    3017  if (isset($_POST['AllowableClass'])) $AllowableClass = $mysql->quote_smart($_POST['AllowableClass']);
     3015 if (isset($_POST['AllowableClass'])) $AllowableClass = $sql->quote_smart($_POST['AllowableClass']);
    30183016        else $AllowableClass = -1;
    3019  if (isset($_POST['AllowableRace'])) $AllowableRace = $mysql->quote_smart($_POST['AllowableRace']);
     3017 if (isset($_POST['AllowableRace'])) $AllowableRace = $sql->quote_smart($_POST['AllowableRace']);
    30203018        else $AllowableRace = -1;
    3021  if (isset($_POST['ItemLevel']) && $_POST['ItemLevel'] != '') $ItemLevel = $mysql->quote_smart($_POST['ItemLevel']);
     3019 if (isset($_POST['ItemLevel']) && $_POST['ItemLevel'] != '') $ItemLevel = $sql->quote_smart($_POST['ItemLevel']);
    30223020        else $ItemLevel = 1;
    3023  if (isset($_POST['RequiredLevel']) && $_POST['RequiredLevel'] != '') $RequiredLevel = $mysql->quote_smart($_POST['RequiredLevel']);
     3021 if (isset($_POST['RequiredLevel']) && $_POST['RequiredLevel'] != '') $RequiredLevel = $sql->quote_smart($_POST['RequiredLevel']);
    30243022        else $RequiredLevel = 0;
    3025  if (isset($_POST['RequiredSkill']) && $_POST['RequiredSkill'] != '') $RequiredSkill = $mysql->quote_smart($_POST['RequiredSkill']);
     3023 if (isset($_POST['RequiredSkill']) && $_POST['RequiredSkill'] != '') $RequiredSkill = $sql->quote_smart($_POST['RequiredSkill']);
    30263024        else $RequiredSkill = 0;
    3027  if (isset($_POST['RequiredSkillRank']) && $_POST['RequiredSkillRank'] != '') $RequiredSkillRank = $mysql->quote_smart($_POST['RequiredSkillRank']);
     3025 if (isset($_POST['RequiredSkillRank']) && $_POST['RequiredSkillRank'] != '') $RequiredSkillRank = $sql->quote_smart($_POST['RequiredSkillRank']);
    30283026        else $RequiredSkillRank = 0;
    3029  if (isset($_POST['requiredspell']) && $_POST['requiredspell'] != '') $requiredspell = $mysql->quote_smart($_POST['requiredspell']);
     3027 if (isset($_POST['requiredspell']) && $_POST['requiredspell'] != '') $requiredspell = $sql->quote_smart($_POST['requiredspell']);
    30303028        else $requiredspell = 0;
    3031  if (isset($_POST['requiredhonorrank']) && $_POST['requiredhonorrank'] != '') $requiredhonorrank = $mysql->quote_smart($_POST['requiredhonorrank']);
     3029 if (isset($_POST['requiredhonorrank']) && $_POST['requiredhonorrank'] != '') $requiredhonorrank = $sql->quote_smart($_POST['requiredhonorrank']);
    30323030        else $requiredhonorrank = 0;
    3033  if (isset($_POST['RequiredCityRank']) && $_POST['RequiredCityRank'] != '') $RequiredCityRank = $mysql->quote_smart($_POST['RequiredCityRank']);
     3031 if (isset($_POST['RequiredCityRank']) && $_POST['RequiredCityRank'] != '') $RequiredCityRank = $sql->quote_smart($_POST['RequiredCityRank']);
    30343032        else $RequiredCityRank = 0;
    3035  if (isset($_POST['RequiredReputationFaction']) && $_POST['RequiredReputationFaction'] != '') $RequiredReputationFaction = $mysql->quote_smart($_POST['RequiredReputationFaction']);
     3033 if (isset($_POST['RequiredReputationFaction']) && $_POST['RequiredReputationFaction'] != '') $RequiredReputationFaction = $sql->quote_smart($_POST['RequiredReputationFaction']);
    30363034        else $RequiredReputationFaction = 0;
    3037  if (isset($_POST['RequiredReputationRank']) && $_POST['RequiredReputationRank'] != '') $RequiredReputationRank = $mysql->quote_smart($_POST['RequiredReputationRank']);
     3035 if (isset($_POST['RequiredReputationRank']) && $_POST['RequiredReputationRank'] != '') $RequiredReputationRank = $sql->quote_smart($_POST['RequiredReputationRank']);
    30383036        else $RequiredReputationRank = 0;
    3039  if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $mysql->quote_smart($_POST['maxcount']);
     3037 if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $sql->quote_smart($_POST['maxcount']);
    30403038        else $maxcount = 0;
    3041  if (isset($_POST['stackable']) && $_POST['stackable'] != '') $stackable = $mysql->quote_smart($_POST['stackable']);
     3039 if (isset($_POST['stackable']) && $_POST['stackable'] != '') $stackable = $sql->quote_smart($_POST['stackable']);
    30423040        else $description = 0;
    3043  if (isset($_POST['ContainerSlots']) && $_POST['ContainerSlots'] != '') $ContainerSlots = $mysql->quote_smart($_POST['ContainerSlots']);
     3041 if (isset($_POST['ContainerSlots']) && $_POST['ContainerSlots'] != '') $ContainerSlots = $sql->quote_smart($_POST['ContainerSlots']);
    30443042        else $ContainerSlots = 0;
    3045  if (isset($_POST['stat_type1']) && $_POST['stat_type1'] != '') $stat_type1 = $mysql->quote_smart($_POST['stat_type1']);
     3043 if (isset($_POST['stat_type1']) && $_POST['stat_type1'] != '') $stat_type1 = $sql->quote_smart($_POST['stat_type1']);
    30463044        else $stat_type1 = 0;
    3047  if (isset($_POST['stat_value1']) && $_POST['stat_value1'] != '') $stat_value1 = $mysql->quote_smart($_POST['stat_value1']);
     3045 if (isset($_POST['stat_value1']) && $_POST['stat_value1'] != '') $stat_value1 = $sql->quote_smart($_POST['stat_value1']);
    30483046        else $stat_value1 = 0;
    3049  if (isset($_POST['stat_type2']) && $_POST['stat_type2'] != '') $stat_type2 = $mysql->quote_smart($_POST['stat_type2']);
     3047 if (isset($_POST['stat_type2']) && $_POST['stat_type2'] != '') $stat_type2 = $sql->quote_smart($_POST['stat_type2']);
    30503048        else $stat_type2 = 0;
    3051  if (isset($_POST['stat_value2']) && $_POST['stat_value2'] != '') $stat_value2 = $mysql->quote_smart($_POST['stat_value2']);
     3049 if (isset($_POST['stat_value2']) && $_POST['stat_value2'] != '') $stat_value2 = $sql->quote_smart($_POST['stat_value2']);
    30523050        else $stat_value2 = 0;
    3053  if (isset($_POST['stat_type3']) && $_POST['stat_type3'] != '') $stat_type3 = $mysql->quote_smart($_POST['stat_type3']);
     3051 if (isset($_POST['stat_type3']) && $_POST['stat_type3'] != '') $stat_type3 = $sql->quote_smart($_POST['stat_type3']);
    30543052        else $stat_type3 = 0;
    3055  if (isset($_POST['stat_value3']) && $_POST['stat_value3'] != '') $stat_value3 = $mysql->quote_smart($_POST['stat_value3']);
     3053 if (isset($_POST['stat_value3']) && $_POST['stat_value3'] != '') $stat_value3 = $sql->quote_smart($_POST['stat_value3']);
    30563054        else $stat_value3 = 0;
    3057  if (isset($_POST['stat_type4']) && $_POST['stat_type4'] != '') $stat_type4 = $mysql->quote_smart($_POST['stat_type4']);
     3055 if (isset($_POST['stat_type4']) && $_POST['stat_type4'] != '') $stat_type4 = $sql->quote_smart($_POST['stat_type4']);
    30583056        else $stat_type4 = 0;
    3059  if (isset($_POST['stat_value4']) && $_POST['stat_value4'] != '') $stat_value4 = $mysql->quote_smart($_POST['stat_value4']);
     3057 if (isset($_POST['stat_value4']) && $_POST['stat_value4'] != '') $stat_value4 = $sql->quote_smart($_POST['stat_value4']);
    30603058        else $stat_value4 = 0;
    3061  if (isset($_POST['stat_type5']) && $_POST['stat_type5'] != '') $stat_type5 = $mysql->quote_smart($_POST['stat_type5']);
     3059 if (isset($_POST['stat_type5']) && $_POST['stat_type5'] != '') $stat_type5 = $sql->quote_smart($_POST['stat_type5']);
    30623060        else $stat_type5 = 0;
    3063  if (isset($_POST['stat_value5']) && $_POST['stat_value5'] != '') $stat_value5 = $mysql->quote_smart($_POST['stat_value5']);
     3061 if (isset($_POST['stat_value5']) && $_POST['stat_value5'] != '') $stat_value5 = $sql->quote_smart($_POST['stat_value5']);
    30643062        else $stat_value5 = 0;
    3065  if (isset($_POST['stat_type6']) && $_POST['stat_type6'] != '') $stat_type6 = $mysql->quote_smart($_POST['stat_type6']);
     3063 if (isset($_POST['stat_type6']) && $_POST['stat_type6'] != '') $stat_type6 = $sql->quote_smart($_POST['stat_type6']);
    30663064        else $stat_type6 = 0;
    3067  if (isset($_POST['stat_value6']) && $_POST['stat_value6'] != '') $stat_value6 = $mysql->quote_smart($_POST['stat_value6']);
     3065 if (isset($_POST['stat_value6']) && $_POST['stat_value6'] != '') $stat_value6 = $sql->quote_smart($_POST['stat_value6']);
    30683066        else $stat_value6 = 0;
    3069  if (isset($_POST['stat_type7']) && $_POST['stat_type7'] != '') $stat_type7 = $mysql->quote_smart($_POST['stat_type7']);
     3067 if (isset($_POST['stat_type7']) && $_POST['stat_type7'] != '') $stat_type7 = $sql->quote_smart($_POST['stat_type7']);
    30703068        else $stat_type7 = 0;
    3071  if (isset($_POST['stat_value7']) && $_POST['stat_value7'] != '') $stat_value7 = $mysql->quote_smart($_POST['stat_value7']);
     3069 if (isset($_POST['stat_value7']) && $_POST['stat_value7'] != '') $stat_value7 = $sql->quote_smart($_POST['stat_value7']);
    30723070        else $stat_value7 = 0;
    3073  if (isset($_POST['stat_type8']) && $_POST['stat_type8'] != '') $stat_type8 = $mysql->quote_smart($_POST['stat_type8']);
     3071 if (isset($_POST['stat_type8']) && $_POST['stat_type8'] != '') $stat_type8 = $sql->quote_smart($_POST['stat_type8']);
    30743072        else $stat_type8 = 0;
    3075  if (isset($_POST['stat_value8']) && $_POST['stat_value8'] != '') $stat_value8 = $mysql->quote_smart($_POST['stat_value8']);
     3073 if (isset($_POST['stat_value8']) && $_POST['stat_value8'] != '') $stat_value8 = $sql->quote_smart($_POST['stat_value8']);
    30763074        else $stat_value8 = 0;
    3077  if (isset($_POST['stat_type9']) && $_POST['stat_type9'] != '') $stat_type9 = $mysql->quote_smart($_POST['stat_type9']);
     3075 if (isset($_POST['stat_type9']) && $_POST['stat_type9'] != '') $stat_type9 = $sql->quote_smart($_POST['stat_type9']);
    30783076        else $stat_type9 = 0;
    3079  if (isset($_POST['stat_value9']) && $_POST['stat_value9'] != '') $stat_value9 = $mysql->quote_smart($_POST['stat_value9']);
     3077 if (isset($_POST['stat_value9']) && $_POST['stat_value9'] != '') $stat_value9 = $sql->quote_smart($_POST['stat_value9']);
    30803078        else $stat_value9 = 0;
    3081  if (isset($_POST['stat_type10']) && $_POST['stat_type10'] != '') $stat_type10 = $mysql->quote_smart($_POST['stat_type10']);
     3079 if (isset($_POST['stat_type10']) && $_POST['stat_type10'] != '') $stat_type10 = $sql->quote_smart($_POST['stat_type10']);
    30823080        else $stat_type10 = 0;
    3083  if (isset($_POST['stat_value10']) && $_POST['stat_value10'] != '') $stat_value10 = $mysql->quote_smart($_POST['stat_value10']);
     3081 if (isset($_POST['stat_value10']) && $_POST['stat_value10'] != '') $stat_value10 = $sql->quote_smart($_POST['stat_value10']);
    30843082        else $stat_value10 = 0;
    3085  if (isset($_POST['dmg_min1']) && $_POST['dmg_min1'] != '') $dmg_min1 = $mysql->quote_smart($_POST['dmg_min1']);
     3083 if (isset($_POST['dmg_min1']) && $_POST['dmg_min1'] != '') $dmg_min1 = $sql->quote_smart($_POST['dmg_min1']);
    30863084        else $dmg_min1 = 0;
    3087  if (isset($_POST['dmg_max1']) && $_POST['dmg_max1'] != '') $dmg_max1 = $mysql->quote_smart($_POST['dmg_max1']);
     3085 if (isset($_POST['dmg_max1']) && $_POST['dmg_max1'] != '') $dmg_max1 = $sql->quote_smart($_POST['dmg_max1']);
    30883086        else $dmg_max1 = 0;
    3089  if (isset($_POST['dmg_type1']) && $_POST['dmg_type1'] != '') $dmg_type1 = $mysql->quote_smart($_POST['dmg_type1']);
     3087 if (isset($_POST['dmg_type1']) && $_POST['dmg_type1'] != '') $dmg_type1 = $sql->quote_smart($_POST['dmg_type1']);
    30903088        else $dmg_type1 = 0;
    3091  if (isset($_POST['dmg_min2']) && $_POST['dmg_min2'] != '') $dmg_min2 = $mysql->quote_smart($_POST['dmg_min2']);
     3089 if (isset($_POST['dmg_min2']) && $_POST['dmg_min2'] != '') $dmg_min2 = $sql->quote_smart($_POST['dmg_min2']);
    30923090        else $dmg_min2 = 0;
    3093  if (isset($_POST['dmg_max2']) && $_POST['dmg_max2'] != '') $dmg_max2 = $mysql->quote_smart($_POST['dmg_max2']);
     3091 if (isset($_POST['dmg_max2']) && $_POST['dmg_max2'] != '') $dmg_max2 = $sql->quote_smart($_POST['dmg_max2']);
    30943092        else $dmg_max2 = 0;
    3095  if (isset($_POST['dmg_type2']) && $_POST['dmg_type2'] != '') $dmg_type2 = $mysql->quote_smart($_POST['dmg_type2']);
     3093 if (isset($_POST['dmg_type2']) && $_POST['dmg_type2'] != '') $dmg_type2 = $sql->quote_smart($_POST['dmg_type2']);
    30963094        else $dmg_type2 = 0;
    3097  if (isset($_POST['dmg_min3']) && $_POST['dmg_min3'] != '') $dmg_min3 = $mysql->quote_smart($_POST['dmg_min3']);
     3095 if (isset($_POST['dmg_min3']) && $_POST['dmg_min3'] != '') $dmg_min3 = $sql->quote_smart($_POST['dmg_min3']);
    30983096        else $dmg_min3 = 0;
    3099  if (isset($_POST['dmg_max3']) && $_POST['dmg_max3'] != '') $dmg_max3 = $mysql->quote_smart($_POST['dmg_max3']);
     3097 if (isset($_POST['dmg_max3']) && $_POST['dmg_max3'] != '') $dmg_max3 = $sql->quote_smart($_POST['dmg_max3']);
    31003098        else $dmg_max3 = 0;
    3101  if (isset($_POST['dmg_type3']) && $_POST['dmg_type3'] != '') $dmg_type3 = $mysql->quote_smart($_POST['dmg_type3']);
     3099 if (isset($_POST['dmg_type3']) && $_POST['dmg_type3'] != '') $dmg_type3 = $sql->quote_smart($_POST['dmg_type3']);
    31023100        else $dmg_type3 = 0;
    3103  if (isset($_POST['dmg_min4']) && $_POST['dmg_min4'] != '') $dmg_min4 = $mysql->quote_smart($_POST['dmg_min4']);
     3101 if (isset($_POST['dmg_min4']) && $_POST['dmg_min4'] != '') $dmg_min4 = $sql->quote_smart($_POST['dmg_min4']);
    31043102        else $dmg_min4 = 0;
    3105  if (isset($_POST['dmg_max4']) && $_POST['dmg_max4'] != '') $dmg_max4 = $mysql->quote_smart($_POST['dmg_max4']);
     3103 if (isset($_POST['dmg_max4']) && $_POST['dmg_max4'] != '') $dmg_max4 = $sql->quote_smart($_POST['dmg_max4']);
    31063104        else $dmg_max4 = 0;
    3107  if (isset($_POST['dmg_type4']) && $_POST['dmg_type4'] != '') $dmg_type4 = $mysql->quote_smart($_POST['dmg_type4']);
     3105 if (isset($_POST['dmg_type4']) && $_POST['dmg_type4'] != '') $dmg_type4 = $sql->quote_smart($_POST['dmg_type4']);
    31083106        else $dmg_type4 = 0;
    3109  if (isset($_POST['dmg_min5']) && $_POST['dmg_min5'] != '') $dmg_min5 = $mysql->quote_smart($_POST['dmg_min5']);
     3107 if (isset($_POST['dmg_min5']) && $_POST['dmg_min5'] != '') $dmg_min5 = $sql->quote_smart($_POST['dmg_min5']);
    31103108        else $dmg_min5 = 0;
    3111  if (isset($_POST['dmg_max5']) && $_POST['dmg_max5'] != '') $dmg_max5 = $mysql->quote_smart($_POST['dmg_max5']);
     3109 if (isset($_POST['dmg_max5']) && $_POST['dmg_max5'] != '') $dmg_max5 = $sql->quote_smart($_POST['dmg_max5']);
    31123110        else $dmg_max5 = 0;
    3113  if (isset($_POST['dmg_type5']) && $_POST['dmg_type5'] != '') $dmg_type5 = $mysql->quote_smart($_POST['dmg_type5']);
     3111 if (isset($_POST['dmg_type5']) && $_POST['dmg_type5'] != '') $dmg_type5 = $sql->quote_smart($_POST['dmg_type5']);
    31143112        else $dmg_type5 = 0;
    3115  if (isset($_POST['armor']) && $_POST['armor'] != '') $armor = $mysql->quote_smart($_POST['armor']);
     3113 if (isset($_POST['armor']) && $_POST['armor'] != '') $armor = $sql->quote_smart($_POST['armor']);
    31163114        else $armor = 0;
    3117  if (isset($_POST['holy_res']) && $_POST['holy_res'] != '') $holy_res = $mysql->quote_smart($_POST['holy_res']);
     3115 if (isset($_POST['holy_res']) && $_POST['holy_res'] != '') $holy_res = $sql->quote_smart($_POST['holy_res']);
    31183116        else $holy_res = 0;
    3119  if (isset($_POST['fire_res']) && $_POST['fire_res'] != '') $fire_res = $mysql->quote_smart($_POST['fire_res']);
     3117 if (isset($_POST['fire_res']) && $_POST['fire_res'] != '') $fire_res = $sql->quote_smart($_POST['fire_res']);
    31203118        else $fire_res = 0;
    3121  if (isset($_POST['nature_res']) && $_POST['nature_res'] != '') $nature_res = $mysql->quote_smart($_POST['nature_res']);
     3119 if (isset($_POST['nature_res']) && $_POST['nature_res'] != '') $nature_res = $sql->quote_smart($_POST['nature_res']);
    31223120        else $nature_res = 0;
    3123  if (isset($_POST['frost_res']) && $_POST['frost_res'] != '') $frost_res = $mysql->quote_smart($_POST['frost_res']);
     3121 if (isset($_POST['frost_res']) && $_POST['frost_res'] != '') $frost_res = $sql->quote_smart($_POST['frost_res']);
    31243122        else $frost_res = 0;
    3125  if (isset($_POST['shadow_res']) && $_POST['shadow_res'] != '') $shadow_res = $mysql->quote_smart($_POST['shadow_res']);
     3123 if (isset($_POST['shadow_res']) && $_POST['shadow_res'] != '') $shadow_res = $sql->quote_smart($_POST['shadow_res']);
    31263124        else $shadow_res = 0;
    3127  if (isset($_POST['arcane_res']) && $_POST['arcane_res'] != '') $arcane_res = $mysql->quote_smart($_POST['arcane_res']);
     3125 if (isset($_POST['arcane_res']) && $_POST['arcane_res'] != '') $arcane_res = $sql->quote_smart($_POST['arcane_res']);
    31283126        else $arcane_res = 0;
    3129  if (isset($_POST['delay']) && $_POST['delay'] != '') $delay = $mysql->quote_smart($_POST['delay']);
     3127 if (isset($_POST['delay']) && $_POST['delay'] != '') $delay = $sql->quote_smart($_POST['delay']);
    31303128        else $delay = 0;
    3131  if (isset($_POST['ammo_type']) && $_POST['ammo_type'] != '') $ammo_type = $mysql->quote_smart($_POST['ammo_type']);
     3129 if (isset($_POST['ammo_type']) && $_POST['ammo_type'] != '') $ammo_type = $sql->quote_smart($_POST['ammo_type']);
    31323130        else $ammo_type = 0;
    3133  if (isset($_POST['RangedModRange']) && $_POST['RangedModRange'] != '') $RangedModRange = $mysql->quote_smart($_POST['RangedModRange']);
     3131 if (isset($_POST['RangedModRange']) && $_POST['RangedModRange'] != '') $RangedModRange = $sql->quote_smart($_POST['RangedModRange']);
    31343132        else $RangedModRange = 0;
    3135  if (isset($_POST['spellid_1']) && $_POST['spellid_1'] != '') $spellid_1 = $mysql->quote_smart($_POST['spellid_1']);
     3133 if (isset($_POST['spellid_1']) && $_POST['spellid_1'] != '') $spellid_1 = $sql->quote_smart($_POST['spellid_1']);
    31363134        else $spellid_1 = 0;
    3137  if (isset($_POST['spelltrigger_1']) && $_POST['spelltrigger_1'] != '') $spelltrigger_1 = $mysql->quote_smart($_POST['spelltrigger_1']);
     3135 if (isset($_POST['spelltrigger_1']) && $_POST['spelltrigger_1'] != '') $spelltrigger_1 = $sql->quote_smart($_POST['spelltrigger_1']);
    31383136        else $spelltrigger_1 = 0;
    3139  if (isset($_POST['spellcharges_1']) && $_POST['spellcharges_1'] != '') $spellcharges_1 = $mysql->quote_smart($_POST['spellcharges_1']);
     3137 if (isset($_POST['spellcharges_1']) && $_POST['spellcharges_1'] != '') $spellcharges_1 = $sql->quote_smart($_POST['spellcharges_1']);
    31403138        else $spellcharges_1 = 0;
    3141  if (isset($_POST['spellcooldown_1']) && $_POST['spellcooldown_1'] != '') $spellcooldown_1 = $mysql->quote_smart($_POST['spellcooldown_1']);
     3139 if (isset($_POST['spellcooldown_1']) && $_POST['spellcooldown_1'] != '') $spellcooldown_1 = $sql->quote_smart($_POST['spellcooldown_1']);
    31423140        else $spellcooldown_1 = -1;
    3143  if (isset($_POST['spellcategory_1']) && $_POST['spellcategory_1'] != '') $spellcategory_1 = $mysql->quote_smart($_POST['spellcategory_1']);
     3141 if (isset($_POST['spellcategory_1']) && $_POST['spellcategory_1'] != '') $spellcategory_1 = $sql->quote_smart($_POST['spellcategory_1']);
    31443142        else $description = 0;
    3145  if (isset($_POST['spellcategorycooldown_1']) && $_POST['spellcategorycooldown_1'] != '') $spellcategorycooldown_1 = $mysql->quote_smart($_POST['spellcategorycooldown_1']);
     3143 if (isset($_POST['spellcategorycooldown_1']) && $_POST['spellcategorycooldown_1'] != '') $spellcategorycooldown_1 = $sql->quote_smart($_POST['spellcategorycooldown_1']);
    31463144        else $spellcategorycooldown_1 = -1;
    3147  if (isset($_POST['spellid_2']) && $_POST['spellid_2'] != '') $spellid_2 = $mysql->quote_smart($_POST['spellid_2']);
     3145 if (isset($_POST['spellid_2']) && $_POST['spellid_2'] != '') $spellid_2 = $sql->quote_smart($_POST['spellid_2']);
    31483146        else $spellid_2 = 0;
    3149  if (isset($_POST['spelltrigger_2']) && $_POST['spelltrigger_2'] != '') $spelltrigger_2 = $mysql->quote_smart($_POST['spelltrigger_2']);
     3147 if (isset($_POST['spelltrigger_2']) && $_POST['spelltrigger_2'] != '') $spelltrigger_2 = $sql->quote_smart($_POST['spelltrigger_2']);
    31503148        else $spelltrigger_2 = 0;
    3151  if (isset($_POST['spellcharges_2']) && $_POST['spellcharges_2'] != '') $spellcharges_2 = $mysql->quote_smart($_POST['spellcharges_2']);
     3149 if (isset($_POST['spellcharges_2']) && $_POST['spellcharges_2'] != '') $spellcharges_2 = $sql->quote_smart($_POST['spellcharges_2']);
    31523150        else $spellcharges_2 = 0;
    3153  if (isset($_POST['spellcooldown_2']) && $_POST['spellcooldown_2'] != '') $spellcooldown_2 = $mysql->quote_smart($_POST['spellcooldown_2']);
     3151 if (isset($_POST['spellcooldown_2']) && $_POST['spellcooldown_2'] != '') $spellcooldown_2 = $sql->quote_smart($_POST['spellcooldown_2']);
    31543152        else $spellcooldown_2 = -1;
    3155  if (isset($_POST['spellcategory_2']) && $_POST['spellcategory_2'] != '') $spellcategory_2 = $mysql->quote_smart($_POST['spellcategory_2']);
     3153 if (isset($_POST['spellcategory_2']) && $_POST['spellcategory_2'] != '') $spellcategory_2 = $sql->quote_smart($_POST['spellcategory_2']);
    31563154        else $spellcategory_2 = 0;
    3157  if (isset($_POST['spellcategorycooldown_2']) && $_POST['spellcategorycooldown_2'] != '') $spellcategorycooldown_2 = $mysql->quote_smart($_POST['spellcategorycooldown_2']);
     3155 if (isset($_POST['spellcategorycooldown_2']) && $_POST['spellcategorycooldown_2'] != '') $spellcategorycooldown_2 = $sql->quote_smart($_POST['spellcategorycooldown_2']);
    31583156        else $spellcategorycooldown_2 = -1;
    3159  if (isset($_POST['spellid_3']) && $_POST['spellid_3'] != '') $spellid_3 = $mysql->quote_smart($_POST['spellid_3']);
     3157 if (isset($_POST['spellid_3']) && $_POST['spellid_3'] != '') $spellid_3 = $sql->quote_smart($_POST['spellid_3']);
    31603158        else $spellid_3 = 0;
    3161  if (isset($_POST['spelltrigger_3']) && $_POST['spelltrigger_3'] != '') $spelltrigger_3 = $mysql->quote_smart($_POST['spelltrigger_3']);
     3159 if (isset($_POST['spelltrigger_3']) && $_POST['spelltrigger_3'] != '') $spelltrigger_3 = $sql->quote_smart($_POST['spelltrigger_3']);
    31623160        else $spelltrigger_3 = 0;
    3163  if (isset($_POST['spellcharges_3']) && $_POST['spellcharges_3'] != '') $spellcharges_3 = $mysql->quote_smart($_POST['spellcharges_3']);
     3161 if (isset($_POST['spellcharges_3']) && $_POST['spellcharges_3'] != '') $spellcharges_3 = $sql->quote_smart($_POST['spellcharges_3']);
    31643162        else $spellcharges_3 = 0;
    3165  if (isset($_POST['spellcooldown_3']) && $_POST['spellcooldown_3'] != '') $spellcooldown_3 = $mysql->quote_smart($_POST['spellcooldown_3']);
     3163 if (isset($_POST['spellcooldown_3']) && $_POST['spellcooldown_3'] != '') $spellcooldown_3 = $sql->quote_smart($_POST['spellcooldown_3']);
    31663164        else $spellcooldown_3 = -1;
    3167  if (isset($_POST['spellcategory_3']) && $_POST['spellcategory_3'] != '') $spellcategory_3 = $mysql->quote_smart($_POST['spellcategory_3']);
     3165 if (isset($_POST['spellcategory_3']) && $_POST['spellcategory_3'] != '') $spellcategory_3 = $sql->quote_smart($_POST['spellcategory_3']);
    31683166        else $description = 0;
    3169  if (isset($_POST['spellcategorycooldown_3']) && $_POST['spellcategorycooldown_3'] != '') $spellcategorycooldown_3 = $mysql->quote_smart($_POST['spellcategorycooldown_3']);
     3167 if (isset($_POST['spellcategorycooldown_3']) && $_POST['spellcategorycooldown_3'] != '') $spellcategorycooldown_3 = $sql->quote_smart($_POST['spellcategorycooldown_3']);
    31703168        else $spellcategorycooldown_3 = -1;
    3171  if (isset($_POST['spellid_4']) && $_POST['spellid_4'] != '') $spellid_4 = $mysql->quote_smart($_POST['spellid_4']);
     3169 if (isset($_POST['spellid_4']) && $_POST['spellid_4'] != '') $spellid_4 = $sql->quote_smart($_POST['spellid_4']);
    31723170        else $spellid_4 = 0;
    3173  if (isset($_POST['spelltrigger_4']) && $_POST['spelltrigger_4'] != '') $spelltrigger_4 = $mysql->quote_smart($_POST['spelltrigger_4']);
     3171 if (isset($_POST['spelltrigger_4']) && $_POST['spelltrigger_4'] != '') $spelltrigger_4 = $sql->quote_smart($_POST['spelltrigger_4']);
    31743172        else $spelltrigger_4 = 0;
    3175  if (isset($_POST['spellcharges_4']) && $_POST['spellcharges_4'] != '') $spellcharges_4 = $mysql->quote_smart($_POST['spellcharges_4']);
     3173 if (isset($_POST['spellcharges_4']) && $_POST['spellcharges_4'] != '') $spellcharges_4 = $sql->quote_smart($_POST['spellcharges_4']);
    31763174        else $spellcharges_4 = 0;
    3177  if (isset($_POST['spellcooldown_4']) && $_POST['spellcooldown_4'] != '') $spellcooldown_4 = $mysql->quote_smart($_POST['spellcooldown_4']);
     3175 if (isset($_POST['spellcooldown_4']) && $_POST['spellcooldown_4'] != '') $spellcooldown_4 = $sql->quote_smart($_POST['spellcooldown_4']);
    31783176        else $spellcooldown_4 = -1;
    3179  if (isset($_POST['spellcategory_4']) && $_POST['spellcategory_4'] != '') $spellcategory_4 = $mysql->quote_smart($_POST['spellcategory_4']);
     3177 if (isset($_POST['spellcategory_4']) && $_POST['spellcategory_4'] != '') $spellcategory_4 = $sql->quote_smart($_POST['spellcategory_4']);
    31803178        else $spellcategory_4 = 0;
    3181  if (isset($_POST['spellcategorycooldown_4']) && $_POST['spellcategorycooldown_4'] != '') $spellcategorycooldown_4 = $mysql->quote_smart($_POST['spellcategorycooldown_4']);
     3179 if (isset($_POST['spellcategorycooldown_4']) && $_POST['spellcategorycooldown_4'] != '') $spellcategorycooldown_4 = $sql->quote_smart($_POST['spellcategorycooldown_4']);
    31823180        else $spellcategorycooldown_4 = -1;
    3183  if (isset($_POST['spellid_5']) && $_POST['spellid_5'] != '') $spellid_5 = $mysql->quote_smart($_POST['spellid_5']);
     3181 if (isset($_POST['spellid_5']) && $_POST['spellid_5'] != '') $spellid_5 = $sql->quote_smart($_POST['spellid_5']);
    31843182        else $spellid_5 = 0;
    3185  if (isset($_POST['spelltrigger_5']) && $_POST['spelltrigger_5'] != '') $spelltrigger_5 = $mysql->quote_smart($_POST['spelltrigger_5']);
     3183 if (isset($_POST['spelltrigger_5']) && $_POST['spelltrigger_5'] != '') $spelltrigger_5 = $sql->quote_smart($_POST['spelltrigger_5']);
    31863184        else $spelltrigger_5 = 0;
    3187  if (isset($_POST['spellcharges_5']) && $_POST['spellcharges_5'] != '') $spellcharges_5 = $mysql->quote_smart($_POST['spellcharges_5']);
     3185 if (isset($_POST['spellcharges_5']) && $_POST['spellcharges_5'] != '') $spellcharges_5 = $sql->quote_smart($_POST['spellcharges_5']);
    31883186        else $spellcharges_5 = 0;
    3189  if (isset($_POST['spellcooldown_5']) && $_POST['spellcooldown_5'] != '') $spellcooldown_5 = $mysql->quote_smart($_POST['spellcooldown_5']);
     3187 if (isset($_POST['spellcooldown_5']) && $_POST['spellcooldown_5'] != '') $spellcooldown_5 = $sql->quote_smart($_POST['spellcooldown_5']);
    31903188        else $spellcooldown_5 = -1;
    3191  if (isset($_POST['spellcategory_5']) && $_POST['spellcategory_5'] != '') $spellcategory_5 = $mysql->quote_smart($_POST['spellcategory_5']);
     3189 if (isset($_POST['spellcategory_5']) && $_POST['spellcategory_5'] != '') $spellcategory_5 = $sql->quote_smart($_POST['spellcategory_5']);
    31923190        else $spellcategory_5 = 0;
    3193  if (isset($_POST['spellcategorycooldown_5']) && $_POST['spellcategorycooldown_5'] != '') $spellcategorycooldown_5 = $mysql->quote_smart($_POST['spellcategorycooldown_5']);
     3191 if (isset($_POST['spellcategorycooldown_5']) && $_POST['spellcategorycooldown_5'] != '') $spellcategorycooldown_5 = $sql->quote_smart($_POST['spellcategorycooldown_5']);
    31943192        else $spellcategorycooldown_5 = -1;
    3195  if (isset($_POST['bonding']) && $_POST['bonding'] != '') $bonding = $mysql->quote_smart($_POST['bonding']);
     3193 if (isset($_POST['bonding']) && $_POST['bonding'] != '') $bonding = $sql->quote_smart($_POST['bonding']);
    31963194        else $bonding = 0;
    3197  if (isset($_POST['description']) && $_POST['description'] != '') $description = $mysql->quote_smart($_POST['description']);
     3195 if (isset($_POST['description']) && $_POST['description'] != '') $description = $sql->quote_smart($_POST['description']);
    31983196        else $description = "";
    3199  if (isset($_POST['PageText']) && $_POST['PageText'] != '') $PageText = $mysql->quote_smart($_POST['PageText']);
     3197 if (isset($_POST['PageText']) && $_POST['PageText'] != '') $PageText = $sql->quote_smart($_POST['PageText']);
    32003198        else $PageText = 0;
    3201  if (isset($_POST['LanguageID']) && $_POST['LanguageID'] != '') $LanguageID = $mysql->quote_smart($_POST['LanguageID']);
     3199 if (isset($_POST['LanguageID']) && $_POST['LanguageID'] != '') $LanguageID = $sql->quote_smart($_POST['LanguageID']);
    32023200        else $LanguageID = 0;
    3203  if (isset($_POST['PageMaterial']) && $_POST['PageMaterial'] != '') $PageMaterial = $mysql->quote_smart($_POST['PageMaterial']);
     3201 if (isset($_POST['PageMaterial']) && $_POST['PageMaterial'] != '') $PageMaterial = $sql->quote_smart($_POST['PageMaterial']);
    32043202        else $PageMaterial = 0;
    3205  if (isset($_POST['startquest']) && $_POST['startquest'] != '') $startquest = $mysql->quote_smart($_POST['startquest']);
     3203 if (isset($_POST['startquest']) && $_POST['startquest'] != '') $startquest = $sql->quote_smart($_POST['startquest']);
    32063204        else $startquest = 0;
    3207  if (isset($_POST['lockid']) && $_POST['lockid'] != '') $lockid = $mysql->quote_smart($_POST['lockid']);
     3205 if (isset($_POST['lockid']) && $_POST['lockid'] != '') $lockid = $sql->quote_smart($_POST['lockid']);
    32083206        else $lockid = 0;
    3209  if (isset($_POST['Material']) && $_POST['Material'] != '') $Material = $mysql->quote_smart($_POST['Material']);
     3207 if (isset($_POST['Material']) && $_POST['Material'] != '') $Material = $sql->quote_smart($_POST['Material']);
    32103208        else $Material = 0;
    3211  if (isset($_POST['sheath']) && $_POST['sheath'] != '') $sheath = $mysql->quote_smart($_POST['sheath']);
     3209 if (isset($_POST['sheath']) && $_POST['sheath'] != '') $sheath = $sql->quote_smart($_POST['sheath']);
    32123210        else $sheath = 0;
    3213  if (isset($_POST['RandomProperty']) && $_POST['RandomProperty'] != '') $RandomProperty = $mysql->quote_smart($_POST['RandomProperty']);
     3211 if (isset($_POST['RandomProperty']) && $_POST['RandomProperty'] != '') $RandomProperty = $sql->quote_smart($_POST['RandomProperty']);
    32143212        else $RandomProperty = 0;
    3215  if (isset($_POST['block ']) && $_POST['block '] != '') $block = $mysql->quote_smart($_POST['block']);
     3213 if (isset($_POST['block ']) && $_POST['block '] != '') $block = $sql->quote_smart($_POST['block']);
    32163214        else $block  = 0;
    3217  if (isset($_POST['itemset']) && $_POST['itemset'] != '') $itemset = $mysql->quote_smart($_POST['itemset']);
     3215 if (isset($_POST['itemset']) && $_POST['itemset'] != '') $itemset = $sql->quote_smart($_POST['itemset']);
    32183216        else $itemset = 0;
    3219  if (isset($_POST['MaxDurability']) && $_POST['MaxDurability'] != '') $MaxDurability = $mysql->quote_smart($_POST['MaxDurability']);
     3217 if (isset($_POST['MaxDurability']) && $_POST['MaxDurability'] != '') $MaxDurability = $sql->quote_smart($_POST['MaxDurability']);
    32203218        else $MaxDurability = 0;
    3221  if (isset($_POST['area']) && $_POST['area'] != '') $area = $mysql->quote_smart($_POST['area']);
     3219 if (isset($_POST['area']) && $_POST['area'] != '') $area = $sql->quote_smart($_POST['area']);
    32223220        else $area = 0;
    3223  if (isset($_POST['BagFamily']) && $_POST['BagFamily'] != '') $BagFamily = $mysql->quote_smart($_POST['BagFamily']);
     3221 if (isset($_POST['BagFamily']) && $_POST['BagFamily'] != '') $BagFamily = $sql->quote_smart($_POST['BagFamily']);
    32243222        else $BagFamily = 0;
    3225  if (isset($_POST['Map']) && $_POST['Map'] != '') $Map = $mysql->quote_smart($_POST['Map']);
     3223 if (isset($_POST['Map']) && $_POST['Map'] != '') $Map = $sql->quote_smart($_POST['Map']);
    32263224        else $Map = 0;
    3227  if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $mysql->quote_smart($_POST['ScriptName']);
     3225 if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $sql->quote_smart($_POST['ScriptName']);
    32283226        else $ScriptName = 0;
    3229  if (isset($_POST['DisenchantID']) && $_POST['DisenchantID'] != '') $DisenchantID = $mysql->quote_smart($_POST['DisenchantID']);
     3227 if (isset($_POST['DisenchantID']) && $_POST['DisenchantID'] != '') $DisenchantID = $sql->quote_smart($_POST['DisenchantID']);
    32303228        else $DisenchantID = 0;
    3231  if (isset($_POST['RequiredDisenchantSkill']) && $_POST['RequiredDisenchantSkill'] != '') $RequiredDisenchantSkill = $mysql->quote_smart($_POST['RequiredDisenchantSkill']);
     3229 if (isset($_POST['RequiredDisenchantSkill']) && $_POST['RequiredDisenchantSkill'] != '') $RequiredDisenchantSkill = $sql->quote_smart($_POST['RequiredDisenchantSkill']);
    32323230        else $RequiredDisenchantSkill = -1;
    3233  if (isset($_POST['unk0']) && $_POST['unk0'] != '') $unk0 = $mysql->quote_smart($_POST['unk0']);
     3231 if (isset($_POST['unk0']) && $_POST['unk0'] != '') $unk0 = $sql->quote_smart($_POST['unk0']);
    32343232        else $unk0 = -1;
    3235  if (isset($_POST['RandomSuffix']) && $_POST['RandomSuffix'] != '') $RandomSuffix = $mysql->quote_smart($_POST['RandomSuffix']);
     3233 if (isset($_POST['RandomSuffix']) && $_POST['RandomSuffix'] != '') $RandomSuffix = $sql->quote_smart($_POST['RandomSuffix']);
    32363234        else $RandomSuffix = 0;
    3237  if (isset($_POST['TotemCategory']) && $_POST['TotemCategory'] != '') $TotemCategory = $mysql->quote_smart($_POST['TotemCategory']);
     3235 if (isset($_POST['TotemCategory']) && $_POST['TotemCategory'] != '') $TotemCategory = $sql->quote_smart($_POST['TotemCategory']);
    32383236        else $TotemCategory = 0;
    3239  if (isset($_POST['socketColor_1']) && $_POST['socketColor_1'] != '') $socketColor_1 = $mysql->quote_smart($_POST['socketColor_1']);
     3237 if (isset($_POST['socketColor_1']) && $_POST['socketColor_1'] != '') $socketColor_1 = $sql->quote_smart($_POST['socketColor_1']);
    32403238        else $socketColor_1 = 0;
    3241  if (isset($_POST['socketContent_1']) && $_POST['socketContent_1'] != '') $socketContent_1 = $mysql->quote_smart($_POST['socketContent_1']);
     3239 if (isset($_POST['socketContent_1']) && $_POST['socketContent_1'] != '') $socketContent_1 = $sql->quote_smart($_POST['socketContent_1']);
    32423240        else $socketContent_1 = 0;
    3243  if (isset($_POST['socketColor_2']) && $_POST['socketColor_2'] != '') $socketColor_2 = $mysql->quote_smart($_POST['socketColor_2']);
     3241 if (isset($_POST['socketColor_2']) && $_POST['socketColor_2'] != '') $socketColor_2 = $sql->quote_smart($_POST['socketColor_2']);
    32443242        else $socketColor_2 = 0;
    3245  if (isset($_POST['socketContent_2']) && $_POST['socketContent_2'] != '') $socketContent_2 = $mysql->quote_smart($_POST['socketContent_2']);
     3243 if (isset($_POST['socketContent_2']) && $_POST['socketContent_2'] != '') $socketContent_2 = $sql->quote_smart($_POST['socketContent_2']);
    32463244        else $socketContent_2 = 0;
    3247  if (isset($_POST['socketColor_3']) && $_POST['socketColor_3'] != '') $socketColor_3 = $mysql->quote_smart($_POST['socketColor_3']);
     3245 if (isset($_POST['socketColor_3']) && $_POST['socketColor_3'] != '') $socketColor_3 = $sql->quote_smart($_POST['socketColor_3']);
    32483246        else $socketColor_3 = 0;
    3249  if (isset($_POST['socketContent_3']) && $_POST['socketContent_3'] != '') $socketContent_3 = $mysql->quote_smart($_POST['socketContent_3']);
     3247 if (isset($_POST['socketContent_3']) && $_POST['socketContent_3'] != '') $socketContent_3 = $sql->quote_smart($_POST['socketContent_3']);
    32503248        else $socketContent_3 = 0;
    3251  if (isset($_POST['socketBonus']) && $_POST['socketBonus'] != '') $socketBonus = $mysql->quote_smart($_POST['socketBonus']);
     3249 if (isset($_POST['socketBonus']) && $_POST['socketBonus'] != '') $socketBonus = $sql->quote_smart($_POST['socketBonus']);
    32523250        else $socketBonus = 0;
    3253  if (isset($_POST['GemProperties']) && $_POST['GemProperties'] != '') $GemProperties = $mysql->quote_smart($_POST['GemProperties']);
     3251 if (isset($_POST['GemProperties']) && $_POST['GemProperties'] != '') $GemProperties = $sql->quote_smart($_POST['GemProperties']);
    32543252        else $GemProperties = 0;
    3255  if (isset($_POST['ExtendedCost']) && $_POST['ExtendedCost'] != '') $ExtendedCost = $mysql->quote_smart($_POST['ExtendedCost']);
     3253 if (isset($_POST['ExtendedCost']) && $_POST['ExtendedCost'] != '') $ExtendedCost = $sql->quote_smart($_POST['ExtendedCost']);
    32563254        else $ExtendedCost = 0;
    3257  if (isset($_POST['ArmorDamageModifier']) && $_POST['ArmorDamageModifier'] != '') $ArmorDamageModifier = $mysql->quote_smart($_POST['ArmorDamageModifier']);
     3255 if (isset($_POST['ArmorDamageModifier']) && $_POST['ArmorDamageModifier'] != '') $ArmorDamageModifier = $sql->quote_smart($_POST['ArmorDamageModifier']);
    32583256        else $ArmorDamageModifier = 0;
    32593257
    3260         if (isset($_POST['de_ChanceOrRef']) && $_POST['de_ChanceOrRef'] != '') $de_ChanceOrRef = $mysql->quote_smart($_POST['de_ChanceOrRef']);
     3258        if (isset($_POST['de_ChanceOrRef']) && $_POST['de_ChanceOrRef'] != '') $de_ChanceOrRef = $sql->quote_smart($_POST['de_ChanceOrRef']);
    32613259                else $de_ChanceOrRef = 0;
    3262         if (isset($_POST['de_QuestChanceOrGroup']) && $_POST['de_QuestChanceOrGroup'] != '') $de_QuestChanceOrGroup = $mysql->quote_smart($_POST['de_QuestChanceOrGroup']);
     3260        if (isset($_POST['de_QuestChanceOrGroup']) && $_POST['de_QuestChanceOrGroup'] != '') $de_QuestChanceOrGroup = $sql->quote_smart($_POST['de_QuestChanceOrGroup']);
    32633261                else $de_QuestChanceOrGroup = 0;
    3264         if (isset($_POST['de_mincount']) && $_POST['de_mincount'] != '') $de_mincount = $mysql->quote_smart($_POST['de_mincount']);
     3262        if (isset($_POST['de_mincount']) && $_POST['de_mincount'] != '') $de_mincount = $sql->quote_smart($_POST['de_mincount']);
    32653263                else $de_mincount = 0;
    3266         if (isset($_POST['de_maxcount']) && $_POST['de_maxcount'] != '') $de_maxcount = $mysql->quote_smart($_POST['de_maxcount']);
     3264        if (isset($_POST['de_maxcount']) && $_POST['de_maxcount'] != '') $de_maxcount = $sql->quote_smart($_POST['de_maxcount']);
    32673265                else $de_maxcount = 0;
    3268         if (isset($_POST['de_quest_freeforall']) && $_POST['de_quest_freeforall'] != '') $de_quest_freeforall = $mysql->quote_smart($_POST['de_quest_freeforall']);
     3266        if (isset($_POST['de_quest_freeforall']) && $_POST['de_quest_freeforall'] != '') $de_quest_freeforall = $sql->quote_smart($_POST['de_quest_freeforall']);
    32693267                else $de_quest_freeforall = 0;
    3270         if (isset($_POST['de_item']) && $_POST['de_item'] != '') $de_item = $mysql->quote_smart($_POST['de_item']);
     3268        if (isset($_POST['de_item']) && $_POST['de_item'] != '') $de_item = $sql->quote_smart($_POST['de_item']);
    32713269                else $de_item = 0;
    3272         if (isset($_POST['del_de_items']) && $_POST['del_de_items'] != '') $del_de_items = $mysql->quote_smart($_POST['del_de_items']);
     3270        if (isset($_POST['del_de_items']) && $_POST['del_de_items'] != '') $del_de_items = $sql->quote_smart($_POST['del_de_items']);
    32733271                else $del_de_items = NULL;
    32743272
     
    33123310
    33133311  if ($_POST['type'] == "add_new"){
    3314         $sql = "INSERT INTO item_template (entry, class, subclass, name, name2, name3, name4, displayid, Quality, Flags, BuyCount, BuyPrice, SellPrice, InventoryType, AllowableClass, AllowableRace, ItemLevel,
     3312        $sql_query = "INSERT INTO item_template (entry, class, subclass, name,displayid, Quality, Flags, BuyCount, BuyPrice, SellPrice, InventoryType, AllowableClass, AllowableRace, ItemLevel,
    33153313        RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, maxcount, stackable, ContainerSlots, stat_type1,
    33163314        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,
     
    33213319        bonding, description, PageText, LanguageID, PageMaterial, startquest, lockid, Material, sheath, RandomProperty, block, itemset, MaxDurability, area, BagFamily, Map, ScriptName, DisenchantID,RequiredDisenchantSkill,
    33223320        ArmorDamageModifier,unk0,RandomSuffix,TotemCategory, socketColor_1, socketContent_1, socketColor_2, socketContent_2, socketColor_3, socketContent_3, socketBonus, GemProperties, ExtendedCost)
    3323         VALUES ('$entry', '$class', '$subclass', '$name', '$name2', '$name3', '$name4', '$displayid', '$Quality', '$Flags', '$BuyCount', '$BuyPrice', '$SellPrice', '$InventoryType', '$AllowableClass', '$AllowableRace', '$ItemLevel', '$RequiredLevel',
     3321        VALUES ('$entry', '$class', '$subclass', '$name','$displayid', '$Quality', '$Flags', '$BuyCount', '$BuyPrice', '$SellPrice', '$InventoryType', '$AllowableClass', '$AllowableRace', '$ItemLevel', '$RequiredLevel',
    33243322        '$RequiredSkill', '$RequiredSkillRank', '$requiredspell', '$requiredhonorrank', '$RequiredCityRank', '$RequiredReputationFaction', '$RequiredReputationRank', '$maxcount', '$stackable', '$ContainerSlots', '$stat_type1',
    33253323        '$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',
     
    33343332 } elseif ($_POST['type'] == "edit"){
    33353333
    3336         $sql = "UPDATE item_template SET  ";
    3337  
    3338         $result = $mysql->query("SELECT * FROM item_template WHERE entry = '$entry'");
    3339         if ($item_templ = $mysql->fetch_assoc($result)){
    3340  
    3341                 if ($item_templ['class'] != $class) $sql .= "class='$class',";
    3342                 if ($item_templ['subclass'] != $subclass) $sql .= "subclass='$subclass',";
    3343                 if ($item_templ['name'] != $name) $sql .= "name='$name',";
    3344                 if ($item_templ['displayid'] != $displayid) $sql .= "displayid='$displayid',";
    3345                 if ($item_templ['Quality'] != $Quality) $sql .= "Quality='$Quality',";
    3346                 if ($item_templ['Flags'] != $Flags) $sql .= "Flags='$Flags',";
    3347                 if ($item_templ['BuyCount'] != $BuyCount) $sql .= "BuyCount='$BuyCount',";
    3348                 if ($item_templ['BuyPrice'] != $BuyPrice) $sql .= "BuyPrice='$BuyPrice',";
    3349                 if ($item_templ['SellPrice'] != $SellPrice) $sql .= "SellPrice='$SellPrice',";
    3350                 if ($item_templ['InventoryType'] != $InventoryType) $sql .= "InventoryType='$InventoryType',";
    3351                 if ($item_templ['AllowableClass'] != $AllowableClass) $sql .= "AllowableClass='$AllowableClass',";
    3352                 if ($item_templ['AllowableRace'] != $AllowableRace) $sql .= "AllowableRace='$AllowableRace',";
    3353                 if ($item_templ['ItemLevel'] != $ItemLevel) $sql .= "ItemLevel='$ItemLevel',";
    3354                 if ($item_templ['RequiredLevel'] != $RequiredLevel) $sql .= "RequiredLevel='$RequiredLevel',";
    3355                 if ($item_templ['RequiredSkill'] != $RequiredSkill) $sql .= "RequiredSkill='$RequiredSkill',";
    3356                 if ($item_templ['RequiredSkillRank'] != $RequiredSkillRank) $sql .= "RequiredSkillRank='$RequiredSkillRank',";
    3357                 if ($item_templ['requiredspell'] != $requiredspell) $sql .= "requiredspell='$requiredspell',";
    3358                 if ($item_templ['requiredhonorrank'] != $requiredhonorrank) $sql .= "requiredhonorrank='$requiredhonorrank',";
    3359                 if ($item_templ['RequiredCityRank'] != $RequiredCityRank) $sql .= "RequiredCityRank='$RequiredCityRank',";
    3360                 if ($item_templ['RequiredReputationFaction'] != $RequiredReputationFaction) $sql .= "RequiredReputationFaction='$RequiredReputationFaction',";
    3361                 if ($item_templ['RequiredReputationRank'] != $RequiredReputationRank) $sql .= "RequiredReputationRank='$RequiredReputationRank',";
    3362                 if ($item_templ['maxcount'] != $maxcount) $sql .= "maxcount='$maxcount',";
    3363                 if ($item_templ['stackable'] != $stackable) $sql .= "stackable='$stackable',";
    3364                 if ($item_templ['ContainerSlots'] != $ContainerSlots) $sql .= "ContainerSlots='$ContainerSlots',";
    3365                 if ($item_templ['stat_type1'] != $stat_type1) $sql .= "stat_type1='$stat_type1',";
    3366                 if ($item_templ['stat_value1'] != $stat_value1) $sql .= "stat_value1='$stat_value1',";
    3367                 if ($item_templ['stat_type2'] != $stat_type2) $sql .= "stat_type2='$stat_type2',";
    3368                 if ($item_templ['stat_value2'] != $stat_value2) $sql .= "stat_value2='$stat_value2',";
    3369                 if ($item_templ['stat_type3'] != $stat_type3) $sql .= "stat_type3='$stat_type3',";
    3370                 if ($item_templ['stat_value3'] != $stat_value3) $sql .= "stat_value3='$stat_value3',";
    3371                 if ($item_templ['stat_type4'] != $stat_type4) $sql .= "stat_type4='$stat_type4',";
    3372                 if ($item_templ['stat_value4'] != $stat_value4) $sql .= "stat_value4='$stat_value4',";
    3373                 if ($item_templ['stat_type5'] != $stat_type5) $sql .= "stat_type5='$stat_type5',";
    3374                 if ($item_templ['stat_value5'] != $stat_value5) $sql .= "stat_value5='$stat_value5',";
    3375                 if ($item_templ['stat_type6'] != $stat_type6) $sql .= "stat_type6='$stat_type6',";
    3376                 if ($item_templ['stat_value6'] != $stat_value6) $sql .= "stat_value6='$stat_value6',";
    3377                 if ($item_templ['stat_type7'] != $stat_type7) $sql .= "stat_type7='$stat_type7',";
    3378                 if ($item_templ['stat_value7'] != $stat_value7) $sql .= "stat_value7='$stat_value7',";
    3379                 if ($item_templ['stat_type8'] != $stat_type8) $sql .= "stat_type8='$stat_type8',";
    3380                 if ($item_templ['stat_value8'] != $stat_value8) $sql .= "stat_value8='$stat_value8',";
    3381                 if ($item_templ['stat_type9'] != $stat_type9) $sql .= "stat_type9='$stat_type9',";
    3382                 if ($item_templ['stat_value9'] != $stat_value9) $sql .= "stat_value9='$stat_value9',";
    3383                 if ($item_templ['stat_type10'] != $stat_type10) $sql .= "stat_type10='$stat_type10',";
    3384                 if ($item_templ['stat_value10'] != $stat_value10) $sql .= "stat_value10='$stat_value10',";
    3385                 if ($item_templ['dmg_min1'] != $dmg_min1) $sql .= "dmg_min1='$dmg_min1',";
    3386                 if ($item_templ['dmg_max1'] != $dmg_max1) $sql .= "dmg_max1='$dmg_max1',";
    3387                 if ($item_templ['dmg_type1'] != $dmg_type1) $sql .= "dmg_type1='$dmg_type1',";
    3388                 if ($item_templ['dmg_min2'] != $dmg_min2) $sql .= "dmg_min2='$dmg_min2',";
    3389                 if ($item_templ['dmg_max2'] != $dmg_max2) $sql .= "dmg_max2='$dmg_max2',";
    3390                 if ($item_templ['dmg_type2'] != $dmg_type2) $sql .= "dmg_type2='$dmg_type2',";
    3391                 if ($item_templ['dmg_min3'] != $dmg_min3) $sql .= "dmg_min3='$dmg_min3',";
    3392                 if ($item_templ['dmg_max3'] != $dmg_max3) $sql .= "dmg_max3='$dmg_max3',";
    3393                 if ($item_templ['dmg_type3'] != $dmg_type3) $sql .= "dmg_type3='$dmg_type3',";
    3394                 if ($item_templ['dmg_min4'] != $dmg_min4) $sql .= "dmg_min4='$dmg_min4',";
    3395                 if ($item_templ['dmg_max4'] != $dmg_max4) $sql .= "dmg_max4='$dmg_max4',";
    3396                 if ($item_templ['dmg_type4'] != $dmg_type4) $sql .= "dmg_type4='$dmg_type4',";
    3397                 if ($item_templ['dmg_min5'] != $dmg_min5) $sql .= "dmg_min5='$dmg_min5',";
    3398                 if ($item_templ['dmg_max5'] != $dmg_max5) $sql .= "dmg_max5='$dmg_max5',";
    3399                 if ($item_templ['dmg_type5'] != $dmg_type5) $sql .= "dmg_type5='$dmg_type5',";
    3400                 if ($item_templ['armor'] != $armor) $sql .= "armor='$armor',";
    3401                 if ($item_templ['holy_res'] != $holy_res) $sql .= "holy_res='$holy_res',";
    3402                 if ($item_templ['fire_res'] != $fire_res) $sql .= "fire_res='$fire_res',";
    3403                 if ($item_templ['nature_res'] != $nature_res) $sql .= "nature_res='$nature_res',";
    3404                 if ($item_templ['frost_res'] != $frost_res) $sql .= "frost_res='$frost_res',";
    3405                 if ($item_templ['shadow_res'] != $shadow_res) $sql .= "shadow_res='$shadow_res',";             
    3406                 if ($item_templ['arcane_res'] != $arcane_res) $sql .= "arcane_res='$arcane_res',";
    3407                 if ($item_templ['delay'] != $delay) $sql .= "delay='$delay',";
    3408                 if ($item_templ['ammo_type'] != $ammo_type) $sql .= "ammo_type='$ammo_type',";
    3409                 if ($item_templ['RangedModRange'] != $RangedModRange) $sql .= "RangedModRange='$RangedModRange',";
    3410                 if ($item_templ['spellid_1'] != $spellid_1) $sql .= "spellid_1='$spellid_1',";
    3411                 if ($item_templ['spelltrigger_1'] != $spelltrigger_1) $sql .= "spelltrigger_1='$spelltrigger_1',";
    3412                 if ($item_templ['spellcharges_1'] != $spellcharges_1) $sql .= "spellcharges_1='$spellcharges_1',";
    3413                 if ($item_templ['spellcooldown_1'] != $spellcooldown_1) $sql .= "spellcooldown_1='$spellcooldown_1',";
    3414                 if ($item_templ['spellcategory_1'] != $spellcategory_1) $sql .= "spellcategory_1='$spellcategory_1',";
    3415                 if ($item_templ['spellcategorycooldown_1'] != $spellcategorycooldown_1) $sql .= "spellcategorycooldown_1='$spellcategorycooldown_1',"; 
    3416                 if ($item_templ['spellid_2'] != $spellid_2) $sql .= "spellid_2='$spellid_2',"; 
    3417                 if ($item_templ['spelltrigger_2'] != $spelltrigger_2) $sql .= "spelltrigger_2='$spelltrigger_2',";
    3418                 if ($item_templ['spellcharges_2'] != $spellcharges_2) $sql .= "spellcharges_2='$spellcharges_2',";
    3419                 if ($item_templ['spellcooldown_2'] != $spellcooldown_2) $sql .= "spellcooldown_2='$spellcooldown_2',";
    3420                 if ($item_templ['spellcategory_2'] != $spellcategory_2) $sql .= "spellcategory_2='$spellcategory_2',";
    3421                 if ($item_templ['spellcategorycooldown_2'] != $spellcategorycooldown_2) $sql .= "spellcategorycooldown_2='$spellcategorycooldown_2',";
    3422                 if ($item_templ['spellid_3'] != $spellid_3) $sql .= "spellid_3='$spellid_3',";
    3423                 if ($item_templ['spelltrigger_3'] != $spelltrigger_3) $sql .= "spelltrigger_3='$spelltrigger_3',";
    3424                 if ($item_templ['spellcharges_3'] != $spellcharges_3) $sql .= "spellcharges_3='$spellcharges_3',";
    3425                 if ($item_templ['spellcooldown_3'] != $spellcooldown_3) $sql .= "spellcooldown_3='$spellcooldown_3',";
    3426                 if ($item_templ['spellcategory_3'] != $spellcategory_3) $sql .= "spellcategory_3='$spellcategory_3',";
    3427                 if ($item_templ['spellcategorycooldown_3'] != $spellcategorycooldown_3) $sql .= "spellcategorycooldown_3='$spellcategorycooldown_3',"; 
     3334        $sql_query = "UPDATE item_template SET  ";
     3335 
     3336        $result = $sql->query("SELECT * FROM item_template WHERE entry = '$entry'");
     3337        if ($item_templ = $sql->fetch_assoc($result)){
     3338 
     3339                if ($item_templ['class'] != $class) $sql_query .= "class='$class',";
     3340                if ($item_templ['subclass'] != $subclass) $sql_query .= "subclass='$subclass',";
     3341                if ($item_templ['name'] != $name) $sql_query .= "name='$name',";
     3342                if ($item_templ['displayid'] != $displayid) $sql_query .= "displayid='$displayid',";
     3343                if ($item_templ['Quality'] != $Quality) $sql_query .= "Quality='$Quality',";
     3344                if ($item_templ['Flags'] != $Flags) $sql_query .= "Flags='$Flags',";
     3345                if ($item_templ['BuyCount'] != $BuyCount) $sql_query .= "BuyCount='$BuyCount',";
     3346                if ($item_templ['BuyPrice'] != $BuyPrice) $sql_query .= "BuyPrice='$BuyPrice',";
     3347                if ($item_templ['SellPrice'] != $SellPrice) $sql_query .= "SellPrice='$SellPrice',";
     3348                if ($item_templ['InventoryType'] != $InventoryType) $sql_query .= "InventoryType='$InventoryType',";
     3349                if ($item_templ['AllowableClass'] != $AllowableClass) $sql_query .= "AllowableClass='$AllowableClass',";
     3350                if ($item_templ['AllowableRace'] != $AllowableRace) $sql_query .= "AllowableRace='$AllowableRace',";
     3351                if ($item_templ['ItemLevel'] != $ItemLevel) $sql_query .= "ItemLevel='$ItemLevel',";
     3352                if ($item_templ['RequiredLevel'] != $RequiredLevel) $sql_query .= "RequiredLevel='$RequiredLevel',";
     3353                if ($item_templ['RequiredSkill'] != $RequiredSkill) $sql_query .= "RequiredSkill='$RequiredSkill',";
     3354                if ($item_templ['RequiredSkillRank'] != $RequiredSkillRank) $sql_query .= "RequiredSkillRank='$RequiredSkillRank',";
     3355                if ($item_templ['requiredspell'] != $requiredspell) $sql_query .= "requiredspell='$requiredspell',";
     3356                if ($item_templ['requiredhonorrank'] != $requiredhonorrank) $sql_query .= "requiredhonorrank='$requiredhonorrank',";
     3357                if ($item_templ['RequiredCityRank'] != $RequiredCityRank) $sql_query .= "RequiredCityRank='$RequiredCityRank',";
     3358                if ($item_templ['RequiredReputationFaction'] != $RequiredReputationFaction) $sql_query .= "RequiredReputationFaction='$RequiredReputationFaction',";
     3359                if ($item_templ['RequiredReputationRank'] != $RequiredReputationRank) $sql_query .= "RequiredReputationRank='$RequiredReputationRank',";
     3360                if ($item_templ['maxcount'] != $maxcount) $sql_query .= "maxcount='$maxcount',";
     3361                if ($item_templ['stackable'] != $stackable) $sql_query .= "stackable='$stackable',";
     3362                if ($item_templ['ContainerSlots'] != $ContainerSlots) $sql_query .= "ContainerSlots='$ContainerSlots',";
     3363                if ($item_templ['stat_type1'] != $stat_type1) $sql_query .= "stat_type1='$stat_type1',";
     3364                if ($item_templ['stat_value1'] != $stat_value1) $sql_query .= "stat_value1='$stat_value1',";
     3365                if ($item_templ['stat_type2'] != $stat_type2) $sql_query .= "stat_type2='$stat_type2',";
     3366                if ($item_templ['stat_value2'] != $stat_value2) $sql_query .= "stat_value2='$stat_value2',";
     3367                if ($item_templ['stat_type3'] != $stat_type3) $sql_query .= "stat_type3='$stat_type3',";
     3368                if ($item_templ['stat_value3'] != $stat_value3) $sql_query .= "stat_value3='$stat_value3',";
     3369                if ($item_templ['stat_type4'] != $stat_type4) $sql_query .= "stat_type4='$stat_type4',";
     3370                if ($item_templ['stat_value4'] != $stat_value4) $sql_query .= "stat_value4='$stat_value4',";
     3371                if ($item_templ['stat_type5'] != $stat_type5) $sql_query .= "stat_type5='$stat_type5',";
     3372                if ($item_templ['stat_value5'] != $stat_value5) $sql_query .= "stat_value5='$stat_value5',";
     3373                if ($item_templ['stat_type6'] != $stat_type6) $sql_query .= "stat_type6='$stat_type6',";
     3374                if ($item_templ['stat_value6'] != $stat_value6) $sql_query .= "stat_value6='$stat_value6',";
     3375                if ($item_templ['stat_type7'] != $stat_type7) $sql_query .= "stat_type7='$stat_type7',";
     3376                if ($item_templ['stat_value7'] != $stat_value7) $sql_query .= "stat_value7='$stat_value7',";
     3377                if ($item_templ['stat_type8'] != $stat_type8) $sql_query .= "stat_type8='$stat_type8',";
     3378                if ($item_templ['stat_value8'] != $stat_value8) $sql_query .= "stat_value8='$stat_value8',";
     3379                if ($item_templ['stat_type9'] != $stat_type9) $sql_query .= "stat_type9='$stat_type9',";
     3380                if ($item_templ['stat_value9'] != $stat_value9) $sql_query .= "stat_value9='$stat_value9',";
     3381                if ($item_templ['stat_type10'] != $stat_type10) $sql_query .= "stat_type10='$stat_type10',";
     3382                if ($item_templ['stat_value10'] != $stat_value10) $sql_query .= "stat_value10='$stat_value10',";
     3383                if ($item_templ['dmg_min1'] != $dmg_min1) $sql_query .= "dmg_min1='$dmg_min1',";
     3384                if ($item_templ['dmg_max1'] != $dmg_max1) $sql_query .= "dmg_max1='$dmg_max1',";
     3385                if ($item_templ['dmg_type1'] != $dmg_type1) $sql_query .= "dmg_type1='$dmg_type1',";
     3386                if ($item_templ['dmg_min2'] != $dmg_min2) $sql_query .= "dmg_min2='$dmg_min2',";
     3387                if ($item_templ['dmg_max2'] != $dmg_max2) $sql_query .= "dmg_max2='$dmg_max2',";
     3388                if ($item_templ['dmg_type2'] != $dmg_type2) $sql_query .= "dmg_type2='$dmg_type2',";
     3389                if ($item_templ['dmg_min3'] != $dmg_min3) $sql_query .= "dmg_min3='$dmg_min3',";
     3390                if ($item_templ['dmg_max3'] != $dmg_max3) $sql_query .= "dmg_max3='$dmg_max3',";
     3391                if ($item_templ['dmg_type3'] != $dmg_type3) $sql_query .= "dmg_type3='$dmg_type3',";
     3392                if ($item_templ['dmg_min4'] != $dmg_min4) $sql_query .= "dmg_min4='$dmg_min4',";
     3393                if ($item_templ['dmg_max4'] != $dmg_max4) $sql_query .= "dmg_max4='$dmg_max4',";
     3394                if ($item_templ['dmg_type4'] != $dmg_type4) $sql_query .= "dmg_type4='$dmg_type4',";
     3395                if ($item_templ['dmg_min5'] != $dmg_min5) $sql_query .= "dmg_min5='$dmg_min5',";
     3396                if ($item_templ['dmg_max5'] != $dmg_max5) $sql_query .= "dmg_max5='$dmg_max5',";
     3397                if ($item_templ['dmg_type5'] != $dmg_type5) $sql_query .= "dmg_type5='$dmg_type5',";
     3398                if ($item_templ['armor'] != $armor) $sql_query .= "armor='$armor',";
     3399                if ($item_templ['holy_res'] != $holy_res) $sql_query .= "holy_res='$holy_res',";
     3400                if ($item_templ['fire_res'] != $fire_res) $sql_query .= "fire_res='$fire_res',";
     3401                if ($item_templ['nature_res'] != $nature_res) $sql_query .= "nature_res='$nature_res',";
     3402                if ($item_templ['frost_res'] != $frost_res) $sql_query .= "frost_res='$frost_res',";
     3403                if ($item_templ['shadow_res'] != $shadow_res) $sql_query .= "shadow_res='$shadow_res',";               
     3404                if ($item_templ['arcane_res'] != $arcane_res) $sql_query .= "arcane_res='$arcane_res',";
     3405                if ($item_templ['delay'] != $delay) $sql_query .= "delay='$delay',";
     3406                if ($item_templ['ammo_type'] != $ammo_type) $sql_query .= "ammo_type='$ammo_type',";
     3407                if ($item_templ['RangedModRange'] != $RangedModRange) $sql_query .= "RangedModRange='$RangedModRange',";
     3408                if ($item_templ['spellid_1'] != $spellid_1) $sql_query .= "spellid_1='$spellid_1',";
     3409                if ($item_templ['spelltrigger_1'] != $spelltrigger_1) $sql_query .= "spelltrigger_1='$spelltrigger_1',";
     3410                if ($item_templ['spellcharges_1'] != $spellcharges_1) $sql_query .= "spellcharges_1='$spellcharges_1',";
     3411                if ($item_templ['spellcooldown_1'] != $spellcooldown_1) $sql_query .= "spellcooldown_1='$spellcooldown_1',";
     3412                if ($item_templ['spellcategory_1'] != $spellcategory_1) $sql_query .= "spellcategory_1='$spellcategory_1',";
     3413                if ($item_templ['spellcategorycooldown_1'] != $spellcategorycooldown_1) $sql_query .= "spellcategorycooldown_1='$spellcategorycooldown_1',";   
     3414                if ($item_templ['spellid_2'] != $spellid_2) $sql_query .= "spellid_2='$spellid_2',";   
     3415                if ($item_templ['spelltrigger_2'] != $spelltrigger_2) $sql_query .= "spelltrigger_2='$spelltrigger_2',";
     3416                if ($item_templ['spellcharges_2'] != $spellcharges_2) $sql_query .= "spellcharges_2='$spellcharges_2',";
     3417                if ($item_templ['spellcooldown_2'] != $spellcooldown_2) $sql_query .= "spellcooldown_2='$spellcooldown_2',";
     3418                if ($item_templ['spellcategory_2'] != $spellcategory_2) $sql_query .= "spellcategory_2='$spellcategory_2',";
     3419                if ($item_templ['spellcategorycooldown_2'] != $spellcategorycooldown_2) $sql_query .= "spellcategorycooldown_2='$spellcategorycooldown_2',";
     3420                if ($item_templ['spellid_3'] != $spellid_3) $sql_query .= "spellid_3='$spellid_3',";
     3421                if ($item_templ['spelltrigger_3'] != $spelltrigger_3) $sql_query .= "spelltrigger_3='$spelltrigger_3',";
     3422                if ($item_templ['spellcharges_3'] != $spellcharges_3) $sql_query .= "spellcharges_3='$spellcharges_3',";
     3423                if ($item_templ['spellcooldown_3'] != $spellcooldown_3) $sql_query .= "spellcooldown_3='$spellcooldown_3',";
     3424                if ($item_templ['spellcategory_3'] != $spellcategory_3) $sql_query .= "spellcategory_3='$spellcategory_3',";
     3425                if ($item_templ['spellcategorycooldown_3'] != $spellcategorycooldown_3) $sql_query .= "spellcategorycooldown_3='$spellcategorycooldown_3',";   
    34283426                if ($item_templ['spellid_4'] != $spellid_4) $sql .= "spellid_4='$spellid_4',";
    3429                 if ($item_templ['spelltrigger_4'] != $spelltrigger_4) $sql .= "spelltrigger_4='$spelltrigger_4',";
    3430                 if ($item_templ['spellcharges_4'] != $spellcharges_4) $sql .= "spellcharges_4='$spellcharges_4',";
    3431                 if ($item_templ['spellcooldown_4'] != $spellcooldown_4) $sql .= "spellcooldown_4='$spellcooldown_4',";
    3432                 if ($item_templ['spellcategory_4'] != $spellcategory_4) $sql .= "spellcategory_4='$spellcategory_4',";
    3433                 if ($item_templ['spellcategorycooldown_4'] != $spellcategorycooldown_4) $sql .= "spellcategorycooldown_4='$spellcategorycooldown_4', ";
    3434                 if ($item_templ['spellid_5'] != $spellid_5) $sql .= "spellid_5='$spellid_5',";
    3435                 if ($item_templ['spelltrigger_5'] != $spelltrigger_5) $sql .= "spelltrigger_5='$spelltrigger_5',";
    3436                 if ($item_templ['spellcharges_5'] != $spellcharges_5) $sql .= "spellcharges_5='$spellcharges_5',";
    3437                 if ($item_templ['spellcooldown_5'] != $spellcooldown_5) $sql .= "spellcooldown_5='$spellcooldown_5',";
    3438                 if ($item_templ['spellcategory_5'] != $spellcategory_5) $sql .= "spellcategory_5='$spellcategory_5',"; 
    3439                 if ($item_templ['spellcategorycooldown_5'] != $spellcategorycooldown_5) $sql .= "spellcategorycooldown_5='$spellcategorycooldown_5',";
    3440                 if ($item_templ['bonding'] != $bonding) $sql .= "bonding='$bonding',";
    3441                 if ($item_templ['description'] != $description) $sql .= "description='$description',";
    3442                 if ($item_templ['PageText'] != $PageText) $sql .= "PageText='$PageText',";
    3443                 if ($item_templ['LanguageID'] != $LanguageID) $sql .= "LanguageID='$LanguageID',";     
    3444                 if ($item_templ['PageMaterial'] != $PageMaterial) $sql .= "PageMaterial='$PageMaterial',";
    3445                 if ($item_templ['startquest'] != $startquest) $sql .= "startquest='$startquest',";
    3446                 if ($item_templ['lockid'] != $lockid) $sql .= "lockid='$lockid',";
    3447                 if ($item_templ['Material'] != $Material) $sql .= "Material='$Material',";
    3448                 if ($item_templ['sheath'] != $sheath) $sql .= "sheath='$sheath',";     
    3449                 if ($item_templ['RandomProperty'] != $RandomProperty) $sql .= "RandomProperty='$RandomProperty',";
    3450                 if ($item_templ['block'] != $block) $sql .= "block='$block',";
    3451                 if ($item_templ['itemset'] != $itemset) $sql .= "itemset='$itemset',";
    3452                 if ($item_templ['MaxDurability'] != $MaxDurability) $sql .= "MaxDurability='$MaxDurability',";
    3453                 if ($item_templ['area'] != $area) $sql .= "area='$area',";     
    3454                 if ($item_templ['BagFamily'] != $BagFamily) $sql .= "BagFamily='$BagFamily',";
    3455                 if ($item_templ['Map'] != $Map) $sql .= "Map='$Map',";
    3456                 if ($item_templ['ScriptName'] != $ScriptName) $sql .= "ScriptName='$ScriptName',";
    3457                 if ($item_templ['DisenchantID'] != $DisenchantID) $sql .= "DisenchantID='$DisenchantID',";
    3458                 if ($item_templ['RequiredDisenchantSkill'] != $RequiredDisenchantSkill) $sql .= "RequiredDisenchantSkill='$RequiredDisenchantSkill',";
    3459                 if ($item_templ['ArmorDamageModifier'] != $ArmorDamageModifier) $sql .= "ArmorDamageModifier='$ArmorDamageModifier',";
    3460                 if ($item_templ['unk0'] != $unk0) $sql .= "unk0='$unk0',";
    3461                 if ($item_templ['RandomSuffix'] != $RandomSuffix) $sql .= "RandomSuffix='$RandomSuffix',";
    3462                 if ($item_templ['TotemCategory'] != $TotemCategory) $sql .= "TotemCategory='$TotemCategory',";
    3463                 if ($item_templ['socketColor_1'] != $socketColor_1) $sql .= "socketColor_1='$socketColor_1',";
    3464                 if ($item_templ['socketContent_1'] != $socketContent_1) $sql .= "socketContent_1='$socketContent_1',";
    3465                 if ($item_templ['socketColor_2'] != $socketColor_2) $sql .= "socketColor_2='$socketColor_2',";
    3466                 if ($item_templ['socketContent_2'] != $socketContent_2) $sql .= "socketContent_2='$socketContent_2',";
    3467                 if ($item_templ['socketColor_3'] != $socketColor_3) $sql .= "socketColor_3='$socketColor_3',";
    3468                 if ($item_templ['socketContent_3'] != $socketContent_3) $sql .= "socketContent_3='$socketContent_3',";
    3469                 if ($item_templ['socketBonus'] != $socketBonus) $sql .= "socketBonus='$socketBonus',";
    3470                 if ($item_templ['GemProperties'] != $GemProperties) $sql .= "GemProperties='$GemProperties',";
    3471                 if ($item_templ['ExtendedCost'] != $ExtendedCost) $sql .= "ExtendedCost='$ExtendedCost',";
    3472 
    3473         $mysql->free_result($result);
     3427                if ($item_templ['spelltrigger_4'] != $spelltrigger_4) $sql_query .= "spelltrigger_4='$spelltrigger_4',";
     3428                if ($item_templ['spellcharges_4'] != $spellcharges_4) $sql_query .= "spellcharges_4='$spellcharges_4',";
     3429                if ($item_templ['spellcooldown_4'] != $spellcooldown_4) $sql_query .= "spellcooldown_4='$spellcooldown_4',";
     3430                if ($item_templ['spellcategory_4'] != $spellcategory_4) $sql_query .= "spellcategory_4='$spellcategory_4',";
     3431                if ($item_templ['spellcategorycooldown_4'] != $spellcategorycooldown_4) $sql_query .= "spellcategorycooldown_4='$spellcategorycooldown_4', ";
     3432                if ($item_templ['spellid_5'] != $spellid_5) $sql_query .= "spellid_5='$spellid_5',";
     3433                if ($item_templ['spelltrigger_5'] != $spelltrigger_5) $sql_query .= "spelltrigger_5='$spelltrigger_5',";
     3434                if ($item_templ['spellcharges_5'] != $spellcharges_5) $sql_query .= "spellcharges_5='$spellcharges_5',";
     3435                if ($item_templ['spellcooldown_5'] != $spellcooldown_5) $sql_query .= "spellcooldown_5='$spellcooldown_5',";
     3436                if ($item_templ['spellcategory_5'] != $spellcategory_5) $sql_query .= "spellcategory_5='$spellcategory_5',";   
     3437                if ($item_templ['spellcategorycooldown_5'] != $spellcategorycooldown_5) $sql_query .= "spellcategorycooldown_5='$spellcategorycooldown_5',";
     3438                if ($item_templ['bonding'] != $bonding) $sql_query .= "bonding='$bonding',";
     3439                if ($item_templ['description'] != $description) $sql_query .= "description='$description',";
     3440                if ($item_templ['PageText'] != $PageText) $sql_query .= "PageText='$PageText',";
     3441                if ($item_templ['LanguageID'] != $LanguageID) $sql_query .= "LanguageID='$LanguageID',";       
     3442                if ($item_templ['PageMaterial'] != $PageMaterial) $sql_query .= "PageMaterial='$PageMaterial',";
     3443                if ($item_templ['startquest'] != $startquest) $sql_query .= "startquest='$startquest',";
     3444                if ($item_templ['lockid'] != $lockid) $sql_query .= "lockid='$lockid',";
     3445                if ($item_templ['Material'] != $Material) $sql_query .= "Material='$Material',";
     3446                if ($item_templ['sheath'] != $sheath) $sql_query .= "sheath='$sheath',";       
     3447                if ($item_templ['RandomProperty'] != $RandomProperty) $sql_query .= "RandomProperty='$RandomProperty',";
     3448                if ($item_templ['block'] != $block) $sql_query .= "block='$block',";
     3449                if ($item_templ['itemset'] != $itemset) $sql_query .= "itemset='$itemset',";
     3450                if ($item_templ['MaxDurability'] != $MaxDurability) $sql_query .= "MaxDurability='$MaxDurability',";
     3451                if ($item_templ['area'] != $area) $sql_query .= "area='$area',";       
     3452                if ($item_templ['BagFamily'] != $BagFamily) $sql_query .= "BagFamily='$BagFamily',";
     3453                if ($item_templ['Map'] != $Map) $sql_query .= "Map='$Map',";
     3454                if ($item_templ['ScriptName'] != $ScriptName) $sql_query .= "ScriptName='$ScriptName',";
     3455                if ($item_templ['DisenchantID'] != $DisenchantID) $sql_query .= "DisenchantID='$DisenchantID',";
     3456                if ($item_templ['RequiredDisenchantSkill'] != $RequiredDisenchantSkill) $sql_query .= "RequiredDisenchantSkill='$RequiredDisenchantSkill',";
     3457                if ($item_templ['ArmorDamageModifier'] != $ArmorDamageModifier) $sql_query .= "ArmorDamageModifier='$ArmorDamageModifier',";
     3458                if ($item_templ['unk0'] != $unk0) $sql_query .= "unk0='$unk0',";
     3459                if ($item_templ['RandomSuffix'] != $RandomSuffix) $sql_query .= "RandomSuffix='$RandomSuffix',";
     3460                if ($item_templ['TotemCategory'] != $TotemCategory) $sql_query .= "TotemCategory='$TotemCategory',";
     3461                if ($item_templ['socketColor_1'] != $socketColor_1) $sql_query .= "socketColor_1='$socketColor_1',";
     3462                if ($item_templ['socketContent_1'] != $socketContent_1) $sql_query .= "socketContent_1='$socketContent_1',";
     3463                if ($item_templ['socketColor_2'] != $socketColor_2) $sql_query .= "socketColor_2='$socketColor_2',";
     3464                if ($item_templ['socketContent_2'] != $socketContent_2) $sql_query .= "socketContent_2='$socketContent_2',";
     3465                if ($item_templ['socketColor_3'] != $socketColor_3) $sql_query .= "socketColor_3='$socketColor_3',";
     3466                if ($item_templ['socketContent_3'] != $socketContent_3) $sql_query .= "socketContent_3='$socketContent_3',";
     3467                if ($item_templ['socketBonus'] != $socketBonus) $sql_query .= "socketBonus='$socketBonus',";
     3468                if ($item_templ['GemProperties'] != $GemProperties) $sql_query .= "GemProperties='$GemProperties',";
     3469                if ($item_templ['ExtendedCost'] != $ExtendedCost) $sql_query .= "ExtendedCost='$ExtendedCost',";
     3470
     3471        $sql->free_result($result);
    34743472        unset($item_templ);
    34753473
    3476                 if (($sql == "UPDATE item_template SET  ")&&(!$de_item)&&(!$del_de_items)){
    3477                 $mysql->close();
     3474                if (($sql_query == "UPDATE item_template SET  ")&&(!$de_item)&&(!$del_de_items)){
     3475                $sql->close();
    34783476                redirect("item.php?action=edit&entry=$entry&error=6");
    34793477                } else {
    3480                                 if ($sql != "UPDATE item_template SET  "){
    3481                                         $sql[strlen($sql)-1] = " ";
    3482                                         $sql .= " WHERE entry = '$entry';\n";
    3483                                         } else $sql = "";
     3478                                if ($sql_query != "UPDATE item_template SET  "){
     3479                                        $sql_query[strlen($sql_query)-1] = " ";
     3480                                        $sql_query .= " WHERE entry = '$entry';\n";
     3481                                        } else $sql_query = "";
    34843482                }
    34853483               
    34863484                if ($de_item){
    3487                         $sql .= "INSERT INTO disenchant_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
     3485                        $sql_query .= "INSERT INTO disenchant_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)
    34883486                                        VALUES ($DisenchantID,$de_item,'$de_ChanceOrRef', '$de_QuestChanceOrGroup' ,$de_mincount ,$de_maxcount ,$de_quest_freeforall);\n";
    34893487                        }
     
    34913489                if ($del_de_items){
    34923490                        foreach($del_de_items as $item_id)
    3493                                 $sql .= "DELETE FROM disenchant_loot_template WHERE entry = $DisenchantID AND item = $item_id;\n";
     3491                                $sql_query .= "DELETE FROM disenchant_loot_template WHERE entry = $DisenchantID AND item = $item_id;\n";
    34943492                        }
    34953493
    34963494 } else {
    3497                 $mysql->close();
     3495                $sql->close();
    34983496                redirect("item.php?error=5");
    34993497                }
    35003498 } else {
    3501         $mysql->close();
     3499        $sql->close();
    35023500        redirect("item.php?error=5");
    35033501        }
    35043502
    35053503 if ( isset($_POST['backup_op']) && ($_POST['backup_op'] == 1) ){
    3506         $mysql->close();
     3504        $sql->close();
    35073505        Header("Content-type: application/octet-stream");
    35083506        Header("Content-Disposition: attachment; filename=itemid_$entry.sql");
    3509         echo $sql;
     3507        echo $sql_query;
    35103508        exit();
    35113509        } else {
    3512                 $sql = explode(';',$sql);
    3513                 foreach($sql as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $mysql->query($tmp_query);
    3514                 $mysql->close();
     3510                $sql_query = explode(';',$sql_query);
     3511                foreach($sql_query as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $sql->query($tmp_query);
     3512                $sql->close();
    35153513                }
    35163514
     
    35523550        else redirect("item.php?error=1");
    35533551
    3554  $mysql = new MySQL;
    3555  $mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
    3556 
    3557  $result = $mysql->query("DELETE FROM item_template WHERE entry = '$entry'");
    3558 
    3559  $mysql->close();
     3552 $sql = new SQL;
     3553 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);
     3554
     3555 $result = $sql->query("DELETE FROM item_template WHERE entry = '$entry'");
     3556
     3557 $sql->close();
    35603558 redirect("item.php");
    35613559 }
Note: See TracChangeset for help on using the changeset viewer.