/** /** * Get list player by team id & lates match id * @param id, name * @author ThuyNT */ public function loadListPlayerAction() { // Get params $teamID = $this->_request->getParam('teamID', 0); // Default response $response = array('error' => 0, 'msg' => 'Success', 'data' => NULL); if ($teamID > 0) { $playerModel = Thethao_Model_Player::getInstance(); // Get Players List of Match $arrPlayers = $playerModel->getListPlayersByTeam($teamID); if (!empty($arrPlayers)) { $objPlayer = $this->view->objObject->getPlayer(); $objPlayer->setId($arrPlayers); foreach ($arrPlayers as $id) { $playerDetail = $objPlayer->getDetailObjectBasic($id); $response['data'][] = array('id' => $playerDetail['id'], 'name' => $playerDetail['name']); } } else { $response['error'] = 1; $response['msg'] = 'Invalid parameters'; } } // Output echo Zend_Json::encode($response); exit; }
/** * Get Player Info * @param player id, seoname * @author dungdv8 */ public function cauThuAction() { //get player id $player_id = $this->_request->getParam('id', NULL); $arrParam = $this->_request->getParams(); $player_name = $arrParam[3]; //get model player $playerModel = Thethao_Model_Player::getInstance(); // detail infomation player $modelObject = $this->view->objObject->getPlayer(); $modelObject->setId($player_id); $arrPlayer = $modelObject->getDetailObjectBasic($player_id); $seoName = Fpt_Filter::setSeoLink($arrPlayer['name']); //get information of player // If seo name not match with title in url if ($player_name != $seoName) { $this->_redirect($this->view->ShareurlWorldcup($arrPlayer['share_url'])); } //danh gia cau thu $assessment = $playerModel->getDetailPlayerRatingTerm($player_id); $modelNews = $this->view->objArticle; //init param get news of playser $arrParam = array('object_id' => $player_id, 'object_type' => OBJECT_TYPE_PLAYER, 'limit' => LIMIT_RELATED_PLAYER, 'offset' => 0); $objectNews = $modelNews->getObjectNews($arrParam); unset($arrParam); //set id $modelNews->setIdBasic($objectNews['data']); //get Instance Block $objBlock = Thethao_Plugin_Block::getInstance(); //set exclude article id from objectNews $objBlock->setExclude($objectNews['data']); // Award local $localAward = $playerModel->getDetailPlayerByID($player_id, 1); // Group award local $local = $playerModel->groupPlayerAward($localAward); // Award international $interAward = $playerModel->getDetailPlayerByID($player_id, 2); // Group award international $inter = $playerModel->groupPlayerAward($interAward); //set award's names $awardType = array(1 => 'Vô địch', 2 => 'Á quân', 3 => 'Hạng 3'); // information transfer player $infotr = $playerModel->getInformationTransfer($player_id); //assign to view $this->view->assign(array('arrPlayer' => $arrPlayer, 'assessment' => $assessment, 'newsPlayer' => $objectNews['data'], 'locals' => $local, 'inter' => $inter, 'awardType' => $awardType, 'arrInfotr' => $infotr, 'objArticle' => $modelNews, 'seoName' => $seoName, 'intCategoryId' => WORLD_CUP, 'strCateCode' => $this->_request->getParam('action'))); //gan meta data $titleMeta = 'Thông tin cầu thủ ' . $arrPlayer['name'] . ' World Cup 2014 - VnExpress'; $keywords = 'World cup 2014, tin tuc , bong da'; $description = ''; // Init Menu $this->_request->setParam('cateid', WORLD_CUP); $this->view->headMeta()->setName('object_id', $player_id); $this->view->headTitle($titleMeta); $this->view->headMeta()->setName('description', $description); $this->view->headMeta()->setName('keywords', $keywords); }
/** * get team id and player id of team */ public function teamapiAction() { //set header header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET'); //set cache $this->_request->setParam('cache_file', 1); //Disable layout $this->_helper->layout->disableLayout(true); //Set no render view $this->_helper->viewRenderer->setNoRender(true); //init response $respose = array('data' => '', 'error' => 1); $modelObject = Fpt_Data_Materials_Object::getInstance(); //get models instance $modelFootball = Thethao_Model_Football::getInstance(); //get table with seasonId and leagueId $tableRanking = $modelFootball->getListTableRanking(153, 18); $arrTeamPlayer = array(); if (!empty($tableRanking)) { //set id object $modelObject->getTeam()->setId(array_keys($tableRanking)); $playerModel = Thethao_Model_Player::getInstance(); foreach ($tableRanking as $teamId => $table) { // Get Players List of Match $arrPlayers = $playerModel->getListPlayersByTeam($teamId); $arrTeamPlayer[$teamId] = $arrPlayers; } $respose['error'] = 0; } $respose['data'] = $arrTeamPlayer; $jsonData = Zend_Json::encode($respose); # JSON if no callback if (!isset($_GET['callback'])) { echo $jsonData; exit; } //init model new $modelNew = Thethao_Model_News::getInstance(); # JSONP if valid callback if ($modelNew->isValidCallback($_GET['callback'])) { echo "{$_GET['callback']}({$jsonData})"; exit; } }
/** * @todo - Worldcup Match * @author PhongTX */ public function thongKeAction() { //Set param $this->_request->setParam('block_cate', SITE_ID); //get common info of match $this->_getInfoMatch(); if (!empty($this->_matchDetail)) { //get object match $playerModel = Thethao_Model_Player::getInstance(); /* Begin - Doi hinh */ // Get players attend match of 2 team // Team 1 $playersTeam1 = $playerModel->getPlayersTeamMatch($this->_matchID, $this->_matchDetail['team1']); // Team 2 $playersTeam2 = $playerModel->getPlayersTeamMatch($this->_matchID, $this->_matchDetail['team2']); /* End - Doi hinh */ } // Assign to view $this->view->assign(array('playersTeam1' => $playersTeam1, 'playersTeam2' => $playersTeam2, 'intCategoryId' => WORLD_CUP, 'strCateCode' => $this->_request->getParam('action'))); //gan meta data $titleMeta = 'Thống kê trận đấu ' . $this->_metaTitle; $keywords = 'World cup 2014, tin tuc , bong da'; $description = ''; //set cateid to show active in menu $this->_request->setParam('cateid', WORLD_CUP); // Add helper $this->view->addHelperPath(APPLICATION_PATH . '/modules/worldcup/views/scripts/match/helper'); //Append css $this->view->headLink()->appendStylesheet($this->view->configView['css'] . '/lightbox/lightbox.css'); //add js $this->view->headScript()->appendFile($this->view->configView['vnecdn']['js'] . '/require.min.js'); //Add js $this->view->headTitle($titleMeta); $this->view->headMeta()->setName('description', $description); $this->view->headMeta()->setName('keywords', $keywords); }
/** * function get List Top Players for block left * @return array() */ public function getListTopPlayers($arrParams) { $arrReturn = array('data' => array()); //if empty then return if (empty($arrParams['season_id'])) { return $arrReturn; } // Get models' instance $modelPlayer = Thethao_Model_Player::getInstance(); //Init arrData $arrData = array(); //Get data $arrData = $modelPlayer->getListTopPlayers($arrParams['season_id']); if (count($arrData) > $arrParams['limit']) { $arrReturn['data'] = array_slice($arrData, 0, $arrParams['limit']); } else { $arrReturn['data'] = $arrData; } return $arrReturn; }