if ($action == 'insert_pin') { $pin = isset($_POST['pin']) ? (int) $_POST['pin'] : 0; sleep(1); if ($command_model->check_pin($pin, $game_id)) { $pin_model = new se_gamepin(); $pin_model->update_pin($pin, $user_id, $command_id, $game_id); } else { $error_message = "Неверно введен пин-код"; $smarty->assign('error_message', $error_message); $smarty->assign('off_div', "style='display: none'"); $smarty->assign('on_div', "style='display: block'"); include "footer.php"; die; } } elseif ($action == 'complete_game') { $game_model->complete_game($game_id, $command_id); header("Location: game.php?game_id=" . $game_id); exit; } /*else if($action == 'give_answer') { $answer = isset($_POST['answer']) ? trim($_POST['answer']) : null; $question_id = isset($_POST['question_id']) ? (int)$_POST['question_id'] : null; $command_id = $command_id; if($answer && $question_id) { $result = $question_model->try_accept_answer($answer, $question_id, $command_id); if($result['success']) {