示例#1
0
<?php

/* $Id: cities.php 8 2011-01-11 Alex $ */
$page = "providers/gameprovider";
include "header.php";
include 'include/providers/class_gameprovider.php';
include 'include/providers/class_game.php';
include 'include/providers/class_gamecommand.php';
include 'include/class_city.php';
$provider_id = (int) $_GET['provider_id'];
$user_id = $user->user_info['user_id'];
// Модель поставщика
$gameprovider = new se_gameprovider();
$game_model = new se_game();
$city_model = new se_city();
$command_model = new se_gamecommand();
$provider_info = $gameprovider->get_gameprovider($provider_id);
$games = $game_model->get_current_games($provider_id);
$city = $city_model->get_city($provider_info['city_id']);
$commands = $command_model->get_available_commands($user_id);
foreach ($games as &$game) {
    $game['game_sdate'] = date('d-m-Y, h:m', $game['game_sdate']);
}
$smarty->assign_by_ref('provider_info', $provider_info);
$smarty->assign_by_ref('games', $games);
$smarty->assign('city', $city['name']);
$smarty->assign('user_id', $user_id);
include "footer.php";
示例#2
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)
<?php

$page = "adm/adm_game_setting";
include "adm_header.php";
include 'include/providers/class_gameprovider.php';
//include 'include/providers/class_game.php';
//include 'include/providers/class_gamequestion.php';
$gameprovider = new se_gameprovider();
$provider_id = $provider->provider_info['provider_id'];
//$game_model = new se_game;
//$question_model = new se_gamequestion;
$error = '';
if (isset($_POST['submit'])) {
    $game_start_time = isset($_POST['game_start_time']) ? $_POST['game_start_time'] : null;
    $answers_symbols = isset($_POST['answers_symbols']) ? trim($_POST['answers_symbols']) : null;
    if ($game_start_time && $answers_symbols) {
        $provider_info['game_start_time'] = $game_start_time;
        $provider_info['answers_symbols'] = $answers_symbols;
        $gameprovider->update_gameprovider($provider_info, $provider_id);
    } else {
        $error = 'Одно из полей незаполнено!';
    }
}
$tmp_provider = $gameprovider->get_gameprovider($provider_id);
$game_start_time = $tmp_provider['game_start_time'];
$answers_symbols = $tmp_provider['answers_symbols'];
$smarty->assign('game_start_time', $game_start_time);
$smarty->assign('answers_symbols', $answers_symbols);
$smarty->assign('error', $error);
include "adm_footer.php";
<?php

$page = "adm/adm_game_profile";
include "adm_header.php";
include 'include/providers/class_gameprovider.php';
include 'include/providers/class_game.php';
$gameprovider = new se_gameprovider();
$provider_id = $provider->provider_info['provider_id'];
//$provider_info = $gameprovider->get_gameprovider($provider_id);
if (isset($_POST['submit'])) {
    $error_flag = 0;
    $prefix_table = "game";
    $provider_name = isset($_POST['provider_name']) ? trim($_POST['provider_name']) : NULL;
    $provider_password = isset($_POST['password']) ? trim($_POST['password']) : NULL;
    $provider_new_password = isset($_POST['new_password']) ? trim($_POST['new_password']) : NULL;
    $provider_info = array();
    if ($provider_password) {
        if (strcmp($gameprovider->provider_password_crypt($provider_password), $provider->provider_info['private_password']) == 0) {
            $error = "Неправильно введен текущий пароль!";
            $error_flag = 1;
        } elseif ($provider_new_password) {
            $provider_info['private_password'] = $gameprovider->provider_password_crypt($provider_new_password);
        } else {
            $error = "Не введен новый пароль!";
            $error_flag = 1;
        }
    }
    if ($provider_name == NULL) {
        $error = "Имя не заполнено!";
        $error_flag = 1;
    } else {