public static function CharacterClasses($JSONP) { $Statement = parent::$DBConnection->prepare('SELECT class_id as id, class_name as name, LOWER(REPLACE(indicator_second_type, "Class_Indicator_", "")) as powerType FROM classes'); $Statement->execute(); $Result = $Statement->fetchAll(PDO::FETCH_ASSOC); $ArrayIndex = 0; foreach ($Result as $Class) { if ($Class['powerType'] == 'druid') { $Result[$ArrayIndex]['powerType'] = 'mana'; } elseif ($Class['powerType'] == 'monk') { $Result[$ArrayIndex]['powerType'] = 'energy'; } if (strstr($Class['name'], '-') !== false) { $Explode = explode('-', $Class['name']); $Result[$ArrayIndex]['name'] = ucfirst($Explode[0]) . ' ' . ucfirst($Explode[1]); } else { $Result[$ArrayIndex]['name'] = ucfirst($Class['name']); } $Result[$ArrayIndex]['mask'] = DataAPI::ClassBitmastConverter($Class['id']); $ArrayIndex++; } parent::Encode($Result, $JSONP, 'classes'); }
switch ($_REQUEST['datatype']) { case 'races': DataAPI::CharacterRaces($_REQUEST['jsonp']); break; case 'classes': DataAPI::CharacterClasses($_REQUEST['jsonp']); break; default: API::GenerateResponse(403, true); break; } break; case 'item': switch ($_REQUEST['datatype']) { case 'classes': DataAPI::ItemClasses($_REQUEST['jsonp']); break; default: API::GenerateResponse(403, true); break; } break; default: API::GenerateResponse(403, true); break; } break; default: header('Content-Type: text/html; charset=utf-8'); $Smarty->translate('Developer'); $Smarty->assign('Page', Page::Info('dev', array('bodycss' => '', 'pagetitle' => $Smarty->GetConfigVars('Developer_Page_Title') . ' - ')));
public function __construct($stopid) { parent::__construct($stopid); }