当前位置: 首页>>代码示例>>PHP>>正文


PHP Match::deleteMatchScores方法代码示例

本文整理汇总了PHP中Match::deleteMatchScores方法的典型用法代码示例。如果您正苦于以下问题:PHP Match::deleteMatchScores方法的具体用法?PHP Match::deleteMatchScores怎么用?PHP Match::deleteMatchScores使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Match的用法示例。


在下文中一共展示了Match::deleteMatchScores方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: brackets


//.........这里部分代码省略.........
                                    $matchup_deleted = true;
                                }
                            }
                        }
                        switch ($content[$round][$matchup][$match]) {
                            case 'E':
                                $results[$round][$matchup]['winner'] = $match == 0 ? 'bottom' : 'top';
                                $results[$round][$matchup]['bye'] = true;
                                break;
                            case 'N':
                                $results[$round][$matchup]['winner'] = $match == 0 ? 'bottom' : 'top';
                                break;
                            case 'F':
                                $results[$round][$matchup]['winner'] = $match == 0 ? 'bottom' : 'top';
                                break;
                        }
                    }
                    // for(match)
                    /* Match deletion*/
                    if ($nbr_matchs > 0) {
                        $match_deleted = false;
                        for ($match = 0; $match < $nbr_matchs; $match++) {
                            if ($results[$round][$matchup]['matchs'][$match]['match_id'] == $delete_match_id || $match_deleted == true || $matchup_deleted == true) {
                                /*
                                var_dump($results[$round][$matchup]);
                                var_dump($delete_match_id);
                                var_dump($match_deleted);
                                var_dump($matchup_deleted);
                                */
                                $update_results = true;
                                $current_match_id = $results[$round][$matchup]['matchs'][$match]['match_id'];
                                echo "match " . $current_match_id . " deleted (M{$round},{$matchup},{$match})<br>";
                                $current_match = new Match($current_match_id);
                                $current_match->deleteMatchScores();
                                $results[$round][$matchup]['winner'] = 'not played';
                                $results[$round][$matchup]['topWins'] = 0;
                                $results[$round][$matchup]['bottomWins'] = 0;
                                $results[$round][$matchup]['winner'] = 'not played';
                                unset($results[$round][$matchup]['matchs'][$match]);
                                $match_deleted = true;
                                if ($this->getField('Status') == 'finished' && $competition_type == 'Tournament') {
                                    // if tournament was finished, we need to remove awards
                                    $this->setFieldDB('Status', 'active');
                                    // Find who got the award for winning the tournament
                                    switch ($type) {
                                        case "One Player Tournament":
                                            $q = "SELECT " . TBL_PLAYERS . ".*, " . TBL_GAMERS . ".*, " . TBL_EVENTS . ".*, " . TBL_AWARDS . ".*" . " FROM " . TBL_PLAYERS . ", " . TBL_GAMERS . ", " . TBL_EVENTS . ", " . TBL_AWARDS . " WHERE (" . TBL_PLAYERS . ".PlayerID = " . TBL_AWARDS . ".Player)" . "   AND (" . TBL_PLAYERS . ".Gamer = " . TBL_GAMERS . ".GamerID)" . "   AND (" . TBL_PLAYERS . ".Event = '{$event_id}')" . "   AND (" . TBL_AWARDS . ".Type = 'PlayerWonTournament')";
                                            $result = $sql->db_Query($q);
                                            $pid = mysql_result($result, 0, TBL_PLAYERS . ".PlayerID");
                                            $uid = mysql_result($result, 0, TBL_GAMERS . ".User");
                                            $aid = mysql_result($result, 0, TBL_AWARDS . ".AwardID");
                                            $q = "DELETE FROM " . TBL_AWARDS . " WHERE (" . TBL_AWARDS . ".AwardID = '{$aid}')";
                                            $result = $sql->db_Query($q);
                                            // gold
                                            if (is_gold_system_active() && $this->getField('GoldWinningEvent') > 0) {
                                                $gold_param['gold_user_id'] = $uid;
                                                $gold_param['gold_who_id'] = 0;
                                                $gold_param['gold_amount'] = $this->getField('GoldWinningEvent');
                                                $gold_param['gold_type'] = EB_L1;
                                                $gold_param['gold_action'] = "debit";
                                                $gold_param['gold_plugin'] = "ebattles";
                                                $gold_param['gold_log'] = EB_GOLD_L8 . ": event=" . $event_id . ", user=" . $uid;
                                                $gold_param['gold_forum'] = 0;
                                                $gold_obj->gold_modify($gold_param);
                                            }
                                            break;
开发者ID:testt98,项目名称:ebattles,代码行数:67,代码来源:event.php

示例2: WHERE

     if ($_POST['draw' . $i] != "") {
         $actual_rank[$i] = $actual_rank[$i - 1];
     } else {
         $actual_rank[$i] = $i;
     }
 }
 $text .= '--------------------<br />';
 $text .= 'Comments: ' . $tp->toHTML($comments) . '<br />';
 $create_scores = 0;
 if ($action == 'matchschedulededit') {
     $q = "UPDATE " . TBL_MATCHS . " SET ReportedBy = '{$reported_by}'," . "       TimeScheduled = '{$time_scheduled}'," . "       Comments = '{$comments}'," . "       Status= 'scheduled'," . "       Maps = '{$map}'" . " WHERE (MatchID = '{$match_id}')";
     $result = $sql->db_Query($q);
 }
 if ($action == 'matchedit' || $action == 'matchscheduledreport') {
     // Need to delete the match scores and re-create new ones.
     $match->deleteMatchScores();
     $q = "UPDATE " . TBL_MATCHS . " SET ReportedBy = '{$reported_by}'," . "       TimeReported = '{$time_reported}'," . "       Comments = '{$comments}'," . "       Status= 'pending'," . "       Maps = '{$map}'" . " WHERE (MatchID = '{$match_id}')";
     $result = $sql->db_Query($q);
     $create_scores = 1;
 }
 if ($action == 'matchschedule') {
     // Create Match ------------------------------------------
     $q = "INSERT INTO " . TBL_MATCHS . "(Event,ReportedBy,TimeReported, Comments, Status, TimeScheduled, Maps)\r\n\t\t\tVALUES ({$event_id},'{$reported_by}', {$time_reported}, '{$comments}', 'scheduled', {$time_scheduled}, '{$map}')";
     $result = $sql->db_Query($q);
     $create_scores = 1;
     $last_id = mysql_insert_id();
     $match_id = $last_id;
     $match = new Match($match_id);
 }
 if ($action == 'matchreport') {
     // Create Match ------------------------------------------
开发者ID:testt98,项目名称:ebattles,代码行数:31,代码来源:matchreport.php


注:本文中的Match::deleteMatchScores方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。