<?php
class saimod_mojotrollz_db_spell extends \SYSTEM\SAI\SaiModule {    
    public static function sai_mod_saimod_mojotrollz_db_spell(){
        $con = new \SYSTEM\DB\Connection(new \DBD\mangos_world());
        $res = $con->query('SELECT * FROM creature_template LIMIT 100;');
               
        $result =   '<table><tr>
                        <th>entry</th>
                        <th>KillCredit1</th>
                        <th>KillCredit2</th>
                        <th>modelid_1</th>
                        <th>modelid_2</th>
                        <th>name</th>
                        <th>subname</th>
                        <th>gossip_menu_id</th>
                        <th>minlevel</th>
                        <th>maxlevel</th>
                        <th>minhealth</th>
                        <th>maxhealth</th>
                        <th>minmana</th>
                        <th>maxmana</th>
                        <th>armor</th>
                        <th>faction_A</th>
                        <th>faction_H</th>
                        <th>npcflag</th>
                        <th>speed_walk</th>
                        <th>speed_run</th>
                        <th>scale</th>
                        <th>rank</th>
                        <th>mindmg</th>
                        <th>maxdmg</th>
                        <th>dmgschool</th>
                        <th>attackpower</th>
                        <th>dmg_multiplier</th>
                        <th>baseattacktime</th>
                        <th>rangeattacktime</th>
                        <th>unit_class</th>
                        <th>unit_flags</th>
                        <th>dynamicflags</th>
                        <th>family</th>
                        <th>trainer_type</th>
                        <th>trainer_spell</th>
                        <th>trainer_class</th>
                        <th>trainer_race</th>
                        <th>minrangedmg</th>
                        <th>maxrangedmg</th>
                        <th>rangedattackpower</th>
                        <th>type</th>
                        <th>type_flags</th>
                        <th>lootid</th>
                        <th>pickpocketloot</th>
                        <th>skinloot</th>
                        <th>resistance1</th>
                        <th>resistance2</th>
                        <th>resistance3</th>
                        <th>resistance4</th>
                        <th>resistance5</th>
                        <th>resistance6</th>
                        <th>PetSpellDataId</th>
                        <th>mingold</th>
                        <th>maxgold</th>
                        <th>AIName</th>
                        <th>MovementType</th>
                        <th>InhabitType</th>
                        <th>Civilian</th>
                        <th>RacialLeader</th>
                        <th>RegenHealth</th>
                        <th>equipment_id</th>
                        <th>trainer_id</th>
                        <th>vendor_id</th>
                        <th>mechanic_immune_mask</th>
                        <th>flags_extra</th>
                        <th>ScriptName</th>
                    </tr>';
        while($row = $res->next()){
            $result .= '<tr>
                        <td>'.$row['entry'].'</td>
                        <td>'.$row['KillCredit1'].'</td>
                        <td>'.$row['KillCredit2'].'</td>
                        <td>'.$row['modelid_1'].'</td>
                        <td>'.$row['modelid_2'].'</td>
                        <td>'.$row['name'].'</td>
                        <td>'.$row['subname'].'</td>
                        <td>'.$row['gossip_menu_id'].'</td>
                        <td>'.$row['minlevel'].'</td>
                        <td>'.$row['maxlevel'].'</td>
                        <td>'.$row['minhealth'].'</td>
                        <td>'.$row['maxhealth'].'</td>
                        <td>'.$row['minmana'].'</td>
                        <td>'.$row['maxmana'].'</td>
                        <td>'.$row['armor'].'</td>
                        <td>'.$row['faction_A'].'</td>
                        <td>'.$row['faction_H'].'</td>
                        <td>'.$row['npcflag'].'</td>
                        <td>'.$row['speed_walk'].'</td>
                        <td>'.$row['speed_run'].'</td>
                        <td>'.$row['scale'].'</td>
                        <td>'.$row['rank'].'</td>
                        <td>'.$row['mindmg'].'</td>
                        <td>'.$row['maxdmg'].'</td>
                        <td>'.$row['dmgschool'].'</td>
                        <td>'.$row['attackpower'].'</td>
                        <td>'.$row['dmg_multiplier'].'</td>
                        <td>'.$row['baseattacktime'].'</td>
                        <td>'.$row['rangeattacktime'].'</td>
                        <td>'.$row['unit_class'].'</td>
                        <td>'.$row['unit_flags'].'</td>
                        <td>'.$row['dynamicflags'].'</td>
                        <td>'.$row['family'].'</td>
                        <td>'.$row['trainer_type'].'</td>
                        <td>'.$row['trainer_spell'].'</td>
                        <td>'.$row['trainer_class'].'</td>
                        <td>'.$row['trainer_race'].'</td>
                        <td>'.$row['minrangedmg'].'</td>
                        <td>'.$row['maxrangedmg'].'</td>
                        <td>'.$row['rangedattackpower'].'</td>
                        <td>'.$row['type'].'</td>
                        <td>'.$row['type_flags'].'</td>
                        <td>'.$row['lootid'].'</td>
                        <td>'.$row['pickpocketloot'].'</td>
                        <td>'.$row['skinloot'].'</td>
                        <td>'.$row['resistance1'].'</td>
                        <td>'.$row['resistance2'].'</td>
                        <td>'.$row['resistance3'].'</td>
                        <td>'.$row['resistance4'].'</td>
                        <td>'.$row['resistance5'].'</td>
                        <td>'.$row['resistance6'].'</td>
                        <td>'.$row['PetSpellDataId'].'</td>
                        <td>'.$row['mingold'].'</td>
                        <td>'.$row['maxgold'].'</td>
                        <td>'.$row['AIName'].'</td>
                        <td>'.$row['MovementType'].'</td>
                        <td>'.$row['InhabitType'].'</td>
                        <td>'.$row['Civilian'].'</td>
                        <td>'.$row['RacialLeader'].'</td>
                        <td>'.$row['RegenHealth'].'</td>
                        <td>'.$row['equipment_id'].'</td>
                        <td>'.$row['trainer_id'].'</td>
                        <td>'.$row['vendor_id'].'</td>
                        <td>'.$row['mechanic_immune_mask'].'</td>
                        <td>'.$row['flags_extra'].'</td>
                        <td>'.$row['ScriptName'].'</td>
                    </tr>';
        }
        $result .= '</table>';
        return $result;}            
    public static function html_li_menu(){return '<li><a href="#" saimenu="saimod_mojotrollz_db_spell">DB:Spells</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_spell_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array());}        
    public static function sai_mod_saimod_mojotrollz_db_spell_flag_css(){}

}