<?php
class saimod_mojotrollz_db_item extends \SYSTEM\SAI\SaiModule {    
    public static function sai_mod_saimod_mojotrollz_db_item(){
        $con = new \SYSTEM\DB\Connection(new \DBD\mangos_world());
        $res = $con->query('SELECT * FROM item_template LIMIT 100;');
               
        $result =   '<table><tr>
                        <th>class</th>
                        <th>subclass</th>
                        <th>name</th>
                        <th>displayid</th>
                        <th>Quality</th>
                        <th>entry</th>
                        <th>Flags</th>
                        <th>BuyCount</th>
                        <th>BuyPrice</th>
                        <th>SellPrice</th>
                        <th>InventoryType</th>
                        <th>AllowableClass</th>
                        <th>AllowableRace</th>
                        <th>ItemLevel</th>
                        <th>RequiredLevel</th>
                        <th>RequiredSkill</th>
                        <th>RequiredSkillRank</th>
                        <th>requiredspell</th>
                        <th>requiredhonorrank</th>
                        <th>RequiredCityRank</th>
                        <th>RequiredReputationFaction</th>
                        <th>RequiredReputationRank</th>
                        <th>maxcount</th>
                        <th>stackable</th>
                        <th>ContainerSlots</th>
                        <th>stat_type1</th>
                        <th>stat_value1</th>
                        <th>stat_type2</th>
                        <th>stat_value2</th>
                        <th>stat_type3</th>
                        <th>stat_value3</th>
                        <th>stat_type4</th>
                        <th>stat_value4</th>
                        <th>stat_type5</th>
                        <th>stat_value5</th>
                        <th>stat_type6</th>
                        <th>stat_value6</th>
                        <th>stat_type7</th>
                        <th>stat_value7</th>
                        <th>stat_type8</th>
                        <th>stat_value8</th>
                        <th>stat_type9</th>
                        <th>stat_value9</th>
                        <th>stat_type10</th>
                        <th>stat_value10</th>
                        <th>dmg_min1</th>
                        <th>dmg_max1</th>
                        <th>dmg_type1</th>
                        <th>dmg_min2</th>
                        <th>dmg_max2</th>
                        <th>dmg_type2</th>
                        <th>dmg_min3</th>
                        <th>dmg_max3</th>
                        <th>dmg_type3</th>
                        <th>dmg_min4</th>
                        <th>dmg_max4</th>
                        <th>dmg_type4</th>
                        <th>dmg_min5</th>
                        <th>dmg_max5</th>
                        <th>dmg_type5</th>
                        <th>armor</th>
                        <th>holy_res</th>
                        <th>fire_res</th>
                        <th>nature_res</th>
                        <th>frost_res</th>
                        <th>shadow_res</th>
                        <th>arcane_res</th>
                        <th>delay</th>
                        <th>ammo_type</th>
                        <th>RangedModRange</th>
                        <th>spellid_1</th>
                        <th>spelltrigger_1</th>
                        <th>spellcharges_1</th>
                        <th>spellppmRate_1</th>
                        <th>spellcooldown_1</th>
                        <th>spellcategory_1</th>
                        <th>spellcategorycooldown_1</th>
                        <th>spellid_2</th>
                        <th>spelltrigger_2</th>
                        <th>spellcharges_2</th>
                        <th>spellppmRate_2</th>
                        <th>spellcooldown_2</th>
                        <th>spellcategory_2</th>
                        <th>spellcategorycooldown_2</th>
                        <th>spellid_3</th>
                        <th>spelltrigger_3</th>
                        <th>spellcharges_3</th>
                        <th>spellppmRate_3</th>
                        <th>spellcooldown_3</th>
                        <th>spellcategory_3</th>
                        <th>spellcategorycooldown_3</th>
                        <th>spellid_4</th>
                        <th>spelltrigger_4</th>
                        <th>spellcharges_4</th>
                        <th>spellppmRate_4</th>
                        <th>spellcooldown_4</th>
                        <th>spellcategory_4</th>
                        <th>spellcategorycooldown_4</th>
                        <th>spellid_5</th>
                        <th>spelltrigger_5</th>
                        <th>spellcharges_5</th>
                        <th>spellppmRate_5</th>
                        <th>spellcooldown_5</th>
                        <th>spellcategory_5</th>
                        <th>spellcategorycooldown_5</th>
                        <th>bonding</th>
                        <th>description</th>
                        <th>PageText</th>
                        <th>LanguageID</th>
                        <th>PageMaterial</th>
                        <th>startquest</th>
                        <th>lockid</th>
                        <th>Material</th>
                        <th>sheath</th>
                        <th>RandomProperty</th>
                        <th>block</th>
                        <th>itemset</th>
                        <th>MaxDurability</th>
                        <th>area</th>
                        
                        
                        
                    </tr>';
        while($row = $res->next()){
            $result .= '<tr>
                       <td>'.$row['class'].'</td>
                        <td>'.$row['subclass'].'</td>
                        <td>'.$row['name'].'</td>
                        <td>'.$row['displayid'].'</td>
                        <td>'.$row['Quality'].'</td>
                        <td>'.$row['entry'].'</td>
                        <td>'.$row['Flags'].'</td>
                        <td>'.$row['BuyCount'].'</td>
                        <td>'.$row['BuyPrice'].'</td>
                        <td>'.$row['SellPrice'].'</td>
                        <td>'.$row['InventoryType'].'</td>
                        <td>'.$row['AllowableClass'].'</td>
                        <td>'.$row['AllowableRace'].'</td>
                        <td>'.$row['ItemLevel'].'</td>
                        <td>'.$row['RequiredLevel'].'</td>
                        <td>'.$row['RequiredSkill'].'</td>
                        <td>'.$row['RequiredSkillRank'].'</td>
                        <td>'.$row['requiredspell'].'</td>
                        <td>'.$row['requiredhonorrank'].'</td>
                        <td>'.$row['RequiredCityRank'].'</td>
                        <td>'.$row['RequiredReputationFaction'].'</td>
                        <td>'.$row['RequiredReputationRank'].'</td>
                        <td>'.$row['maxcount'].'</td>
                        <td>'.$row['stackable'].'</td>
                        <td>'.$row['ContainerSlots'].'</td>
                        <td>'.$row['stat_type1'].'</td>
                        <td>'.$row['stat_value1'].'</td>
                        <td>'.$row['stat_type2'].'</td>
                        <td>'.$row['stat_value2'].'</td>
                        <td>'.$row['stat_type3'].'</td>
                        <td>'.$row['stat_value3'].'</td>
                        <td>'.$row['stat_type4'].'</td>
                        <td>'.$row['stat_value4'].'</td>
                        <td>'.$row['stat_type5'].'</td>
                        <td>'.$row['stat_value5'].'</td>
                        <td>'.$row['stat_type6'].'</td>
                        <td>'.$row['stat_value6'].'</td>
                        <td>'.$row['stat_type7'].'</td>
                        <td>'.$row['stat_value7'].'</td>
                        <td>'.$row['stat_type8'].'</td>
                        <td>'.$row['stat_value8'].'</td>
                        <td>'.$row['stat_type9'].'</td>
                        <td>'.$row['stat_value9'].'</td>
                        <td>'.$row['stat_type10'].'</td>
                        <td>'.$row['stat_value10'].'</td>
                        <td>'.$row['dmg_min1'].'</td>
                        <td>'.$row['dmg_max1'].'</td>
                        <td>'.$row['dmg_type1'].'</td>
                        <td>'.$row['dmg_min2'].'</td>
                        <td>'.$row['dmg_max2'].'</td>
                        <td>'.$row['dmg_type2'].'</td>
                        <td>'.$row['dmg_min3'].'</td>
                        <td>'.$row['dmg_max3'].'</td>
                        <td>'.$row['dmg_type3'].'</td>
                        <td>'.$row['dmg_min4'].'</td>
                        <td>'.$row['dmg_max4'].'</td>
                        <td>'.$row['dmg_type4'].'</td>
                        <td>'.$row['dmg_min5'].'</td>
                        <td>'.$row['dmg_max5'].'</td>
                        <td>'.$row['dmg_type5'].'</td>
                        <td>'.$row['armor'].'</td>
                        <td>'.$row['holy_res'].'</td>
                        <td>'.$row['fire_res'].'</td>
                        <td>'.$row['nature_res'].'</td>
                        <td>'.$row['frost_res'].'</td>
                        <td>'.$row['shadow_res'].'</td>
                        <td>'.$row['arcane_res'].'</td>
                        <td>'.$row['delay'].'</td>
                        <td>'.$row['ammo_type'].'</td>
                        <td>'.$row['RangedModRange'].'</td>
                        <td>'.$row['spellid_1'].'</td>
                        <td>'.$row['spelltrigger_1'].'</td>
                        <td>'.$row['spellcharges_1'].'</td>
                        <td>'.$row['spellppmRate_1'].'</td>
                        <td>'.$row['spellcooldown_1'].'</td>
                        <td>'.$row['spellcategory_1'].'</td>
                        <td>'.$row['spellcategorycooldown_1'].'</td>
                        <td>'.$row['spellid_2'].'</td>
                        <td>'.$row['spelltrigger_2'].'</td>
                        <td>'.$row['spellcharges_2'].'</td>
                        <td>'.$row['spellppmRate_2'].'</td>
                        <td>'.$row['spellcooldown_2'].'</td>
                        <td>'.$row['spellcategory_2'].'</td>
                        <td>'.$row['spellcategorycooldown_2'].'</td>
                        <td>'.$row['spellid_3'].'</td>
                        <td>'.$row['spelltrigger_3'].'</td>
                        <td>'.$row['spellcharges_3'].'</td>
                        <td>'.$row['spellppmRate_3'].'</td>
                        <td>'.$row['spellcooldown_3'].'</td>
                        <td>'.$row['spellcategory_3'].'</td>
                        <td>'.$row['spellcategorycooldown_3'].'</td>
                        <td>'.$row['spellid_4'].'</td>
                        <td>'.$row['spelltrigger_4'].'</td>
                        <td>'.$row['spellcharges_4'].'</td>
                        <td>'.$row['spellppmRate_4'].'</td>
                        <td>'.$row['spellcooldown_4'].'</td>
                        <td>'.$row['spellcategory_4'].'</td>
                        <td>'.$row['spellcategorycooldown_4'].'</td>
                        <td>'.$row['spellid_5'].'</td>
                        <td>'.$row['spelltrigger_5'].'</td>
                        <td>'.$row['spellcharges_5'].'</td>
                        <td>'.$row['spellppmRate_5'].'</td>
                        <td>'.$row['spellcooldown_5'].'</td>
                        <td>'.$row['spellcategory_5'].'</td>
                        <td>'.$row['spellcategorycooldown_5'].'</td>
                        <td>'.$row['bonding'].'</td>
                        <td>'.$row['description'].'</td>
                        <td>'.$row['PageText'].'</td>
                        <td>'.$row['LanguageID'].'</td>
                        <td>'.$row['PageMaterial'].'</td>
                        <td>'.$row['startquest'].'</td>
                        <td>'.$row['lockid'].'</td>
                        <td>'.$row['Material'].'</td>
                        <td>'.$row['sheath'].'</td>
                        <td>'.$row['RandomProperty'].'</td>
                        <td>'.$row['block'].'</td>
                        <td>'.$row['itemset'].'</td>
                        <td>'.$row['MaxDurability'].'</td>
                        <td>'.$row['area'].'</td>                     

                    </tr>';
        }
        $result .= '</table>';
        return $result;}            
    public static function html_li_menu(){return '<li><a href="#" saimenu="saimod_mojotrollz_db_item">DB:Items</a></li><li class="divider"></li>';}
    public static function right_public(){return false;}    
    public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
    public static function sai_mod_saimod_mojotrollz_db_item_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array());}        
    public static function sai_mod_saimod_mojotrollz_db_item_flag_css(){}

}