/** * 获取比赛队伍option输出栏目 */ function getGroupListSelect($matchId, $currentType = 0) { $groupList = getGroupList($matchId); foreach ($groupList as $group) { $result .= '<option value="' . $group->id . '"'; if ($currentType == $group->id) { $result .= 'selected="selected"'; } $result .= '>' . $group->name . '</option>'; } return $result; }
/** * Provides an interface for updating a group * * @access public * @param int $gid * @return void */ public function update($gid) { $gid = (int) $gid; $group = QuestionGroup::model()->findByAttributes(array('gid' => $gid)); $surveyid = $group->sid; if (Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'update')) { Yii::app()->loadHelper('surveytranslator'); $grplangs = Survey::model()->findByPk($surveyid)->additionalLanguages; $baselang = Survey::model()->findByPk($surveyid)->language; array_push($grplangs, $baselang); foreach ($grplangs as $grplang) { if (isset($grplang) && $grplang != "") { $group_name = $_POST['group_name_' . $grplang]; $group_description = $_POST['description_' . $grplang]; $group_name = html_entity_decode($group_name, ENT_QUOTES, "UTF-8"); $group_description = html_entity_decode($group_description, ENT_QUOTES, "UTF-8"); // Fix bug with FCKEditor saving strange BR types $group_name = fixCKeditorText($group_name); $group_description = fixCKeditorText($group_description); $aData = array('group_name' => $group_name, 'description' => $group_description, 'randomization_group' => $_POST['randomization_group'], 'grelevance' => $_POST['grelevance']); $condition = array('gid' => $gid, 'sid' => $surveyid, 'language' => $grplang); $group = QuestionGroup::model()->findByAttributes($condition); foreach ($aData as $k => $v) { $group->{$k} = $v; } $ugresult = $group->save(); if ($ugresult) { $groupsummary = getGroupList($gid, $surveyid); } } } Yii::app()->session['flashmessage'] = gT("Question group successfully saved."); $this->getController()->redirect(array('admin/survey/sa/view/surveyid/' . $surveyid . '/gid/' . $gid)); } }
function tournament() { global $wpdb, $user_identity, $user_ID; header('Content-Type: text/html; charset=' . getCharset() . ''); if (intval($_REQUEST['matchid']) > 0 && intval($_REQUEST['opt']) > 0) { echo "参数错误!"; exit; } $matchid = intval($_REQUEST['matchid']); if (!empty($user_identity)) { $username = htmlspecialchars(addslashes($user_identity)); } else { if (!empty($_COOKIE['comment_author_' . COOKIEHASH])) { $username = htmlspecialchars(addslashes($_COOKIE['comment_author_' . COOKIEHASH])); } else { echo "需要登陆"; exit; } } switch ($_REQUEST['opt']) { case 'apply': if (!getUserVerify($user_ID)) { echo "需要选手认证才可以报名"; exit; } $apply = $wpdb->query("SELECT verify1 FROM pre_common_member_verify WHERE uid = {$user_ID}"); if (count(getUserList($user_ID, $matchid, -1, -1, 1)) > 0) { echo "你已经报过名了"; exit; } updateUser($user_ID, $matchid, -1, -1, 1); if (count(getUserList($user_ID, $matchid, -1, -1, 1)) > 0) { echo "报名成功!"; exit; } echo "报名时发生错误"; exit; case 'cancelapply': updateUser($user_ID, $matchid, -1, -1, 0); echo "报名已取消"; exit; case 'follow': updateUser($user_ID, $matchid, -1, 1); if (count(getUserList($user_ID, $matchid, -1, 1)) > 0) { echo "关注成功!"; exit; } echo "关注时发生错误"; exit; case 'cancelfollow': updateUser($user_ID, $matchid, -1, 0); echo "关注已取消"; exit; case 'cancelgroup': $groupid = intval($_REQUEST['groupid']); $memberid = intval($_REQUEST['memberid']); $users = getUserList($memberid); if (empty($users)) { echo "找不到此用户ID, " . $memberid; exit; } $groups = getGroupList(-1, $groupid); if (empty($groups)) { echo "找不到此队伍ID, " . $groupid; exit; } $matchs = getMatchList($groups[0]->match_id); if (empty($matchs)) { echo "找不到此队伍的比赛ID, error code : " . $groups[0]->match_id; exit; } if ($matchs[0]->stage != 1) { echo "比赛不处于报名阶段,无法退出 . error code : " . $groups[0]->match_id; exit; } if ($groups[0]->captain_id == $user_ID || $memberid == $user_ID) { // 队员离开 updateUser($memberid, $matchid, 0, -1, -1, 0, -1, 0); echo "已退出队伍"; exit; } echo "权限不足."; exit; case 'applygroup': $users = getUserList($user_ID, $matchid); if (!empty($users)) { $groupid = $_REQUEST['groupid']; if (intval($users[0]->apply_group)) { echo "您已经申请了其他的队伍!"; exit; } $groups = getGroupList($matchid, $groupid); if (empty($groups)) { echo "比赛" . $matchid . "中找不到这个队伍!" . $groupid; exit; } $groupusers = getUserList(-1, -1, $groupid); if ($groups[0]->maxpeople - 1 < count($groupusers)) { echo "这个队伍中的人数已经满了!" . $groupid; exit; } updateUser($user_ID, $matchid, $groupid, -1, -1, 1); echo "申请成功!"; exit; } echo "你尚未参加此项比赛!"; exit; case 'passapplygroup': $memberid = intval($_REQUEST['memberid']); $users = getUserList($memberid, $matchid); if (!empty($users)) { $groupid = intval($_REQUEST['groupid']); if ($users[0]->group_id == $groupid) { updateUser($memberid, $matchid, $groupid, -1, -1, 1, -1, 1); echo "通过申请!"; exit; } echo "申请失败!" . $users[0]->group_id . ":" . $groupid; exit; } echo "此用户尚未参加此项比赛!"; exit; case 'creategroup': $users = getUserList($user_ID, $matchid); if (!intval($users[0]->apply_match)) { echo "你尚未参加此项比赛!"; exit; } if (intval($users[0]->apply_group)) { echo "您已经申请了其他的队伍!"; exit; } $groupname = trim($_REQUEST['groupname']); $success = addGroup($groupname, $user_ID, $matchid); if (intval($success)) { $groups = getGroupList($matchid, -1, $user_ID); updateUser($user_ID, $matchid, $groups[0]->id, -1, -1, 1, -1, 1); echo "申请成功!"; exit; } echo "申请发生错误error code : " . $success; exit; case 'ranksubmit': $matchId = intval($_POST['matchId']); $matchTypeId = intval($_POST['matchTypeId']); $scheduleId = intval($_POST['scheduleId']); $applyId = intval(addUserRankApply($user_ID, $matchId, $scheduleId)); if (!$applyId) { echo "申请发生错误, Code:" . $applyId; exit; } $submit = getUserRankApplyList(-1, $user_ID, $matchId, $scheduleId); $rankTypeList = getRankTypeList(-1, $matchTypeId); foreach ($rankTypeList as $rankType) { $value = intval($_POST['rank-' . $rankType->id]); if ($value && $submit[0]->id) { $result = addUserRank($user_ID, $matchTypeId, $rankType->id, $value, 0, $submit[0]->id); if (!$result) { echo "录入信息失败,Code:" . $rankType->id; exit; } } else { echo "录入信息失败,Error Code:" . $value . " AND " . $submit[0]->id; exit; } } echo "提交选手成绩完成"; exit; default: echo "无法解析此函数"; exit; } }
// 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>'; echo $tpl->GetTemplate('grouplist.php'); break; } ?>
/** * Get list of users in a given group * * Effectively, this function is used twice: To get a list of all users currently * in the given group and to get all list of all users NOT in that group. * * @param int $group_id group id * @param boolean $allusers true: return users not in the group * @return string option list containing uids and usernames * */ function grp_selectUsers($group_id, $allusers = false) { global $_TABLES, $_USER; $retval = ''; // Get a list of users in the Root Group and the selected group $sql = "SELECT DISTINCT uid FROM {$_TABLES['users']} LEFT JOIN {$_TABLES['group_assignments']} "; $sql .= "ON {$_TABLES['group_assignments']}.ug_uid = uid WHERE uid > 1 AND "; $sql .= "({$_TABLES['group_assignments']}.ug_main_grp_id = 1 OR {$_TABLES['group_assignments']}.ug_main_grp_id = {$group_id})"; $result = DB_query($sql); $filteredusers = array(); while ($A = DB_fetchArray($result)) { $filteredusers[] = $A['uid']; } $groups = getGroupList($group_id); $grouplist = '(' . implode(',', $groups) . ')'; $sql = "SELECT DISTINCT uid,username FROM {$_TABLES['users']} LEFT JOIN {$_TABLES['group_assignments']} "; $sql .= "ON {$_TABLES['group_assignments']}.ug_uid = uid WHERE uid > 1 AND "; $sql .= "{$_TABLES['group_assignments']}.ug_main_grp_id "; if ($allusers) { $sql .= 'NOT '; } $sql .= "IN {$grouplist} "; // Filter out the users that will be in the selected group if ($allusers) { $filteredusers = implode(',', $filteredusers); $sql .= " AND uid NOT IN ({$filteredusers}) "; } $sql .= "ORDER BY username"; $result = DB_query($sql); $numUsers = DB_numRows($result); for ($i = 0; $i < $numUsers; $i++) { list($uid, $username) = DB_fetchArray($result); $retval .= '<option value="' . $uid . '">' . $username . '</option>'; } return $retval; }
/** * Ändert die rechte eienr Gruppe */ function Group_rights_edit() { if (!$this->userdata['rights']['groupedit']) { #no permission $this->_header("", "no permission"); } $rank = param_num("rank", 1); $gid = param_num("id"); $grouplist = getGroupList(); if (!$grouplist) { $this->_header("", "Keine Gruppen vorhanden"); } if ($gid) { $hasfound = false; for ($i = 0; $i < count($grouplist); $i++) { if ($gid == $grouplist[$i]['gid']) { $hasfound = true; $grouplist[$i]['selected'] = "selected"; break; } } if (!$hasfound) { $this->_header("", "Ungültige gid"); } } else { $grouplist[0]['selected'] = "selected"; $gid = $grouplist[0]['gid']; } $rightslist = listRightsbyGroup($gid); if (!$rightslist) { $this->_header("", "Keine Rechte vorhanden"); } #formular abgeschickt if ($_POST['send'] && $_POST['next_x']) { for ($i = 0; $i < count($rightslist); $i++) { $right =& $rightslist[$i]; #nicht gesetzt und maxlevel überschritten if ($rank > $right['maxrank'] && !$right['isset']) { unset($rightslist[$i]['rid']); continue; } if ($right['isset'] && $right['rank'] < $rank) { $right['disabled'] = "disabled"; $right['vererbt'] = "(vererbt)"; if ($right['isset']) { $right['isset'] = "checked"; } else { $right['notset'] = "checked"; unset($right['isset']); } continue; } if ($_POST["r_" . $right['rid']]) { $right['isset'] = "checked"; $ids[] = $right['rid']; } else { $right['notset'] = "checked"; unset($right['isset']); } } updateRights($gid, $rank, $ids); } else { for ($i = 0; $i < count($rightslist); $i++) { $right =& $rightslist[$i]; #nicht gesetzt und maxlevel überschritten if ($rank > $right['maxrank'] && !$right['isset']) { unset($rightslist[$i]['rid']); # for($j=$i;$j < count($rightslist)-1;$j++){ # $rightslist[$j]= $rightslist[$j+1]; # } continue; } if ($right['isset'] && $right['rank'] < $rank) { $right['disabled'] = "disabled"; $right['vererbt'] = "(vererbt)"; } if ($right['isset'] && $right['rank'] <= $rank) { $right['isset'] = "checked"; } else { $right['notset'] = "checked"; unset($right['isset']); } } } switch ($rank) { case 1: $ebene = "(Global)"; break; case 2: $ebene = "(Allianzebene)"; break; case 3: $ebene = "(Galaxieebene)"; break; } # for($i=0;$i < count($rightslist);$i++){ # echo "rid: ".$rightslist[$i]['rid']."<br>"; # echo "isset: ".$rightslist[$i]['isset']."<br>"; # echo "rank: ".$rightslist[$i]['rank']."<br>"; # echo "descr: ".$rightslist[$i]['descr']."<br>"; # } $this->template->assign("ebene", $ebene); $this->template->assign("grouplist", $grouplist); $this->template->assign("rightslist", $rightslist); $this->template->assign("rank", $rank); $this->template->assign("url", "admin.php"); $this->template->assign("action", "editgrouprights"); $this->show('group_editrights', "Gruppenrechte bearbeiten"); }
/** * RPC Routine to edit question groups * * @access public * @param string $sSessionKey - Auth credentials * @param int $userName - the user to whom the participant belongs to * @param string $email - Participants email * * */ public function set_question_group($sSessionKey, $group_id) { // Check sessionkey if (!$this->_checkSessionKey($sSessionKey)) { return array('status' => 'Invalid session key'); } // Check permissions if (Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'update')) { return array('status' => 'No permission'); } $gid = (int) $gid; $group = QuestionGroup::model()->findByAttributes(array('gid' => $gid)); $surveyid = $group->sid; Yii::app()->loadHelper('surveytranslator'); $grplangs = Survey::model()->findByPk($surveyid)->additionalLanguages; $baselang = Survey::model()->findByPk($surveyid)->language; array_push($grplangs, $baselang); foreach ($grplangs as $grplang) { if (isset($grplang) && $grplang != "") { $group_name = $_POST['group_name_' . $grplang]; $group_description = $_POST['description_' . $grplang]; $group_name = html_entity_decode($group_name, ENT_QUOTES, "UTF-8"); $group_description = html_entity_decode($group_description, ENT_QUOTES, "UTF-8"); // Fix bug with FCKEditor saving strange BR types $group_name = fixCKeditorText($group_name); $group_description = fixCKeditorText($group_description); $aData = array('group_name' => $group_name, 'description' => $group_description, 'randomization_group' => $_POST['randomization_group'], 'grelevance' => $_POST['grelevance']); $condition = array('gid' => $gid, 'sid' => $surveyid, 'language' => $grplang); $group = QuestionGroup::model()->findByAttributes($condition); foreach ($aData as $k => $v) { $group->{$k} = $v; } $ugresult = $group->save(); if ($ugresult) { $groupsummary = getGroupList($gid, $surveyid); } } } }
include GROUP_SCHEDULE_TPL; exit; } if (isset($_GET['teacherId'])) { $teacherId = $_GET['teacherId']; // сохраняем $teacherId для передачи в шаблон // и для последующей записи в URL и возможности отправлять через AJAX-запрос if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $gridParam = getGridParam(); $response = getTeacherSchedule($teacherId, $gridParam['page'], $gridParam['limit'], $gridParam['sidx'], $gridParam['sord']); echo $response; } else { include TEACHER_SCHEDULE_TPL; } } // передаём строку из формы поиска группы if (isset($_POST['group_number'])) { $flag = 'find_group'; // флаг указывающий на сущность, которую ищем $groupNumber = $_POST['group_number']; $response = getGroupList($groupNumber); include RESULT_VIEW; exit; } if (isset($_POST['teacher_surname'])) { $flag = 'find_teacher'; $teacherSurname = $_POST['teacher_surname']; $response = getTeacherListBySurname($teacherSurname); include RESULT_VIEW; exit; }
// the next 2 lines to prevent caching session_start(); header("Cache-control: private"); set_time_limit(60); ini_set('max_execution_time', 60); header("Content-type: text/xml"); include "conntube.php"; //relatetags(); //relateinterests(); $loginId = isset($_REQUEST['loginId']) ? $_REQUEST['loginId'] : ''; $isAdmin = isset($_REQUEST['admin']) ? $_REQUEST['admin'] == 'True' ? True : False : False; $retstring = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; $retstring .= " <Graph>"; $retstring .= " <loginId>{$loginId}</loginId>"; //$retstring .= " <isAdmin>" . ($isAdmin ? 'TRUE' : 'FALSE') . "</isAdmin>"; $retstring = $retstring . getGroupList(); // load the nodetypes $retstring = $retstring . " <NodeTypes>"; $rs = mysql_query("Select * from nodetypes"); while ($row = mysql_fetch_array($rs)) { $retstring = $retstring . " <NodeType name = \"{$row['name']}\" />"; } $retstring = $retstring . " </NodeTypes>"; // load the edgetypes $retstring = $retstring . " <EdgeTypes>"; $rs = mysql_query("Select * from edgetypes"); while ($row = mysql_fetch_array($rs)) { $retstring .= "<EdgeType"; $retstring .= " name = \"{$row['name']}\""; $retstring .= " edgecolor = \"{$row['edgecolor']}\""; $retstring .= " validnodepairs= \"{$row['validnodepairs']}\"/>";
include_once "../lib/ini.setting.php"; include_once "ini.config.php"; include_once "ini.dbstring.php"; include_once "ini.functions.php"; sec_session_start(); include_once "mod.login.php"; // check user role and authentication checkSession($_SESSION['sess_user_role']); checkLogin("admin", $_SESSION['sess_user_role']); $todaydate = explode("-", date("Y-n-j")); $userid = $_SESSION['sess_user_id']; $show = true; include_once "mod.group.php"; include_once "ctrl.group.php"; $glist = getGroupList($db); ?> <html lang="en"> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Kinntai system</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="<?php echo CSS; ?> /import.css" rel="stylesheet" type="text/css"/> <script src="<?php echo JS; ?> /jquery.min.js"></script>
</div> <!--队伍管理--> <div class="tab_main font-size14"> <?php if (!$require_login || !$accept) { echo '<div style="width:360px; height:200px; line-height:200px; font-family:\'微热雅黑\'; font-size:30px; text-align:center; margin:20px auto; border:8px solid #e8e8e8; color:#333; background: #FDFDFD;">权限错误或没有登陆</div>'; } else { ?> <ul class="vs-manage margin-t22"> <?php // $users = getUserList($current_user -> ID, $matchid); if (empty($users)) { echo "您还未参加此场比赛"; } else { if (intval($users[0]->apply_group)) { $groups = getGroupList(-1, $users[0]->group_id); echo '<li>' . $groups[0]->name . '</li>'; $userList = getUserList(-1, -1, $users[0]->group_id); if ($groups[0]->captain_id == 0) { echo '<li><span>队长 : 系统管理员</span>'; } foreach ($userList as $groupuser) { $user = get_user_by('id', $groupuser->uid); if ($groups[0]->captain_id == $current_user->ID) { // 队长模式 if ($groups[0]->captain_id == $groupuser->uid) { echo '<li><span>队长 : ' . $user->user_login . '</span>'; } else { echo '<li><span>队员 : ' . $user->user_login . '</span>'; } if ($groupuser->uid != $current_user->ID) {
$succe = delUser($userId, $matchId); if ($succe != 1) { echo "删除选手失败"; return; } echo "删除选手完成"; break; // Update // Update case 'update': break; // Main Page // Main Page default: $groupId = 0; $groupId = intval($_GET['groupId']); if ($groupId != 0) { $groups = getGroupList(0, $groupId); $tpl->SetVar('group', $groups[0]); $userList = getUserList(-1, $groups[0]->match_id, $groupId); $notgroupmember = getUserList(-1, $groups[0]->match_id, 0); $tpl->SetVar('notgroupmember', $notgroupmember); } else { $userList = getUserList(0); } $tpl->SetVar('members', $userList); $tpl->SetVar('paging', count($userList) / 20); echo '<h2>' . '选手列表' . '</h2>'; echo $tpl->GetTemplate('memberlist.php'); break; }
protected function groupSelect() { $this->add_onload_command("\$('select.form-control').focus();\n"); $ret = '<div class="form-group"> <label>Group</label> <select name="id" class="form-control">'; foreach (getGroupList() as $uid => $name) { $ret .= "<option>" . $name . "</option>"; } $ret .= '</select></div>'; return $ret; }
getHospitalLegaleseTimestamps("1"); case '1.9.5': reportPerson($personXML, $eventShortname, $xmlFormat, $user, $pass); createPersonUuid($user, $pass); createPersonUuidBatch($number, $user, $pass); createNoteUuid($user, $pass); createNoteUuidBatch($number, $user, $pass); search("test", "t"); searchWithAuth("test", "t", $user, $pass); getSessionTimeout(); registerUser("testCaseUser", "*****@*****.**", "testPassword99", "testCaseGiven", "testCaseFamily"); changeUserPassword($user, $pass, $pass); forgotUsername($email); checkUserAuth($user, $pass); getUserStatus($user); getUserGroup($user); getEventList(); getEventListUser($user, $pass); getGroupList(); getHospitalList(); getHospitalData("1"); getHospitalPolicy("1"); } echo "</table><b>Note: deprecated functions are not listed/tested.</b></body>"; }
<input name="userId" type="hidden" value="<?php echo $user->uid; ?> " /> <input name="matchTypeId" type="hidden" value="<?php echo $currentMatchTypeId; ?> " /> <input name="category" type="hidden" value="update" /> <input type="submit" name="submit" id="submit" value="审核" /> </td> <td><?php if ($user->submitId) { $userRankApplys = getUserRankApplyList($user->submitId); if (intval($userRankApplys)) { $groups = getGroupList($scheduleList[0]->mid, OBJECT_K); $scheduleList = getScheduleList($userRankApplys[0]->scheduleId); echo $groups[$scheduleList[0]->sgid]->name . " Vs " . $groups[$scheduleList[0]->ngid]->name . " / "; echo $scheduleList[0]->begin . " " . $scheduleList[0]->end . " 论次:" . $scheduleList[0]->round; } } else { echo "系统生成"; } ?> </td> </form> </tr> <?php } ?> </tbody>