Beispiel #1
0
<?php

$page = "adm/adm_games";
include "adm_header.php";
include 'include/providers/class_gameprovider.php';
include 'include/providers/class_game.php';
include 'include/providers/class_gamequestion.php';
$provider_id = $provider->provider_info['provider_id'];
$game_model = new se_game();
$question_model = new se_gamequestion();
if (isset($_POST['action'])) {
    $action = $_POST['action'];
    if ($action == 'add_game') {
        /*echo '<pre>';
          print_r($_POST);
          echo '</pre>';
          die();    */
        $season_id = isset($_POST['season_id']) ? (int) $_POST['season_id'] : null;
        $title = isset($_POST['title']) && trim($_POST['title']) ? trim($_POST['title']) : null;
        $intro = isset($_POST['intro']) && trim($_POST['intro']) ? trim($_POST['intro']) : null;
        $place = isset($_POST['place']) && trim($_POST['place']) ? trim($_POST['place']) : null;
        $legend = isset($_POST['legend']) && trim($_POST['legend']) ? trim($_POST['legend']) : null;
        $preqiel = isset($_POST['preqiel']) && trim($_POST['preqiel']) ? trim($_POST['preqiel']) : null;
        $price = isset($_POST['price']) ? (int) $_POST['price'] : null;
        $game_estatus = isset($_POST['game_estatus']) ? (int) $_POST['game_estatus'] : null;
        $game_sdate = isset($_POST['game_sdate']) ? (int) $_POST['game_sdate'] : null;
        $x = isset($_POST['x']) ? (int) $_POST['x'] : null;
        $y = isset($_POST['y']) ? (int) $_POST['y'] : null;
        if ($season_id && $title && $intro && $place && $price && $game_estatus && $game_sdate) {
            // Обработать лого
            $file_path = $GAME_IMAGES_PATH . $_FILES['logo']['name'];
<?php

$page = "adm/adm_game_system";
include "adm_header.php";
include 'include/providers/class_gameprovider.php';
include 'include/providers/class_game.php';
include 'include/providers/class_gamequestion.php';
include 'include/providers/class_gamecommand.php';
$provider_id = $provider->provider_info['provider_id'];
$game_model = new se_game();
$question_model = new se_gamequestion();
$command_model = new se_gamecommand();
// Управление ли одной конкретной игрой либо всеми текущими
$games_id = array();
if (isset($_GET['game_id'])) {
    $games['games'][] = $game_model->get_game($_GET['game_id']);
    $games['print_count'] = count($games['games']);
} else {
    $games['games'] = $game_model->get_current_games($provider_id);
    $games['print_count'] = count($games['games']);
}
if (isset($_POST['action'])) {
    $action = $_POST['action'];
    if ($action == 'add_question') {
        $question = isset($_POST['question']) && trim($_POST['question']) ? trim($_POST['question']) : null;
        $question_status = isset($_POST['question_status']) ? (int) $_POST['question_status'] : null;
        $question_is_necessary = $_POST['question_is_necessary'] ? 1 : 0;
        $command_id = isset($_POST['command_id']) ? (int) $_POST['command_id'] : null;
        $game_id = isset($_POST['game_id']) ? (int) $_POST['game_id'] : null;
        if ($question && $question_status && $game_id && $game_model->is_provider_game($provider_id, $game_id)) {
            $question_model->add_question($question, $question_status, $question_is_necessary, $game_id, $command_id);
Beispiel #3
0
include "header.php";
include "include/providers/class_game.php";
include "include/providers/class_gamequestion.php";
include "include/providers/class_gamecommand.php";
include "include/providers/class_gamechat.php";
// This is ajax
//header("Content-Type: application/json");
// Get info (post only)
$action = isset($_POST['action']) ? $_POST['action'] : NULL;
// Must be logged in to use tasks below this section
if (!$user->user_exists) {
    echo json_encode(array('result' => FALSE, 'err' => 1));
    exit;
}
$game_model = new se_game();
$question_model = new se_gamequestion();
$command_model = new se_gamecommand();
$gamechat_model = new se_gamechat();
if ($action == 'add_message') {
    $game_id = isset($_POST['game_id']) ? $_POST['game_id'] : NULL;
    $command_id = isset($_POST['command_id']) ? $_POST['command_id'] : NULL;
    $chat_id = isset($_POST['chat_id']) ? $_POST['chat_id'] : NULL;
    $message = isset($_POST['message']) ? $_POST['message'] : NULL;
    if ($chat_id == 0 || $chat_id == NULL) {
        $provider = 0;
        // Доделать эту строку!!!!!
        $chat_id = $gamechat_model->add_chat($game_id, $command_id, $provider_id);
    }
    $chat = $gamechat_model->get_chat_by_id($chat_id);
    $user_id = $user->user_info['user_id'];
    $name = $user->user_info['user_fname'];
include "adm_header.php";
include 'include/providers/class_gameprovider.php';
include 'include/providers/class_game.php';
include 'include/providers/class_gamequestion.php';
include 'include/providers/class_gamecommand.php';
// Get info (post only)
$action = isset($_POST['action']) ? $_POST['action'] : null;
// Must be logged in to use tasks below this section
if (!$provider->provider_exists) {
    $result = array('success' => false, 'error' => 'access denied');
    echo json_encode($result);
    die;
}
$provider_id = $provider->provider_info['provider_id'];
$game_model = new se_game();
$question_model = new se_gamequestion();
$command_model = new se_gamecommand();
if ($action == 'update_game_sstatus') {
    header("Content-Type: application/json");
    $command_id = isset($_POST['command_id']) ? (int) $_POST['command_id'] : null;
    $game_id = isset($_POST['game_id']) ? (int) $_POST['game_id'] : null;
    $game_sstatus = isset($_POST['game_sstatus']) ? (int) $_POST['game_sstatus'] : null;
    $X = isset($_POST['x']) ? (int) $_POST['x'] : 0;
    if ($command_id && $game_id && $game_sstatus && $game_model->is_provider_game($provider_id, $game_id)) {
        $game_model->update_command_game_sstatus($game_sstatus, $command_id, $game_id, $X);
        $result = array('success' => true);
    } else {
        $result = array('success' => false, 'error' => 'game_id and command_id is null');
    }
    echo json_encode($result);
    die;
Beispiel #5
0
<?php

/* $Id: cities.php 8 2011-01-11 Alex $ */
$page = "providers/game";
include "header.php";
include 'include/providers/class_gameprovider.php';
include 'include/providers/class_game.php';
include 'include/providers/class_gamequestion.php';
include 'include/providers/class_gamecommand.php';
include 'include/providers/class_gamepin.php';
include 'include/providers/class_gamechat.php';
$provider_id = (int) $_GET['provider_id'];
// Модели
$gameprovider_model = new se_gameprovider();
$game_model = new se_game();
$question_model = new se_gamequestion();
$command_model = new se_gamecommand();
$gamechat_model = new se_gamechat();
// Проверяем, мобильное ли уустройство
/*$url = 'http://phd.yandex.net/detect';

$query = http_build_query(
   array(
       'user-agent'  => $_SERVER['HTTP_USER_AGENT']
       //'wap-profile' => "http://www-ccpp-mpd.alcatel.com/files/ALCATEL-CTH3_MMS10_1.0.rdf",
   )
);

$mobile = file_get_contents($url . '?' . $query);

if(strcmp($mobile, "<yandex-mobile-info-error>Unknown user agent and wap profile</yandex-mobile-info-error>") != 0)
include 'include/providers/class_game.php';
include 'include/providers/class_gamequestion.php';
include 'include/providers/class_gamepin.php';
// Get info (post only)
$action = isset($_POST['action']) ? $_POST['action'] : null;
// Init param
$messPin = -1;
// Must be logged in to use tasks below this section
if (!$provider->provider_exists) {
    $result = array('success' => false, 'error' => 'access denied');
    echo json_encode($result);
    die;
}
$provider_id = $provider->provider_info['provider_id'];
$game_model = new se_game();
$question_model = new se_gamequestion();
if ($action == 'get_game') {
    header("Content-Type: application/json");
    $game_id = isset($_POST['game_id']) ? (int) $_POST['game_id'] : null;
    if ($game_id && $game_model->is_provider_game($provider_id, $game_id)) {
        $game = $game_model->get_game($game_id);
        $result = array('success' => true, 'game' => $game);
    } else {
        $result = array('success' => false, 'error' => 'game_id is null');
    }
    echo json_encode($result);
    die;
} else {
    if ($action == 'get_question') {
        header("Content-Type: application/json");
        $question_id = isset($_POST['question_id']) ? (int) $_POST['question_id'] : null;