Esempio n. 1
0
     $y = isset($_POST['y']) ? (int) $_POST['y'] : null;
     if ($game_id && $season_id && $title && $intro && $place && $price && $game_estatus && $game_model->is_provider_game($provider_id, $game_id)) {
         // Обработать лого
         /*echo '<pre>';
           print_r($_FILES);
           print_r($_POST);
           echo '</pre>';
           die();*/
         $game_model->update_game($season_id, $title, $logo, $intro, $place, $legend, $preqiel, $price, null, $game_estatus, $game_sdate, null, $game_id, $x, $y);
     }
 } else {
     if ($action == 'delete_game') {
         $game_id = isset($_POST['game_id']) ? (int) $_POST['game_id'] : null;
         // Необходимо сделать проверку, нашего ли поставщика эта игра
         if ($game_id && $game_model->is_provider_game($provider_id, $game_id)) {
             $game_model->delete_game($game_id);
         }
     } else {
         if ($action == 'delete_games') {
             $games_id = isset($_POST['games_id']) ? $_POST['games_id'] : null;
             foreach ($games_id as $game_id) {
                 if ($game_id && $game_model->is_provider_game($provider_id, $game_id)) {
                     $game_model->delete_game($game_id);
                 }
             }
         } else {
             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;
                 $game_id = isset($_POST['game_id']) ? (int) $_POST['game_id'] : null;