예제 #1
0
파일: group.php 프로젝트: hotmob/likedome
     if ($succe != 1) {
         echo "添加队伍对阵图失败";
         return;
     }
     echo "添加队伍对阵图成功";
     break;
     // Del Schedule
 // Del Schedule
 case 'delschedule':
     $id = intval($_REQUEST['id']);
     $succe = delSchedule($id);
     if ($succe != 1) {
         echo "删除队伍对阵图:" . ngid . "失败";
         return;
     }
     updateMatch($matchid, -1, -1, count(getGroupList($matchid)));
     echo "成功删除队伍对阵图:" . $groupid;
     break;
     // Main Page
 // Main Page
 default:
     $matchId = 0;
     $matchId = intval($_GET['matchId']);
     $groupList = getGroupList($matchId);
     if ($matchId != 0) {
         $matchs = getMatchList($matchId);
         $tpl->SetVar('match', $matchs[0]);
     }
     $tpl->SetVar('groups', $groupList);
     $tpl->SetVar('paging', count($groupList) / 20);
     echo '<h2>' . '队伍列表' . '</h2>';
예제 #2
0
파일: match.php 프로젝트: hotmob/likedome
 // Del
 case 'del':
     $matchid = intval($_POST['matchid']);
     $succe = delMatch($matchid);
     if ($succe != 1) {
         echo "删除比赛提交失败";
         return;
     }
     echo "删除比赛提交成功";
     break;
     // Update
 // Update
 case 'update':
     $matchid = intval($_POST['matchid']);
     $stage = intval($_POST['stageselect']);
     $succe = updateMatch($matchid, -1, $stage);
     if ($succe) {
         echo "修改比赛提交成功";
         return;
     }
     echo "没有提交更新的比赛数据或发生异常";
     break;
     // Main Page
 // Main Page
 default:
     $currentType = intval($_POST['currentTypeSelect']);
     $currentStage = intval($_POST['currentStageSelect']);
     $matchList = getMatchList(-1, $currentType, $currentStage);
     $tpl->SetVar('currentType', $currentType);
     $tpl->SetVar('currentStage', $currentStage);
     $tpl->SetVar('typelist', getMatchTypeList());
예제 #3
0
파일: classes.php 프로젝트: hotmob/likedome
/**
 * 创建队伍
 */
function addGroup($name, $captain_id, $matchId)
{
    global $wpdb;
    $_matchId = intval($matchId);
    if (!empty($name)) {
        $_captain_id = intval($captain_id);
        $matchs = getMatchList($_matchId);
        if (count($matchs) > 0) {
            $update = updateMatch($_matchId, -1, -1, intval($matchs[0]->groupnumber) + 1);
            if ($update > 0) {
                $result = $wpdb->insert('wp_likedome_match_group', array('captain_id' => $_captain_id, 'name' => $name, 'match_id' => $_matchId, 'maxpeople' => $matchs[0]->groupmemberlimit));
            }
            return $result;
        }
    }
    return null;
}