コード例 #1
0
ファイル: AdminModel.class.php プロジェクト: sysuzjz/soya
 /**
  * Team statecode += 1
  * @param string team id
  */
 public function go_on($team_id)
 {
     $team = DBModel::getTeamDetail($team_id);
     $cond['id'] = $team['team']['id'];
     $data['statecode'] = (int) $team['team']['statecode'] + 1;
     DBModel::updateDB('cernet_team', $cond, $data);
     foreach ($team['teammate'] as $k => $v) {
         $cond = $_data = array();
         $_data['statecode'] = $data['statecode'];
         $cond['id'] = $v['id'];
         DBModel::updateDB('cernet_user', $cond, $_data);
     }
 }
コード例 #2
0
ファイル: DBModel.class.php プロジェクト: sysuzjz/soya
 /**
  * Get full invitation details.
  * @param array An entry of cernet_teammate
  */
 public static function getFullInvitation($invitation)
 {
     $info = DBModel::getTeamDetail($invitation['team_id']);
     $res = $invitation;
     $res['leadername'] = $info['leader']['name'];
     $res['teamname'] = $info['team']['name'];
     return $res;
 }
コード例 #3
0
ファイル: UserAction.class.php プロジェクト: sysuzjz/soya
 /**
  * Create report page.
  */
 public function new_report()
 {
     eval(USER);
     $team = DBModel::getTeamDetail(DBModel::getTeamByUser(session('userid')));
     $types = DBModel::getByFields('cernet_report_type');
     $this->assign('type', $types);
     $this->assign('team', $team);
     $this->assign("less", __FUNCTION__ . ".less");
     eval(NDSP);
 }
コード例 #4
0
ファイル: AdminAction.class.php プロジェクト: sysuzjz/soya
 /**
  * Admin can manage one team here.
  */
 public function team()
 {
     eval(ADMIN);
     try {
         $team_id = xassert(safeget("show"), Error("get"));
         $res = DBModel::getTeamDetail($team_id);
         $tutorlist = DBModel::getByFields('cernet_tutor');
         $types = DBModel::getByFields('cernet_report_type');
         $this->assign('type', $types);
         $this->assign('tutorlist', json_encode($tutorlist));
         $this->assign('teamData', $res);
         $this->assign('mates', $res['teammate']);
         $this->assign('report', $res['report']);
     } catch (Exception $e) {
         throw_exception($e->getMessage());
     }
     $this->assign("less", __FUNCTION__ . ".less");
     eval(NDSP);
 }