$question_model->add_help($question_id, $help, $help_status, $x); } } } } } } } } } } } } } $games['future']['games'] = $game_model->get_future_games($provider_id); $games['current']['games'] = $game_model->get_current_games($provider_id); $games['past']['games'] = $game_model->get_past_games($provider_id); // Добавляем задания, приводим даты в порядок foreach ($games as &$game_type) { foreach ($game_type['games'] as &$game) { // 1 $game['questions']['questions'] = $question_model->get_global_questions($game['game_id']); $game['questions']['print_count'] = count($game['questions']['questions']); // 2 if ($game['game_sdate']) { $game['game_sdate'] = date('d-m-Y H:i', $game['game_sdate']); } if ($game['game_edate']) { $game['game_edate'] = date('d-m-Y H:i', $game['game_edate']); } }
<?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";