public static function GetRace($RaceName)
 {
     $Statement = Races::$DBConnection->prepare('SELECT * FROM races WHERE race = :race');
     $Statement->bindParam(':race', $RaceName);
     $Statement->execute();
     $Result = $Statement->fetch(PDO::FETCH_ASSOC);
     if ($Result['race'] == 'blood-elf') {
         $Result['race_full_name'] = Races::$TM->GetConfigVars('Race_Blood_Elf');
     } elseif ($Result['race'] == 'night-elf') {
         $Result['race_full_name'] = Races::$TM->GetConfigVars('Race_Night_Elf');
     } else {
         $Result['race_full_name'] = Races::$TM->GetConfigVars('Race_' . ucfirst($Result['race']));
     }
     $Result['classes'] = Races::GetRaceClassRelation($RaceName);
     return $Result;
 }
Esempio n. 2
0
             Manager::LoadExtension("Patches", $ClassConstructor);
             $Smarty->assign('MenuData', Patches::GetMenu());
             $Smarty->assign('Page', Page::Info('game', array('bodycss' => 'game-patchnotes', 'pagetitle' => $Smarty->GetConfigVars('Game_Patch_Notes') . ' - ' . $Smarty->GetConfigVars('Menu_Game') . ' - ')));
             $Smarty->display('pages/game_patch_notes');
             break;
     }
 } else {
     if ($_REQUEST['subcategory'] == 'race') {
         $Races = array_merge(Races::GetAlliance(), Races::GetHorde());
         $ExistingRaces = Text::UnsetAllBut('race_link', $Races, 2);
         if (!in_array($_REQUEST['lastcategory'], $ExistingRaces)) {
             header('Location: /game/race');
         }
         $Race = Races::GetRace($_REQUEST['lastcategory']);
         $Smarty->assign('Race', $Race);
         $Smarty->assign('RaceNavigation', Races::GetNavigation($Race['id']));
         $Smarty->assign('Page', Page::Info('game', array('bodycss' => 'race-' . $_REQUEST['lastcategory'] . '', 'pagetitle' => $Race['race_full_name'] . ' - ' . $Smarty->GetConfigVars('Menu_Game') . ' - ')));
         $Smarty->display('pages/game_race');
     } elseif ($_REQUEST['subcategory'] == 'class') {
         $Classes = Classes::GetAll();
         $ExistingClasses = Text::UnsetAllBut('class_name', $Classes, 2);
         if (!in_array($_REQUEST['lastcategory'], $ExistingClasses)) {
             header('Location: /game/class');
         }
         $Class = Classes::GetClass($_REQUEST['lastcategory']);
         $Smarty->assign('Class', $Class);
         $Smarty->assign('ClassNavigation', Classes::GetNavigation($Class['id']));
         $Smarty->assign('Page', Page::Info('game', array('bodycss' => 'class-' . $_REQUEST['lastcategory'] . '', 'pagetitle' => $Class['class_full_name'] . ' - ' . $Smarty->GetConfigVars('Menu_Game') . ' - ')));
         $Smarty->display('pages/game_class');
     } elseif ($_REQUEST['subcategory'] == 'profession') {
         Manager::LoadExtension('Professions', $ClassConstructor);
Esempio n. 3
0
 public function saveRaces()
 {
     $this->log->showLog(2, "Access saveRaces()");
     // die;
     global $xoopsDB, $saveHandler, $createdby, $timestamp, $defaultorganization_id;
     $tablename = "sim_races";
     $pkey = "races_id";
     $keyword = "Races";
     $controlfieldname = "races_name";
     $insertCount = $saveHandler->ReturnInsertCount();
     $this->log->showLog(3, "Start Insert({$insertCount} records)");
     if ($insertCount > 0) {
         $arrfield = array($controlfieldname, "races_description", "isactive", "defaultlevel", "created", "createdby", "updated", "updatedby", "organization_id");
         $arrfieldtype = array('%s', '%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d');
         // Yes there are INSERTs to perform...
         for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnInsertField($currentRecord, $controlfieldname), $saveHandler->ReturnInsertField($currentRecord, "races_description"), $saveHandler->ReturnInsertField($currentRecord, "isactive"), $saveHandler->ReturnInsertField($currentRecord, "defaultlevel"), $timestamp, $createdby, $timestamp, $createdby, $defaultorganization_id);
             $controlvalue = $saveHandler->ReturnInsertField($currentRecord, $controlfieldname);
             $this->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, $pkey);
             // Now we execute this query
         }
     }
     $updateCount = $saveHandler->ReturnUpdateCount();
     $this->log->showLog(3, "Start update({$updateCount} records)");
     if ($updateCount > 0) {
         $arrfield = array($controlfieldname, "races_description", "isactive", "defaultlevel", "updated", "updatedby", "isdeleted");
         $arrfieldtype = array('%s', '%s', '%d', '%d', '%s', '%d', '%d');
         // Yes there are UPDATEs to perform...
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, $controlfieldname), $saveHandler->ReturnUpdateField($currentRecord, "races_description"), $saveHandler->ReturnUpdateField($currentRecord, "isactive"), $saveHandler->ReturnUpdateField($currentRecord, "defaultlevel"), $timestamp, $createdby, $saveHandler->ReturnUpdateField($currentRecord, "isdeleted"));
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, $controlfieldname);
             $this->UpdateRecord($tablename, $pkey, $saveHandler->ReturnUpdateField($currentRecord), $arrfield, $arrvalue, $arrfieldtype, $controlvalue);
         }
     }
     $ispurge = 0;
     $deleteCount = $saveHandler->ReturnDeleteCount();
     $this->log->showLog(3, "Start delete/purge({$deleteCount} records)");
     include "class/{$keyword}.inc.php";
     $o = new Races();
     if ($deleteCount > 0) {
         for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) {
             $record_id = $saveHandler->ReturnDeleteField($currentRecord);
             $o->fetchRaces($record_id);
             $controlvalue = $o->races_name;
             $isdeleted = $o->isdeleted;
             if ($o->allowDelete($record_id)) {
                 $this->DeleteRecord($tablename, $pkey, $record_id, $controlvalue, $isdeleted);
             } else {
                 $this->failfeedback .= "Cannot delete {$keyword}: {$o->races_name} <br/>";
             }
         }
     }
     //$this->failfeedback.="asdasdpasd<br/>\n";
     //$this->failfeedback.="123 3443<br/>\n";
     //$this->failfeedback.="234 45656523 234<br/>\n";
     if ($this->failfeedback != "") {
         $this->failfeedback .= "Warning!<br/>\n" . $this->failfeedback;
     }
     $saveHandler->setErrorMessage($this->failfeedback);
     die;
     $saveHandler->CompleteSave();
 }
Esempio n. 4
0
 public static function replaceIds($data)
 {
     $data['race'] = Races::getById($data['race']);
     $data['class'] = Classes::getById($data['class']);
     $data['images'] = self::getImagesUrl($data['thumbnail']);
     return $data;
 }
Esempio n. 5
0
<?php

include_once "system.php";
//include_once 'class/Log.php';
include_once 'class/Races.php';
//include_once 'class/Employee.php';
include_once "menu.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
//$log = new Log();
$o = new Races($xoopsDB, $tableprefix, $log);
$s = new XoopsSecurity($xoopsDB, $tableprefix, $log);
//$e = new Employee($xoopsDB,$tableprefix,$log);
$action = "";
echo <<<EOF
<script type="text/javascript">
\tfunction autofocus(){
\t
\t\tdocument.forms['frmRaces'].races_name.focus();
\t}
\tfunction validateRaces(){
\t\tvar name=document.forms['frmRaces'].races_name.value;

\t\tif(confirm('Save Record?')){
\t\tif(name =="" ){
\t\t\talert("Please make sure 'Races Name' is filled in.");
\t\t\treturn false;
\t\t}
\t\telse
\t\t\treturn true;
\t\t}
\t\telse
Esempio n. 6
0
<?php

include "system.php";
include_once '../simantz/class/Races.inc.php';
$o = new Races();
$s = new XoopsSecurity();
$action = $_REQUEST['action'];
$isadmin = $xoopsUser->isAdmin();
$uid = $xoopsUser->getVar('uid');
switch ($action) {
    case "search":
        //return xml table to grid
        $wherestring = " WHERE races_id>0";
        $o->showRaces($wherestring);
        exit;
        //after return xml shall not run more code.
        break;
    case "lookup":
        //return xml table to grid
        include_once "../simantz/class/EBAGetHandler.php";
        $defaultorganization_id = $_SESSION['defaultorganization_id'];
        $lookupdelay = 1000;
        $pagesize =& $_GET["pagesize"];
        $ordinalStart =& $_GET["startrecordindex"];
        $sortcolumn =& $_GET["sortcolumn"];
        $sortdirection =& $_GET["sortdirection"];
        $getHandler = new EBAGetHandler();
        $getHandler->ProcessRecords();
        $wherestring = " WHERE races_id>0";
        $o->showLookupRaces($wherestring);
        exit;