• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Contest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Contest的典型用法代码示例。如果您正苦于以下问题:PHP Contest类的具体用法?PHP Contest怎么用?PHP Contest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: createContest

 static function createContest($data)
 {
     require_once "common.php";
     $data = Filter::filterArray($data);
     $c = new Contest($data);
     $c->save();
     return $c;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:8,代码来源:common.php


示例2: readParameters

 /**
  * @see Action::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (!MODULE_CONTEST) {
         throw new IllegalLinkException();
     }
     $this->contestID = intval($_REQUEST['contestID']);
     if (isset($_REQUEST['contestAction'])) {
         $this->contestAction = $_REQUEST['contestAction'];
     }
     $this->contest = new Contest($this->contestID);
     if (!$this->contest->isViewable()) {
         throw new IllegalLinkException();
     }
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:18,代码来源:ContestPromotionAction.class.php


示例3: assignVariables

 /**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     // save ratings
     if ($this->solutionObj->isRateable()) {
         require_once WCF_DIR . 'lib/form/ContestSolutionRatingUpdateForm.class.php';
         new ContestSolutionRatingUpdateForm($this->solutionObj);
     }
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestSolutionCommentEditForm.class.php';
         new ContestSolutionCommentEditForm($this->solutionObj);
     } else {
         if ($this->entry->isCommentable()) {
             require_once WCF_DIR . 'lib/form/ContestSolutionCommentAddForm.class.php';
             new ContestSolutionCommentAddForm($this->solutionObj);
         }
     }
     if (!$this->entry->enableOpenSolution && $this->entry->state != 'closed' && ($this->entry->state != 'scheduled' || !($this->entry->fromTime < TIME_NOW && TIME_NOW < $this->entry->untilTime))) {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableOpenSolution.info') . '</p>');
     }
     if ($this->entry->enableParticipantCheck) {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableParticipantCheck.info') . '</p>');
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'solutionObj' => $this->solutionObj, 'contestID' => $this->contestID, 'solutionID' => $this->solutionID, 'userID' => $this->entry->userID, 'comments' => $this->commentList->getObjects(), 'ratings' => $this->ratingList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'attachments' => $this->attachments, 'contestmenu' => ContestMenu::getInstance()));
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:33,代码来源:ContestSolutionEntryPage.class.php


示例4: actionShow

 public function actionShow($id)
 {
     $model = Contest::model()->findByPk((int) $id);
     if (is_null($model)) {
         throw new CHttpException(404, Yii::t('contest', 'Страница не найдена!'));
     }
     $image = new Image();
     if (Yii::app()->request->isPostRequest && isset($_POST['Image'])) {
         $transaction = Yii::app()->db->beginTransaction();
         try {
             $image = $image->create($_POST['Image']);
             if (!$image->hasErrors()) {
                 if ($model->addImage($image)) {
                     Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('contest', 'Фотография добавлена!'));
                 }
                 $transaction->commit();
                 $this->redirect(array('/contest/contest/show/', 'id' => $model->id));
             }
             throw new CDbException(Yii::t('contest', 'При добавлении изображения произошла ошибка!'));
         } catch (Exception $e) {
             $transaction->rollback();
             Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, Yii::t('contest', $e->getMessage()));
         }
     }
     $dataProvider = new CActiveDataProvider('ImageToContest', array('criteria' => array('condition' => 'contest_id = :contest_id', 'params' => array(':contest_id' => $model->id), 'limit' => self::CONTEST_PER_PAGE, 'order' => 't.creation_date DESC', 'with' => 'image'), 'pagination' => array('pageSize' => self::CONTEST_PER_PAGE)));
     $this->render('show', array('image' => $image, 'dataProvider' => $dataProvider, 'model' => $model));
 }
开发者ID:RSol,项目名称:yupe,代码行数:27,代码来源:ContestController.php


示例5: actionStats

 public function actionStats($id)
 {
     if (!($model = Contest::model()->with(array('fields'))->findByPk($id))) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $this->render('stats', array('model' => $model));
 }
开发者ID:kostya1017,项目名称:our,代码行数:7,代码来源:AdminresultsController.php


示例6: getRecipients

 /**
  * @see ContestNotificationInterface::getRecipients()
  */
 public function getRecipients()
 {
     $ids = array();
     switch ($this->state) {
         // tell contest owner that s.o. did apply
         case 'applied':
             require_once WCF_DIR . 'lib/data/contest/Contest.class.php';
             $contest = Contest::getInstance($this->contestID);
             $ids = array_merge($ids, $contest->getOwner()->getUserIDs());
             break;
         case 'invited':
             $ids = array_merge($ids, $this->getInstance()->getOwner()->getUserIDs());
             break;
             // tell recipient that s.o. did moderator interaction
         // tell recipient that s.o. did moderator interaction
         case 'accepted':
             $ids = array_merge($ids, $this->getInstance()->getOwner()->getUserIDs());
             // maybe the user applied himself, then tell the owners
             require_once WCF_DIR . 'lib/data/contest/Contest.class.php';
             $contest = Contest::getInstance($this->contestID);
             if ($contest->enableSponsorCheck == false) {
                 $ids = array_merge($ids, $contest->getOwner()->getUserIDs());
             }
             break;
     }
     return array_unique($ids);
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:30,代码来源:ContestSponsorNotificationObject.class.php


示例7: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Contest::create([]);
     }
 }
开发者ID:inseo201,项目名称:atletik4,代码行数:7,代码来源:ContestsTableSeeder.php


示例8: Insert

 public function Insert(Contest $data)
 {
     try {
         $query = "INSERT INTO Concursos (id_type, name, question, initial_date, final_date, winner, active)\n                          VALUES (?, ?, ?, ?, ?, ?, ?)";
         $this->pdo->prepare($query)->execute(array($data->__GET('id_type'), $data->__GET('name'), $data->__GET('question'), $data->__GET('initial_date'), $data->__GET('final_date'), $data->__GET('winner'), $data->__GET('active')));
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
开发者ID:Gonxis,项目名称:TOMO2_Project,代码行数:9,代码来源:ContestModel.php


示例9: close

 /**
  * finish the contest
  */
 public function close()
 {
     if (!($this->contest->state == 'scheduled' && $this->contest->untilTime < time())) {
         throw new Exception('contest needs to be scheduled, and time has to be over.');
     }
     // make a jury instance from the contst owner
     $jury = ContestJury::find($this->contest->contestID, $this->contest->userID, $this->contest->groupID);
     if ($jury === null) {
         $jury = ContestJuryEditor::create($this->contest->contestID, $this->contest->userID, $this->contest->groupID, $state = 'accepted');
     }
     $userID = $this->contest->userID;
     if ($userID == 0 && $this->contest->groupID > 0) {
         $sql = "SELECT          userID\n\t\t\t\tFROM            wcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE           groupID = " . intval($this->contest->groupID);
         $row = WCF::getDB()->getFirstRow($sql);
         $userID = $row['userID'];
     }
     if (!$userID) {
         throw new Exception('cannot determine a user from which the ratings will be added.');
     }
     $classIDs = array_keys($this->contest->getClasses());
     $ratingoptionIDs = array_keys(ContestRatingoption::getByClassIDs($classIDs));
     if (empty($ratingoptionIDs)) {
         throw new Exception('cannot determine a ratingoption from classes [' . implode(',', $classIDs) . '] needed for contest ratings to be added.');
     }
     // get interactions
     $interactionList = new ContestInteractionList($this->contest);
     $interactionList->sqlLimit = 0;
     $interactionList->readObjects();
     $owners = $interactionList->getObjects();
     foreach ($owners as $owner) {
         $this->sum += $owner->c;
     }
     // get prices
     $priceList = new ContestPriceList();
     $priceList->sqlConditions .= 'contest_price.state = "accepted" AND contest_price.contestID = ' . intval($this->contest->contestID);
     $priceList->sqlLimit = 0;
     $priceList->readObjects();
     $score = 5 + $priceList->countObjects();
     foreach ($priceList->getObjects() as $price) {
         // choose a winner
         $owner = $this->chooseWinner($price, $owners);
         // error, there are more prices than participants
         if (!$owner) {
             throw new Exception('there are more prices than participants.');
         }
         $lang = 'wcf.contest.interaction.tickets.solution';
         $message = WCF::getLanguage()->getDynamicVariable($lang, array('tickets' => $owner->c));
         // create pseudo solution
         $solution = ContestSolutionEditor::create($this->contest->contestID, $owner->participantID, $message, $state = 'accepted');
         foreach ($ratingoptionIDs as $ratingOptionID) {
             // create pseudo rating
             $rating = ContestSolutionRatingEditor::create($solution->solutionID, $ratingOptionID, $score, $userID);
         }
         // decrease score
         $score--;
     }
     // close contest state
     $this->contest->getEditor()->updateState('closed');
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:62,代码来源:ContestInteraction.class.php


示例10: execute

 public function execute()
 {
     if (!ContestSettings::get('contestDeletionEnabled')) {
         $this->dieUsage('Contest deletion is disabled', 'contestdeletiondisabled');
     }
     global $wgUser;
     if (!$wgUser->isAllowed('contestadmin') || $wgUser->isBlocked()) {
         $this->dieUsageMsg(array('badaccess-groups'));
     }
     $params = $this->extractRequestParams();
     $everythingOk = true;
     foreach ($params['ids'] as $id) {
         $contest = new Contest(array('id' => $id));
         $everythingOk = $contest->removeAllFromDB() && $everythingOk;
     }
     $this->getResult()->addValue(null, 'success', $everythingOk);
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:17,代码来源:ApiDeleteContest.php


示例11: readObjects

 /**
  * @see DatabaseObjectList::readObjects()
  */
 public function readObjects()
 {
     $sql = "SELECT\t\t" . (!empty($this->sqlSelects) ? $this->sqlSelects . ',' : '') . "\n\t\t\t\t\tuser_table.username, contest.*\n\t\t\tFROM\t\twcf" . WCF_N . "_contest contest\n\t\t\tLEFT JOIN\twcf" . WCF_N . "_user user_table\n\t\t\tON\t\t(user_table.userID = contest.userID)\n\t\t\t" . $this->sqlJoins . "\n\t\t\t" . (!empty($this->sqlConditions) ? "WHERE (" . $this->sqlConditions . ")" : '') . "\n\t\t\tAND (" . Contest::getStateConditions() . ")\n\t\t\t" . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : '');
     $result = WCF::getDB()->sendQuery($sql, $this->sqlLimit, $this->sqlOffset);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->entries[] = new ContestFeedEntry(null, $row);
     }
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:11,代码来源:ContestFeedEntryList.class.php


示例12: isDeletable

 /**
  * Returns true, if the active user can delete this entry.
  * 
  * @return	boolean
  */
 public function isDeletable()
 {
     $contest = Contest::getInstance($this->contestID);
     if ($contest->isOwner()) {
         return true;
     }
     return false;
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:13,代码来源:ContestEvent.class.php


示例13: getStates

 /**
  * returns available states
  */
 protected function getStates()
 {
     $flags = (!isset($this->entry) || $this->entry->isOwner() ? ContestState::FLAG_USER : 0) + ($this->contest->isOwner() ? ContestState::FLAG_CONTESTOWNER : 0) + (ContestCrew::isMember() ? ContestState::FLAG_CREW : 0);
     if (isset($this->entry) && $this->entry->enableOpenSolution) {
         $flags += ContestSolutionEditor::FLAG_OPENSOLUTION;
     }
     return ContestSolutionEditor::getStates(isset($this->entry) ? $this->entry->state : '', $flags);
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:11,代码来源:ContestSolutionAddForm.class.php


示例14: readObjects

 /**
  * @see DatabaseObjectList::readObjects()
  */
 public function readObjects()
 {
     $sql = "SELECT\t\t" . (!empty($this->sqlSelects) ? $this->sqlSelects . ',' : '') . "\n\t\t\t\t\tcontest.*\n\t\t\tFROM\t\twcf" . WCF_N . "_contest contest\n\t\t\t" . $this->sqlJoins . "\n\n\t\t\tWHERE\t\t(" . Contest::getStateConditions() . ")\n\t\t\t" . (!empty($this->sqlConditions) ? "AND " . $this->sqlConditions : '') . "\n\t\t\t" . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : '');
     $result = WCF::getDB()->sendQuery($sql, $this->sqlLimit, $this->sqlOffset);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->entries[] = new Contest(null, $row);
     }
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:11,代码来源:ContestList.class.php


示例15: readParameters

 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get entry
     if (isset($_REQUEST['contestID'])) {
         $this->contestID = intval($_REQUEST['contestID']);
     }
     $this->entry = new ViewableContest($this->contestID);
     if (!$this->entry->isViewable()) {
         throw new IllegalLinkException();
     }
     // validation
     if ($this->entry->enableInteraction == 0) {
         throw new Exception('invalid contest type');
     }
     // init price list
     $this->interactionList = new ContestInteractionList($this->entry);
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:21,代码来源:ContestInteractionPage.class.php


示例16: getRecipients

 /**
  * @see ContestNotificationInterface::getRecipients()
  */
 public function getRecipients()
 {
     $ids = array();
     // tell all jury members, that a new entry exists
     require_once WCF_DIR . 'lib/data/contest/Contest.class.php';
     $contest = Contest::getInstance($this->contestID);
     foreach ($contest->getJurys() as $jury) {
         $ids = array_merge($ids, $jury->getOwner()->getUserIDs());
     }
     return array_unique($ids);
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:14,代码来源:ContestJurytalkNotificationObject.class.php


示例17: readObjectIDArray

 /**
  * Gets the object ids.
  */
 protected function readObjectIDArray()
 {
     $sql = "SELECT\t\tcontest.contestID, contest.attachments\n\t\t\tFROM\t\twcf" . WCF_N . "_contest contest\n\t\t\t\t" . $this->sqlJoins . "\n\t\t\tWHERE (" . Contest::getStateConditions() . ")\n\t\t\t" . (!empty($this->sqlConditions) ? "AND (" . $this->sqlConditions . ")" : '') . "\n\t\t\t" . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : '');
     $result = WCF::getDB()->sendQuery($sql, $this->sqlLimit, $this->sqlOffset);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->objectIDArray[] = $row['contestID'];
         if ($row['attachments']) {
             $this->attachmentEntryIDArray[] = $row['contestID'];
         }
     }
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:14,代码来源:ViewableContestList.class.php


示例18: execute

 public function execute()
 {
     global $wgUser;
     if (!$wgUser->isAllowed('contestadmin') || $wgUser->isBlocked()) {
         $this->dieUsageMsg(array('badaccess-groups'));
     }
     $params = $this->extractRequestParams();
     $everythingOk = true;
     $contestIds = is_null($params['contestids']) ? array() : $params['contestids'];
     $challengeIds = is_null($params['challengeids']) ? array() : $params['challengeids'];
     if (!is_null($params['challengetitles'])) {
         $challenges = ContestChallenge::s()->select('id', array('title' => $params['challengetitles']));
         if ($challenges === false) {
             // TODO: error
         }
         foreach ($challenges as $challenge) {
             $challengeIds[] = $challenge->getId();
         }
     }
     if (!is_null($params['contestnames'])) {
         $contests = Contest::s()->select('id', array('name' => $params['contestnames']));
         if ($contests === false) {
             // TODO: error
         }
         foreach ($contests as $contest) {
             $contestIds[] = $contest->getId();
         }
     }
     $conditions = array();
     if (count($contestIds) > 0) {
         $conditions['contest_id'] = $contestIds;
     }
     if (count($challengeIds) > 0) {
         $conditions['challenge_id'] = $challengeIds;
     }
     if (!is_null($params['ids']) && count($params['ids']) > 0) {
         $conditions['id'] = $params['ids'];
     }
     $contestants = ContestContestant::s()->select(array('id', 'user_id', 'contest_id', 'email'), $conditions);
     $contestantCount = count($contestants);
     if ($contestants !== false && $contestantCount > 0) {
         $setSize = ContestSettings::get('reminderJobSize');
         $limit = count($contestants);
         for ($i = 0; $i <= $limit; $i += $setSize) {
             $this->createReminderJob(array_slice($contestants, $i, $setSize));
         }
     } else {
         $everythingOk = false;
     }
     $this->getResult()->addValue(null, 'success', $everythingOk);
     if ($everythingOk) {
         $this->getResult()->addValue(null, 'contestantcount', $contestantCount);
     }
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:54,代码来源:ApiMailContestants.php


示例19: readObjectIDArray

 /**
  * Gets the object ids.
  */
 protected function readObjectIDArray()
 {
     $sql = "SELECT\t\tcontest.contestID, contest.attachments\n\t\t\tFROM\t\twcf" . WCF_N . "_tag_to_object tag_to_object,\n\t\t\t\t\twcf" . WCF_N . "_contest contest\n\t\t\tWHERE\t\ttag_to_object.tagID = " . intval($this->tagID) . "\n\t\t\t\t\tAND tag_to_object.taggableID = " . $this->taggable->getTaggableID() . "\n\t\t\t\t\tAND contest.contestID = tag_to_object.objectID\n\t\t\t\t\t" . (!empty($this->sqlConditions) ? "AND " . $this->sqlConditions : '') . "\n\t\t\t\t\tAND (" . Contest::getStateConditions() . ")\n\t\t\t" . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : '');
     $result = WCF::getDB()->sendQuery($sql, $this->sqlLimit, $this->sqlOffset);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->objectIDArray[] = $row['contestID'];
         if ($row['attachments']) {
             $this->attachmentEntryIDArray[] = $row['contestID'];
         }
     }
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:14,代码来源:TaggedContestList.class.php


示例20: index

 public function index()
 {
     // $this->layout->content =
     if (Sentry::getUser()->hasPermission('admin')) {
         return View::make('dashboard.indexadmin')->withtitle("Dashboard Admin");
     } elseif (Sentry::getUser()->hasPermission('panitia')) {
         return View::make('dashboard.indexadmin')->withtitle("Dashboard Panitia");
     } elseif (Sentry::getUser()->hasPermission('user')) {
         $menu = Menu::where('tipe', Sentry::getUser()->last_name)->get();
         $jenjang = Sentry::getUser()->last_name;
         if ($jenjang === 'SMA') {
             $runpas = Contest::where('nocontest', 'Lari 100m pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $runpis = Contest::where('nocontest', 'Lari 100m pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ljpas = Contest::where('nocontest', 'Lompat Jauh pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ljpis = Contest::where('nocontest', 'Lompat Jauh pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $tppas = Contest::where('nocontest', 'Tolak Peluru pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $tppis = Contest::where('nocontest', 'Tolak Peluru pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ltpas = Contest::where('nocontest', 'Lompat Tinggi pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ltpis = Contest::where('nocontest', 'Lompat Tinggi pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $juma = Contest::where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $jumpa = $runpas + $ljpas + $tppas + $ltpas;
             $jumpi = $runpis + $ljpis + $tppis + $ltpis;
             return View::make('dashboard.indexuser')->withtitle("Dashboard User")->with('menu', $menu)->with('runpas', $runpas)->with('runpis', $runpis)->with('ljpas', $ljpas)->with('ljpis', $ljpis)->with('tppas', $tppas)->with('tppis', $tppis)->with('ltpas', $ltpas)->with('ltpis', $ltpis)->with('juma', $juma)->with('jumpa', $jumpa)->with('jumpi', $jumpi);
         } elseif ($jenjang === 'SMP') {
             $runpas = Contest::where('nocontest', 'Lari 60m pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $runpis = Contest::where('nocontest', 'Lari 60m pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ljpas = Contest::where('nocontest', 'Lompat Jauh pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ljpis = Contest::where('nocontest', 'Lompat Jauh pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $tppas = Contest::where('nocontest', 'Tolak Peluru pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $tppis = Contest::where('nocontest', 'Tolak Peluru pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ltpas = Contest::where('nocontest', 'Lompat Tinggi pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ltpis = Contest::where('nocontest', 'Lompat Tinggi pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $juma = Contest::where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $jumpa = $runpas + $ljpas + $tppas + $ltpas;
             $jumpi = $runpis + $ljpis + $tppis + $ltpis;
             return View::make('dashboard.indexuser')->withtitle("Dashboard User")->with('menu', $menu)->with('runpas', $runpas)->with('runpis', $runpis)->with('ljpas', $ljpas)->with('ljpis', $ljpis)->with('tppas', $tppas)->with('tppis', $tppis)->with('ltpas', $ltpas)->with('ltpis', $ltpis)->with('juma', $juma)->with('jumpa', $jumpa)->with('jumpi', $jumpi);
         } elseif ($jenjang === 'SD') {
             $runpas = Contest::where('nocontest', 'Lari 50m pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $runpis = Contest::where('nocontest', 'Lari 50m pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ljpas = Contest::where('nocontest', 'Lompat Jauh pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $ljpis = Contest::where('nocontest', 'Lompat Jauh pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $lbpas = Contest::where('nocontest', 'Lempar Bola pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $lbpis = Contest::where('nocontest', 'Lempar Bola pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $lespa = Contest::where('nocontest', 'Lari Estafet pa')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $lespi = Contest::where('nocontest', 'Lari Estafet pi')->where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $juma = Contest::where('user_id', Sentry::getUser()->id)->where(DB::raw('tahun'), '=', date('Y'))->count();
             $jumpa = $runpas + $ljpas + $lbpas + $lespa;
             $jumpi = $runpis + $ljpis + $lbpis + $lespi;
             return View::make('dashboard.indexuser')->withtitle("Dashboard User")->with('menu', $menu)->with('runpas', $runpas)->with('runpis', $runpis)->with('ljpas', $ljpas)->with('ljpis', $ljpis)->with('lbpas', $lbpas)->with('lbpis', $lbpis)->with('lespa', $lespa)->with('lespi', $lespi)->with('juma', $juma)->with('jumpa', $jumpa)->with('jumpi', $jumpi);
         }
     }
 }
开发者ID:inseo201,项目名称:atletik4,代码行数:52,代码来源:HomeController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Context类代码示例发布时间:2022-05-23
下一篇:
PHP ContentPeer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap