Merge branch 'master' of mojotrollz.eu:wow-server/mojo_zero_web into pagestate
Conflicts: mojotrollz/sai/saimod_mojotrollz_db_creature/db_creatures.sql mojotrollz/sai/saimod_mojotrollz_db_creature/saimod_mojotrollz_db_creature.js mojotrollz/sai/saimod_mojotrollz_db_creature/saimod_mojotrollz_db_creature.php
This commit is contained in:
commit
69bfd67c15
@ -1,3 +1,4 @@
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1200, 42, 0, 0, 'saimod_mojotrollz_db_creatures', 'action', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1210, 42, 3, 1200, 'search', 'search', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1200, 42, 0, 0, 'saimod_mojotrollz_db_creature', 'action', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1210, 42, 3, 1200, 'search', 'search', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1215, 42, 3, 1200, 'creature', 'id', 'UINT');
|
||||
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature_template WHERE `Entry` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE_CREATURE extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature WHERE `id` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE_INVOLVEMENT_RELATION extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature_involvedrelation WHERE `id` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE_LINKING_TEMPLATE extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature_linking_template WHERE `Entry` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE_LOOT extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature_loot_template WHERE `Entry` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE_ONKILL_REPUTATION extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature_onkill_reputation WHERE `creature_id` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE_QUESTRELATION extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature_questrelation WHERE `id` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE_TEMPLATE_ADDON extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature_template_addon WHERE `Entry` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class DB_CREATURE_TEMPLATE_CREATURE_TEMPLATE_SPELLS extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT * FROM creature_template_spells WHERE `Entry` = ?;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
function init_saimod_mojotrollz_db_creature(){
|
||||
$('#search').click(function(){
|
||||
//$('#content-wrapper').load();
|
||||
/*$.ajax({
|
||||
url: SAI_ENDPOINT,
|
||||
data: { sai_mod: 'saimod_mojotrollz_db_creature',
|
||||
action: 'search',
|
||||
search: $('#filter').val(),
|
||||
},
|
||||
type: 'POST',
|
||||
success: function(data){
|
||||
|
||||
}
|
||||
});*/
|
||||
});
|
||||
$('#search').click(function(e){
|
||||
e.preventDefault();
|
||||
$('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=saimod_mojotrollz_db_creature&action=search&search=' + $('#filter').val(),function(){
|
||||
init_saimod_mojotrollz_db_creature();
|
||||
});
|
||||
});
|
||||
$('.sai_table_row').click(function(){
|
||||
$('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=saimod_mojotrollz_db_creature&action=creature&id=' + $(this).attr('sai_table_row'),function(){
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,11 +1,51 @@
|
||||
<?php
|
||||
class saimod_mojotrollz_db_creature extends \SYSTEM\SAI\SaiModule {
|
||||
public static function sai_mod_saimod_mojotrollz_db_creature_action_search($search){
|
||||
return self::sai_mod_saimod_mojotrollz_db_creature($search);
|
||||
return self::sai_mod_saimod_mojotrollz_db_creature('%'.$search.'%');}
|
||||
|
||||
public static function sai_mod_saimod_mojotrollz_db_creature_action_creature($id){
|
||||
$def = array('additional_tables' => array( '\DBD\DB_CREATURE_TEMPLATE_CREATURE_LOOT' => array('key' => 'LootId', 'caption' => 'Loot'),
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_TEMPLATE_ADDON' => array('key' => 'Entry', 'caption' => 'Template Addon'),
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_TEMPLATE_SPELLS' => array('key' => 'Entry', 'caption' => 'Template Spells'),
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_QUESTRELATION' => array('key' => 'Entry', 'caption' => 'Questrelation'),
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_ONKILL_REPUTATION' => array('key' => 'Entry', 'caption' => 'Onkill Reputation'),
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_LINKING_TEMPLATE' => array('key' => 'Entry', 'caption' => 'Linking Template'),
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_INVOLVEMENT_RELATION' => array('key' => 'Entry', 'caption' => 'Involvement Relation'),
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_CREATURE' => array('key' => 'Entry', 'caption' => 'Spawns'),));
|
||||
|
||||
$result = '<table class="sai_table">';
|
||||
$base_row = \DBD\DB_CREATURE_TEMPLATE_CREATURE::Q1(array($id));
|
||||
foreach($base_row as $key=>$value){
|
||||
$result .= '<tr><td>'.$key.'</td><td>'.$value.'</td></tr>';}
|
||||
$result .= '</table>';
|
||||
|
||||
|
||||
foreach($def['additional_tables'] as $key=>$value){
|
||||
$result .= '<h4>'.$value['caption'].'</h4><table class="sai_table">';
|
||||
$res = \call_user_func($key.'::QQ',array($base_row[$value['key']]));
|
||||
$first = true;
|
||||
while($row = $res->next()){
|
||||
if($first){
|
||||
$result .= '<tr>';
|
||||
foreach($row as $key=>$value){
|
||||
$result .= '<th>'.$key.'</th>';}
|
||||
$result .= '</tr>';
|
||||
}
|
||||
$result .= '<tr>';
|
||||
foreach($row as $key=>$value){
|
||||
$result .= '<td>'.$value.'</td>';}
|
||||
$result .= '</tr>';
|
||||
$first = false;
|
||||
}
|
||||
$result .= '</table>';
|
||||
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
public static function sai_mod_saimod_mojotrollz_db_creature($search='%'){
|
||||
|
||||
$def = array( 'Entry' => array('caption' => 'ID'),
|
||||
$subdef = array( 'key' => 'Entry'); //table identifier
|
||||
$def = array( 'Entry' => array('caption' => 'ID'),
|
||||
'ModelId1' => array('hidden' => false),
|
||||
'ModelId2' => array('hidden' => false),
|
||||
'Scale' => array('hidden' => true),
|
||||
@ -75,12 +115,12 @@ class saimod_mojotrollz_db_creature extends \SYSTEM\SAI\SaiModule {
|
||||
);
|
||||
|
||||
$res = \DBD\DB_CREATURE_TEMPLATE_SEARCH::QQ(array($search,$search,$search));
|
||||
$result = '<input id="filter"></input><button id="search">Search</button>';
|
||||
$result = '<input id="filter" type="text"/><button class="btn btn-primary" type="button" id="search">Search</button>';
|
||||
$result .= '<table class="sai_table"><tr>';
|
||||
$result_body = '<tr>';
|
||||
$first = true;
|
||||
while($row = $res->next()){
|
||||
$result_body .= '<tr>';
|
||||
$result_body .= '<tr class="sai_table_row" sai_table_row="'.$row[$subdef['key']].'">';
|
||||
foreach($row as $key=>$data){
|
||||
//hidden
|
||||
if( array_key_exists($key, $def) &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user