Ejemplo n.º 1
0
function article_admin_default()
{
    // menampilkan semua item slideshow
    // table: Articles.Slideshow
    // struktur data: lilo_id, no, title, image, description, link
    $html = '';
    $template = new Template();
    $template->basepath = $_SESSION['basepath'];
    // dari $_SESSION['pop_last_article_tab'], set default selected tab
    // setelah digunakan, langsung unset
    $tabs = array('article' => 0, 'slideshow' => 1);
    $template->active_tabs = intval($tabs[$_SESSION['pop_last_article_tab']]);
    $html = $template->render("modules/011_articles/templates/article_admin_default.php");
    $html = ui_admin_default(NULL, $html);
    return $html;
}
Ejemplo n.º 2
0
function report_admin_achievement($op = NULL, $rettype = NULL, $achtype = NULL)
{
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Game');
    $lilo_mongo->selectCollection('Achievement');
    $op = isset($op) ? $op : func_arg(0);
    $op = strtolower(trim($op));
    // read, add, edit, delete
    switch ($op) {
        case 'get':
        case 'read':
            //	report/admin/achievement/get/[rettype]/[achtype]
            //	report/admin/achievement/get/json/all
            //	report/admin/achievement/get/array/online_time
            $rettype = isset($rettype) ? $rettype : func_arg(1);
            $rettype = strtolower(trim($rettype));
            $achtype = isset($achtype) ? $achtype : func_arg(2);
            $achtype = strtolower(trim($achtype));
            $criteria = array();
            if ($achtype != '' && $achtype != 'all') {
                $criteria = array('tipe' => $achtype);
            }
            $ach_cursor = $lilo_mongo->find($criteria);
            $ach_array = array();
            while ($curr = $ach_cursor->getNext()) {
                $tipe = $curr['tipe'];
                // dari $curr['user_id'] dapatkan username
                $user_detail = user_user_property(array('lilo_id' => $curr['user_id']), 'array');
                $ach_array[$tipe][] = array('lilo_id' => $curr['lilo_id'], 'user_id' => $curr['user_id'], 'tipe' => $curr['tipe'], 'value' => $curr['value'], 'username' => $user_detail['username'], 'fullname' => $user_detail['fullname'], 'email' => $user_detail['email']);
            }
            if (strtolower(trim($rettype)) == 'json') {
                $ach_array = json_encode($ach_array);
            }
            return $ach_array;
            break;
        case 'edit':
            break;
        case 'delete':
            break;
    }
    $html = '';
    $template = new Template();
    $template->basepath = $_SESSION['basepath'];
    $html = $template->render("modules/007_statistic_reporting_service/templates/report_admin_achievement.php");
    $html = ui_admin_default(NULL, $html);
    return $html;
}
Ejemplo n.º 3
0
function ui_admin_avatar_editor()
{
    $ajax = func_arg(0);
    if ($ajax == 'ajax') {
        $basepath = $_SESSION['basepath'];
        $template = new Template();
        $logged_in = user_user_loggedin();
        // Deteksi User Agent
        $template->logged_in = $logged_in;
        $template->basepath = $basepath;
        $return = $template->render("modules/000_user_interface/templates/ui_admin_avatar_editor.php");
        return $return;
    } else {
        $template_file = "modules/000_user_interface/templates/ui_admin_avatar_editor.php";
        return ui_admin_default($template_file);
    }
}
Ejemplo n.º 4
0
function server_admin_default()
{
    // CRUD of registered server: name, port, ip, max CCU, current CCU* (*: updated realtime by game server on user connect/disconnect)
    // add server
    $ajax = func_arg(0);
    // dapatkan semua level dari Assets.Level
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Servers');
    $lilo_mongo->selectCollection('GameServer');
    $server_array = $lilo_mongo->find();
    $html = '';
    $template = new Template();
    $template->basepath = $_SESSION['basepath'];
    $template->server_array = $server_array;
    $html = $template->render("modules/010_game_server_management/templates/server_admin_default.php");
    if (trim($ajax) == 'ajax') {
    } else {
        $html = ui_admin_default(NULL, $html);
    }
    return $html;
}
Ejemplo n.º 5
0
function asset_admin_inventory()
{
    // CRUD for Assets.Inventory
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Assets');
    $lilo_mongo->selectCollection('Inventory');
    // delete
    $delete = trim($_REQUEST['delete']);
    if ($delete != '') {
        $lilo_mongo->delete(array('lilo_id' => $delete));
        return "1";
    }
    // detail
    $detail = trim($_REQUEST['detail']);
    if ($detail != '') {
        $data = $lilo_mongo->findOne(array('lilo_id' => $detail));
        return json_encode($data);
    }
    // new_inventory
    $new_inventory = trim($_REQUEST['new_inventory']);
    if ($new_inventory == "1") {
        extract($_POST);
        // tipe, description, icon
        if (trim($tipe) != '') {
            $inventory_data = array('tipe' => $tipe, 'description' => $description, 'icon' => $icon);
            $lilo_id_ = $lilo_mongo->insert($inventory_data);
            $lilo_mongo->update($inventory_data, array_merge($inventory_data, array('lilo_id' => (string) $lilo_id_)), array("multiple" => false));
        }
    }
    // dapatkan data Assets.Inventory
    $inventory_array = $lilo_mongo->find();
    $html = '';
    $template = new Template();
    $template->basepath = $_SESSION['basepath'];
    $template->inventory_array = $inventory_array;
    $html = $template->render("modules/002_asset_management/templates/asset_admin_inventory.php");
    $html = ui_admin_default(NULL, $html);
    return $html;
}
Ejemplo n.º 6
0
function asset_admin_category()
{
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Assets');
    $lilo_mongo->selectCollection('Category');
    $op = isset($op) ? $op : func_arg(0);
    $op = strtolower(trim($op));
    switch ($op) {
        case 'add':
            $data = array('name' => $_POST['name'], 'tipe' => $_POST['editor_div_type']);
            $anim_id = $lilo_mongo->insert($data);
            break;
        case 'delete':
            $lilo_mongo->remove(array('_id' => new MongoId($_POST['_id'])));
            break;
        case 'detail':
            $retval = $lilo_mongo->findOne(array('_id' => new MongoId($_POST['_id'])));
            $resultdetail = array('_id' => $_POST['_id'], 'name' => $retval['name'], 'tipe' => $retval['tipe']);
            echo json_encode($resultdetail);
            exit;
            break;
        case 'edit':
            $lilo_mongo->selectCollection('Category');
            $retval = $lilo_mongo->findOne(array('_id' => new MongoId($_POST['id'])));
            $lilo_mongo->selectCollection('Avatar');
            $lilo_mongo->update_set(array('category' => $retval['name']), array('category' => $_POST['name']));
            $lilo_mongo->selectCollection('Category');
            $lilo_mongo->update_set(array('_id' => new MongoId($_POST['id'])), array('name' => $_POST['name'], 'tipe' => $_POST['editor_div_type']));
            break;
    }
    $brand_data = $lilo_mongo->find(array(), 0, array("tipe" => 1));
    if ($_POST['showdt'] != '') {
        $brand_data = $lilo_mongo->find(array("tipe" => $_POST['showdt']), 0, array("tipe" => 1));
    }
    $returndt = array();
    foreach ($brand_data as $result) {
        $returndt[] = array('_id' => $result['_id'], 'name' => $result['name'], 'tipe' => $result['tipe']);
    }
    if (isset($_POST['json'])) {
        $listtabel = "";
        $listtabel .= "<table class='input_form' width='100%'>";
        $listtabel .= "<tr>";
        $listtabel .= "<th>Name</th>";
        $listtabel .= "<th>Avatar Body Part Type</th>";
        $listtabel .= "<th>Action</th>";
        $listtabel .= "</tr>";
        foreach ($brand_data as $dt) {
            $listtabel .= "<tr>";
            $listtabel .= "<td>" . $dt['name'] . "</td>";
            $listtabel .= "<td>" . $dt['tipe'] . "</td>";
            $listtabel .= "<td>";
            $listtabel .= "<button onclick='functionhapus(\"" . $dt['_id'] . "\");'>Delete</button>";
            $listtabel .= "<button onclick='functiongetdetail(\"" . $dt['_id'] . "\");'>Edit</button>";
            $listtabel .= "</td>";
            $listtabel .= "</tr>";
        }
        $listtabel .= "</table>";
        echo $listtabel;
        exit;
    }
    $html = '';
    $template = new Template();
    $template->basepath = $_SESSION['basepath'];
    $lilo_mongo->selectCollection('AvatarBodyPart');
    $listtipe = $lilo_mongo->find();
    $template->tipe_array = $listtipe;
    $template->category_array = $returndt;
    $html = $template->render("modules/002_asset_management/templates/asset_admin_category.php");
    $html = ui_admin_default(NULL, $html);
    return $html;
}
Ejemplo n.º 7
0
function user_admin_roomplayerstat()
{
    $html = '';
    $template = new Template();
    $template->basepath = $_SESSION['basepath'];
    $html = $template->render("modules/001_user_management/templates/user_admin_roomplayerstat.php");
    $html = ui_admin_default(NULL, $html);
    return $html;
}
Ejemplo n.º 8
0
function quest_admin_questjournal($quest_id = NULL)
{
    // menampilkan daftar player yg sudah menyelesaikan + player yg masih memainkan sebuah quest
    // data diperoleh dari quest_admin_wsquesttoplayer (AJAX)
    $html = '';
    $template = new Template();
    $template->basepath = $_SESSION['basepath'];
    $html = $template->render("modules/006_quest_engine/templates/quest_admin_questjournal.php");
    $html = ui_admin_default(NULL, $html);
    return $html;
}