當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Paginator::getFirstIndex方法代碼示例

本文整理匯總了PHP中Paginator::getFirstIndex方法的典型用法代碼示例。如果您正苦於以下問題:PHP Paginator::getFirstIndex方法的具體用法?PHP Paginator::getFirstIndex怎麽用?PHP Paginator::getFirstIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Paginator的用法示例。


在下文中一共展示了Paginator::getFirstIndex方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getTemplateParameters

 /**
  * (non-PHPdoc)
  * @see IModel::getTemplateParameters()
  */
 public function getTemplateParameters()
 {
     // get team info
     $teamId = NationalteamsDataService::getNationalTeamManagedByCurrentUser($this->_websoccer, $this->_db);
     if (!$teamId) {
         throw new Exception($this->_i18n->getMessage("nationalteams_user_requires_team"));
     }
     $result = $this->_db->querySelect("name", $this->_websoccer->getConfig("db_prefix") . "_verein", "id = %d", $teamId);
     $team = $result->fetch_array();
     $result->free();
     // query players
     $firstName = $this->_websoccer->getRequestParameter("fname");
     $lastName = $this->_websoccer->getRequestParameter("lname");
     $position = $this->_websoccer->getRequestParameter("position");
     $mainPosition = $this->_websoccer->getRequestParameter("position_main");
     $playersCount = NationalteamsDataService::findPlayersCount($this->_websoccer, $this->_db, $team["name"], $teamId, $firstName, $lastName, $position, $mainPosition);
     // setup paginator
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($playersCount, $eps, $this->_websoccer);
     $paginator->addParameter("fname", $firstName);
     $paginator->addParameter("lname", $lastName);
     $paginator->addParameter("position", $position);
     $paginator->addParameter("position_main", $mainPosition);
     $paginator->addParameter("search", "true");
     // get players records
     if ($playersCount > 0) {
         $players = NationalteamsDataService::findPlayers($this->_websoccer, $this->_db, $team["name"], $teamId, $firstName, $lastName, $position, $mainPosition, $paginator->getFirstIndex(), $eps);
     } else {
         $players = array();
     }
     return array("team_name" => $team["name"], "playersCount" => $playersCount, "players" => $players, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:36,代碼來源:FindNationalPlayersModel.class.php

示例2: getTemplateParameters

 /**
  * (non-PHPdoc)
  * @see IModel::getTemplateParameters()
  */
 public function getTemplateParameters()
 {
     $teamId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     // last training executions
     $lastExecution = TrainingDataService::getLatestTrainingExecutionTime($this->_websoccer, $this->_db, $teamId);
     $unitsCount = TrainingDataService::countRemainingTrainingUnits($this->_websoccer, $this->_db, $teamId);
     $paginator = null;
     $trainers = null;
     // has valid training unit?
     $training_unit = TrainingDataService::getValidTrainingUnit($this->_websoccer, $this->_db, $teamId);
     if (!isset($training_unit["id"])) {
         // get trainers
         $count = TrainingDataService::countTrainers($this->_websoccer, $this->_db);
         $eps = $this->_websoccer->getConfig("entries_per_page");
         $paginator = new Paginator($count, $eps, $this->_websoccer);
         if ($count > 0) {
             $trainers = TrainingDataService::getTrainers($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps);
         }
     } else {
         $training_unit["trainer"] = TrainingDataService::getTrainerById($this->_websoccer, $this->_db, $training_unit["trainer_id"]);
     }
     // collect effects of executed training unit
     $trainingEffects = array();
     $contextParameters = $this->_websoccer->getContextParameters();
     if (isset($contextParameters["trainingEffects"])) {
         $trainingEffects = $contextParameters["trainingEffects"];
     }
     return array("unitsCount" => $unitsCount, "lastExecution" => $lastExecution, "training_unit" => $training_unit, "trainers" => $trainers, "paginator" => $paginator, "trainingEffects" => $trainingEffects);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:33,代碼來源:TrainingModel.class.php

示例3: getTemplateParameters

 public function getTemplateParameters()
 {
     $clubId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     $count = YouthMatchesDataService::countMatchesOfTeam($this->_websoccer, $this->_db, $clubId);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     $matches = YouthMatchesDataService::getMatchesOfTeam($this->_websoccer, $this->_db, $clubId, $paginator->getFirstIndex(), $eps);
     return array("matches" => $matches, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:9,代碼來源:YouthMatchesModel.class.php

示例4: getTemplateParameters

 public function getTemplateParameters()
 {
     YouthPlayersDataService::deleteInvalidOpenMatchRequests($this->_websoccer, $this->_db);
     $count = YouthPlayersDataService::countMatchRequests($this->_websoccer, $this->_db);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     $requests = YouthPlayersDataService::getMatchRequests($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps);
     return array("requests" => $requests, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:9,代碼來源:YouthMatchRequestsModel.class.php

示例5: getTemplateParameters

 public function getTemplateParameters()
 {
     $positionFilter = $this->_websoccer->getRequestParameter("position");
     $count = YouthPlayersDataService::countTransferableYouthPlayers($this->_websoccer, $this->_db, $positionFilter);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($positionFilter != null) {
         $paginator->addParameter("position", $positionFilter);
     }
     $players = YouthPlayersDataService::getTransferableYouthPlayers($this->_websoccer, $this->_db, $positionFilter, $paginator->getFirstIndex(), $eps);
     return array("players" => $players, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:12,代碼來源:YouthMarketplaceModel.class.php

示例6: getTemplateParameters

 public function getTemplateParameters()
 {
     $matches = array();
     $paginator = null;
     $count = MatchesDataService::countTodaysMatches($this->_websoccer, $this->_db);
     if ($count) {
         $eps = $this->_websoccer->getConfig("entries_per_page");
         $paginator = new Paginator($count, $eps, $this->_websoccer);
         $matches = MatchesDataService::getTodaysMatches($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps);
     }
     return array("matches" => $matches, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:12,代碼來源:TodaysMatchesModel.class.php

示例7: getTemplateParameters

 public function getTemplateParameters()
 {
     $count = MessagesDataService::countInboxMessages($this->_websoccer, $this->_db);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($count > 0) {
         $messages = MessagesDataService::getInboxMessages($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps);
     } else {
         $messages = array();
     }
     return array("messages" => $messages, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:12,代碼來源:MessagesInboxModel.class.php

示例8: getTemplateParameters

 public function getTemplateParameters()
 {
     $count = UsersDataService::countActiveUsersWithHighscore($this->_websoccer, $this->_db);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($count > 0) {
         $users = UsersDataService::getActiveUsersWithHighscore($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps);
     } else {
         $users = array();
     }
     return array("users" => $users, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:12,代碼來源:HighscoreModel.class.php

示例9: getTemplateParameters

 /**
  * (non-PHPdoc)
  * @see IModel::getTemplateParameters()
  */
 public function getTemplateParameters()
 {
     $userId = $this->_websoccer->getUser()->id;
     $count = PremiumDataService::countAccountStatementsOfUser($this->_websoccer, $this->_db, $userId);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($count > 0) {
         $statements = PremiumDataService::getAccountStatementsOfUser($this->_websoccer, $this->_db, $userId, $paginator->getFirstIndex(), $eps);
     } else {
         $statements = array();
     }
     return array("statements" => $statements, "paginator" => $paginator, "payments" => PremiumDataService::getPaymentsOfUser($this->_websoccer, $this->_db, $userId, 5));
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:17,代碼來源:PremiumAccountModel.class.php

示例10: getTemplateParameters

 public function getTemplateParameters()
 {
     $clubId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     $offers = array();
     $count = DirectTransfersDataService::countReceivedOffers($this->_websoccer, $this->_db, $clubId);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($count > 0) {
         $offers = DirectTransfersDataService::getReceivedOffers($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps, $clubId);
     } else {
         $offers = array();
     }
     return array("offers" => $offers, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:14,代碼來源:TransferOffersModel.class.php

示例11: getTemplateParameters

 public function getTemplateParameters()
 {
     $teamId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     if ($teamId < 1) {
         throw new Exception($this->_i18n->getMessage("feature_requires_team"));
     }
     $team = TeamsDataService::getTeamSummaryById($this->_websoccer, $this->_db, $teamId);
     $count = BankAccountDataService::countAccountStatementsOfTeam($this->_websoccer, $this->_db, $teamId);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($count > 0) {
         $statements = BankAccountDataService::getAccountStatementsOfTeam($this->_websoccer, $this->_db, $teamId, $paginator->getFirstIndex(), $eps);
     } else {
         $statements = array();
     }
     return array("budget" => $team["team_budget"], "statements" => $statements, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:17,代碼來源:FinancesModel.class.php

示例12: getTemplateParameters

 /**
  * (non-PHPdoc)
  * @see IModel::getTemplateParameters()
  */
 public function getTemplateParameters()
 {
     // get team info
     $teamId = NationalteamsDataService::getNationalTeamManagedByCurrentUser($this->_websoccer, $this->_db);
     if (!$teamId) {
         throw new Exception($this->_i18n->getMessage("nationalteams_user_requires_team"));
     }
     $matchesCount = NationalteamsDataService::countNextMatches($this->_websoccer, $this->_db, $teamId);
     // setup paginator
     $eps = 5;
     $paginator = new Paginator($matchesCount, $eps, $this->_websoccer);
     $paginator->addParameter("block", "national-next-matches");
     $matches = array();
     if ($matchesCount) {
         $matches = NationalteamsDataService::getNextMatches($this->_websoccer, $this->_db, $teamId, $paginator->getFirstIndex(), $eps);
     }
     return array("paginator" => $paginator, "matches" => $matches);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:22,代碼來源:NationalNextMatchesModel.class.php

示例13: getTemplateParameters

 public function getTemplateParameters()
 {
     $playersCount = PlayersDataService::findPlayersCount($this->_websoccer, $this->_db, $this->_firstName, $this->_lastName, $this->_club, $this->_position, $this->_strength, $this->_lendableOnly);
     // setup paginator
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($playersCount, $eps, $this->_websoccer);
     $paginator->addParameter("block", "playerssearch-results");
     $paginator->addParameter("fname", $this->_firstName);
     $paginator->addParameter("lname", $this->_lastName);
     $paginator->addParameter("club", $this->_club);
     $paginator->addParameter("position", $this->_position);
     $paginator->addParameter("strength", $this->_strength);
     $paginator->addParameter("lendable", $this->_lendableOnly);
     // get players records
     if ($playersCount > 0) {
         $players = PlayersDataService::findPlayers($this->_websoccer, $this->_db, $this->_firstName, $this->_lastName, $this->_club, $this->_position, $this->_strength, $this->_lendableOnly, $paginator->getFirstIndex(), $eps);
     } else {
         $players = array();
     }
     return array("playersCount" => $playersCount, "players" => $players, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:21,代碼來源:PlayersSearchModel.class.php

示例14: getTemplateParameters

 /**
  * (non-PHPdoc)
  * @see IModel::getTemplateParameters()
  */
 public function getTemplateParameters()
 {
     $matches = array();
     $paginator = null;
     $clubId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     $whereCondition = '(home_verein = %d OR gast_verein = %d) AND berechnet != \'1\'';
     $parameters = array($clubId, $clubId);
     $result = $this->_db->querySelect('COUNT(*) AS hits', $this->_websoccer->getConfig('db_prefix') . '_spiel', $whereCondition, $parameters);
     $matchesCnt = $result->fetch_array();
     $result->free();
     if ($matchesCnt) {
         $count = $matchesCnt['hits'];
     } else {
         $count = 0;
     }
     if ($count) {
         $whereCondition .= ' ORDER BY M.datum ASC';
         $eps = $this->_websoccer->getConfig("entries_per_page");
         $paginator = new Paginator($count, $eps, $this->_websoccer);
         $matches = MatchesDataService::getMatchesByCondition($this->_websoccer, $this->_db, $whereCondition, $parameters, $paginator->getFirstIndex() . ',' . $eps);
     }
     return array("matches" => $matches, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:27,代碼來源:MyScheduleModel.class.php

示例15: getTemplateParameters

 public function getTemplateParameters()
 {
     $teamId = $this->_websoccer->getUser()->getClubId($this->_websoccer, $this->_db);
     if ($teamId < 1) {
         throw new Exception($this->_i18n->getMessage("feature_requires_team"));
     }
     $positionInput = $this->_websoccer->getRequestParameter("position");
     $positionFilter = null;
     if ($positionInput == "goaly") {
         $positionFilter = "Torwart";
     } else {
         if ($positionInput == "defense") {
             $positionFilter = "Abwehr";
         } else {
             if ($positionInput == "midfield") {
                 $positionFilter = "Mittelfeld";
             } else {
                 if ($positionInput == "striker") {
                     $positionFilter = "Sturm";
                 }
             }
         }
     }
     $count = PlayersDataService::countPlayersOnTransferList($this->_websoccer, $this->_db, $positionFilter);
     $eps = $this->_websoccer->getConfig("entries_per_page");
     $paginator = new Paginator($count, $eps, $this->_websoccer);
     if ($positionFilter != null) {
         $paginator->addParameter("position", $positionInput);
     }
     if ($count > 0) {
         $players = PlayersDataService::getPlayersOnTransferList($this->_websoccer, $this->_db, $paginator->getFirstIndex(), $eps, $positionFilter);
     } else {
         $players = array();
     }
     return array("transferplayers" => $players, "playerscount" => $count, "paginator" => $paginator);
 }
開發者ID:astroChasqui,項目名稱:open-websoccer,代碼行數:36,代碼來源:TransfermarketOverviewModel.class.php


注:本文中的Paginator::getFirstIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。