예제 #1
0
 /**
  * index首页
  *
  */
 public function index()
 {
     $nlist = $this->noticeList();
     $model = new ContestModel();
     $this->assign('banner', $model->getBanner());
     $this->assign('list', $nlist[0]);
     $this->assign('page', $nlist[1]);
     $this->assign("less", __FUNCTION__ . ".less");
     eval(NDSP);
 }
예제 #2
0
 /**
  * Return the corresponding page by the stage.
  */
 public function currentstage()
 {
     eval(USER);
     try {
         # Get current stage
         $model = D('cernet_user');
         $conf['username'] = session('username');
         $res = $model->where($conf)->find();
         $res = xassert($res, Error('select'));
         // $cond['id'] = DBModel::getTeamByUser(session('userid'));
         // $team = DBModel::getByFields('cernet_team', $cond);
         $state = $res['statecode'];
         # Get current stage page html
         // $model = D('cernet_stagepage');
         // $conf = array();
         // $conf['cernet_stagepage.id'] = $stage;
         // $res = xassert($model->where($conf)->find(), Error('select'));
         // $html = $res['html'];
         $this->state((int) $state);
         # Assign page
         $this->assign('userstate', 'User:state' . $state);
         $this->assign('state', $state);
         $model = new ContestModel();
         $this->assign('banner', $model->getBanner());
         //$this->assign('current_html', $html);
     } catch (Exception $e) {
         throw_exception($e->getMessage());
     }
     $this->assign("less", __FUNCTION__ . ".less");
     #		eval(NDSP);
     $this->display();
 }