- | '.$row['class'].' |
- '.$row['subclass'].' |
- '.$row['name'].' |
- '.$row['displayid'].' |
- '.$row['Quality'].' |
- '.$row['entry'].' |
- '.$row['Flags'].' |
- '.$row['BuyCount'].' |
- '.$row['BuyPrice'].' |
- '.$row['SellPrice'].' |
- '.$row['InventoryType'].' |
- '.$row['AllowableClass'].' |
- '.$row['AllowableRace'].' |
- '.$row['ItemLevel'].' |
- '.$row['RequiredLevel'].' |
- '.$row['RequiredSkill'].' |
- '.$row['RequiredSkillRank'].' |
- '.$row['requiredspell'].' |
- '.$row['requiredhonorrank'].' |
- '.$row['RequiredCityRank'].' |
- '.$row['RequiredReputationFaction'].' |
- '.$row['RequiredReputationRank'].' |
- '.$row['maxcount'].' |
- '.$row['stackable'].' |
- '.$row['ContainerSlots'].' |
- '.$row['stat_type1'].' |
- '.$row['stat_value1'].' |
- '.$row['stat_type2'].' |
- '.$row['stat_value2'].' |
- '.$row['stat_type3'].' |
- '.$row['stat_value3'].' |
- '.$row['stat_type4'].' |
- '.$row['stat_value4'].' |
- '.$row['stat_type5'].' |
- '.$row['stat_value5'].' |
- '.$row['stat_type6'].' |
- '.$row['stat_value6'].' |
- '.$row['stat_type7'].' |
- '.$row['stat_value7'].' |
- '.$row['stat_type8'].' |
- '.$row['stat_value8'].' |
- '.$row['stat_type9'].' |
- '.$row['stat_value9'].' |
- '.$row['stat_type10'].' |
- '.$row['stat_value10'].' |
- '.$row['dmg_min1'].' |
- '.$row['dmg_max1'].' |
- '.$row['dmg_type1'].' |
- '.$row['dmg_min2'].' |
- '.$row['dmg_max2'].' |
- '.$row['dmg_type2'].' |
- '.$row['dmg_min3'].' |
- '.$row['dmg_max3'].' |
- '.$row['dmg_type3'].' |
- '.$row['dmg_min4'].' |
- '.$row['dmg_max4'].' |
- '.$row['dmg_type4'].' |
- '.$row['dmg_min5'].' |
- '.$row['dmg_max5'].' |
- '.$row['dmg_type5'].' |
- '.$row['armor'].' |
- '.$row['holy_res'].' |
- '.$row['fire_res'].' |
- '.$row['nature_res'].' |
- '.$row['frost_res'].' |
- '.$row['shadow_res'].' |
- '.$row['arcane_res'].' |
- '.$row['delay'].' |
- '.$row['ammo_type'].' |
- '.$row['RangedModRange'].' |
- '.$row['spellid_1'].' |
- '.$row['spelltrigger_1'].' |
- '.$row['spellcharges_1'].' |
- '.$row['spellppmRate_1'].' |
- '.$row['spellcooldown_1'].' |
- '.$row['spellcategory_1'].' |
- '.$row['spellcategorycooldown_1'].' |
- '.$row['spellid_2'].' |
- '.$row['spelltrigger_2'].' |
- '.$row['spellcharges_2'].' |
- '.$row['spellppmRate_2'].' |
- '.$row['spellcooldown_2'].' |
- '.$row['spellcategory_2'].' |
- '.$row['spellcategorycooldown_2'].' |
- '.$row['spellid_3'].' |
- '.$row['spelltrigger_3'].' |
- '.$row['spellcharges_3'].' |
- '.$row['spellppmRate_3'].' |
- '.$row['spellcooldown_3'].' |
- '.$row['spellcategory_3'].' |
- '.$row['spellcategorycooldown_3'].' |
- '.$row['spellid_4'].' |
- '.$row['spelltrigger_4'].' |
- '.$row['spellcharges_4'].' |
- '.$row['spellppmRate_4'].' |
- '.$row['spellcooldown_4'].' |
- '.$row['spellcategory_4'].' |
- '.$row['spellcategorycooldown_4'].' |
- '.$row['spellid_5'].' |
- '.$row['spelltrigger_5'].' |
- '.$row['spellcharges_5'].' |
- '.$row['spellppmRate_5'].' |
- '.$row['spellcooldown_5'].' |
- '.$row['spellcategory_5'].' |
- '.$row['spellcategorycooldown_5'].' |
- '.$row['bonding'].' |
- '.$row['description'].' |
- '.$row['PageText'].' |
- '.$row['LanguageID'].' |
- '.$row['PageMaterial'].' |
- '.$row['startquest'].' |
- '.$row['lockid'].' |
- '.$row['Material'].' |
- '.$row['sheath'].' |
- '.$row['RandomProperty'].' |
- '.$row['block'].' |
- '.$row['itemset'].' |
- '.$row['MaxDurability'].' |
- '.$row['area'].' |
-
-
';
+ public static function sai_mod_saimod_mojotrollz_db_item_action_search($search,$tags=null){
+ return self::sai_mod_saimod_mojotrollz_db_item($search,$tags);}
+
+ public static function sai_mod_saimod_mojotrollz_db_item_action_tag($id,$tags){
+ $tags = json_decode($tags,true);
+ foreach ($tags as $type=>$value){
+ if($value == -2){
+ tags::del(tags::TAG_TABLE_ITEM, $id, $type);}
+ tags::set(tags::TAG_TABLE_ITEM, $id, $type, $value);}
+ return JsonResult::ok();
+ }
+
+ public static function sai_mod_saimod_mojotrollz_db_item_action_item($id){
+ $vars = array();
+ $vars['entries'] = $vars['tag_entries'] = '';
+
+ $base_row = \DBD\DB_ITEM_TEMPLATE_ITEM::Q1(array($id));
+ foreach($base_row as $key=>$value){
+ $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_mojotrollz_db_item/tpl/item_base.tpl'), array('key' => $key, 'value' => $value));}
+
+ //Item Tags
+ $tags_res = tags::get(tags::TAG_TABLE_ITEM, $base_row['entry']);
+ $tags = array();
+ while($tag = $tags_res->next()){
+ $tags[$tag['type']] = $tag;}
+
+ //Tag Types
+ $tags_types = tags::get_type(tags::TAG_TABLE_ITEM);
+ while($tag = $tags_types->next()){
+ $tag['options'] = '';
+ $tags_values = tags::get_value($tag['id']);
+ while($value = $tags_values->next()){
+ $value['selected'] = '';
+ if( array_key_exists($value['type'], $tags) &&
+ $tags[$value['type']]['value'] == $value['id']){
+ $value['selected'] = 'selected';}
+ $tag['options'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_mojotrollz_db_item/tpl/tag_entry_option.tpl'), $value);}
+ $vars['tag_entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_mojotrollz_db_item/tpl/tag_item_entry.tpl'), $tag);}
+
+ return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_mojotrollz_db_item/tpl/item.tpl'), $vars);
+ }
+ public static function sai_mod_saimod_mojotrollz_db_item($search='%',$tags=null){
+ $vars = array();
+ $vars['search'] = $search;
+ $vars['entries'] = $vars['tag_entries'] = '';
+
+ $tags = json_decode($tags,true);
+ if(!$tags){
+ $tags = array();}
+
+ $tags_types = tags::get_type(tags::TAG_TABLE_ITEM);
+ while($tag = $tags_types->next()){
+ $tag['options'] = '';
+ $tags_values = tags::get_value($tag['id']);
+ while($value = $tags_values->next()){
+ $value['selected'] = '';
+ if( array_key_exists($value['type'], $tags) &&
+ $tags[$value['type']] == $value['id']){
+ $value['selected'] = 'selected';}
+ $tag['options'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_mojotrollz_db_item/tpl/tag_entry_option.tpl'), $value);}
+ $vars['tag_entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_mojotrollz_db_item/tpl/tag_entry.tpl'), $tag);}
+
+ $sql_join = $sql_where = '';
+ foreach($tags as $type=>$value){
+ if($value == -1){
+ continue;}
+ if($value == -2){
+ $sql_where .= 'entry NOT IN (SELECT id FROM host_mojotrollz.mojotrollz_tags WHERE `table` = '.tags::TAG_TABLE_ITEM.' AND `type` = '.$type.') AND ';
+ continue;}
+ $sql_join .= 'LEFT JOIN host_mojotrollz.mojotrollz_tags as t'.$type.' ON item_template.entry = t'.$type.'.id ';
+ $sql_where .= 't'.$type.'.`table` = '.tags::TAG_TABLE_ITEM.' AND t'.$type.'.`type` = '.$type.' AND t'.$type.'.value = '.$value.' AND ';
}
- $result .= '