예제 #1
0
            $val = $_POST[$str];
        }
    }
    return $val;
}
$errorHTML = "";
$edit = false;
$bot = GameBots::create()->setId(-1);
$user = GameUsers::create()->setUserId(-1);
$defaultUserName = "";
//edit için id gelirse bot ordan kopyala
$tmp = getURLParam("id");
if (!empty($tmp)) {
    $bot = GameBots::getBotById($tmp);
    if (empty($bot)) {
        $bot = GameBots::create()->setId(-1);
    } else {
        $user = $bot->user;
        $defaultUserName = $user->userName;
        $edit = true;
    }
}
//formdan data gelmişse onları ata ve kaydet
$tmp = getURLParam("form_");
if (!empty($tmp)) {
    $bot->setActive(getURLParam("active", 0));
    $bot->setRoomGroupId(getURLParam("roomGroupId", -1));
    $bot->setWeightBar(getURLParam("weight_bar", -1));
    $bot->setWeightBlocked(getURLParam("weight_blocked", -1));
    $bot->setWeightFaraway(getURLParam("weight_faraway", -1));
    $bot->setWeightSingle(getURLParam("weight_single", -1));
예제 #2
0
 /**
  * get single GameBots instance from a DOMElement
  *
  * @param DOMElement $node
  * @return GameBots
  */
 public static function fromDOMElement(DOMElement $node)
 {
     $o = new GameBots();
     $o->assignByHash(self::domNodeToHash($node, self::$FIELD_NAMES, self::$DEFAULT_VALUES, self::$FIELD_TYPES));
     $o->notifyPristine();
     return $o;
 }
예제 #3
0
<?php

define("__ROOT__", __DIR__ . "/../");
require_once __ROOT__ . 'config/constants.php';
require_once __ROOT__ . 'utils/Functions.php';
require_once __ROOT__ . 'vendors/KLogger.php';
include_once __ROOT__ . "models/GameBots.class.php";
$result = new FunctionResult();
$result->success = false;
if (isset($_GET["sessionId"]) && !empty($_GET["sessionId"])) {
    session_id($_GET["sessionId"]);
}
session_start();
session_write_close();
$gameBots = GameBots::findByExample(DBUtils::getConnection(), GameBots::create()->setActive(1));
if (empty($gameBots)) {
    $gameBots = array();
}
$result->success = true;
$result->result = new stdClass();
$result->result->bots = $gameBots;
echo json_encode($result);
exit(1);
예제 #4
0
                if (!empty($_user)) {
                    $_user->setActive($value);
                    $_user->updateToDatabase(DBUtils::getConnection());
                }
                $botList = GameBots::getBotsList(($pageNumber - 1) * 100, 100);
            }
        }
    }
} else {
    $botList = GameBots::getBotsList(($pageNumber - 1) * 100, 100);
    if (sizeof($botList) == 0) {
        $pageNumber = $pageNumber - 1;
        $botList = GameBots::getBotsList(($pageNumber - 1) * 100, 100);
    }
}
$total_user = GameBots::getTotalBotCount();
$max_page = intval($total_user / 100);
if ($total_user % 100 > 0) {
    $max_page++;
}
?>


<div class="container">
    <div class="row"> 
        <div class="span12" style="height: 40px"></div>
    </div>

    <div class="row-fluid">
        <div class="span12 " >
            <a href="<?php