public function addGameRow(Game $oGame, $includeField = true) { $oGame = Game::getByNefubId($oGame->nefub_id); $field = $oGame->field ? $oGame->field : 1; $gameType = $oGame->getCompetition()->getGender()->name . ' ' . $oGame->getCompetition()->getGenre()->name; $team1 = utf8_decode($oGame->getTeam1()->name); $team2 = utf8_decode($oGame->getTeam2()->name); if ($oGame->getFirstReferee()) { $oGame = new Game($oGame->getId()); $oReferee = $oGame->getFirstReferee(); $referee = utf8_decode($oReferee->getName()); if (!$oReferee->getPerson()) { $referee .= ' (' . $oReferee->getTeam()->getCompetition()->getGender()->name; $referee .= ' ' . $oReferee->getTeam()->getCompetition()->getGenre()->name . ')'; } } else { $referee = 'Onbekend'; } $text = $oGame->getFormattedTime(); $text .= "\t"; $text .= $team1; $text .= "\t"; $text .= $team2; $text .= "\n"; $text .= $gameType; if ($includeField) { $text .= $field; } $this->section->addText($text, array('name' => 'Arial', 'size' => 10, 'bold' => false)); }
/** * */ protected function _addHeaderReport() { $titles = $this->_content->getElementsByTagName('h4'); // Add the logo $logoPath = APPLICATION_PATH . '/../public/images/logo_report.png'; $this->_mainSection->addImage($logoPath, array('align' => 'center', 'width' => 71, 'height' => 68)); // Create the header Table $tableHeader = $this->_mainSection->addTable(); $tableHeader->addRow(); $cellTitle = $tableHeader->addCell(15000); $styleCell = array('size' => 10, 'name' => 'Calibri', 'bold' => 'Bold'); $paragraphStyle = array('spacing' => 0, 'spaceBefore' => 0, 'spaceAfter' => 0, 'align' => 'center'); // Add the titles foreach ($titles as $title) { $cellTitle->addText(utf8_decode($title->nodeValue), $styleCell, $paragraphStyle); } // Create the report title $styleCell['underline'] = PHPWord_Style_Font::UNDERLINE_SINGLE; $reportTitle = $this->_content->getElementsByTagName('h5'); $this->_mainSection->addTextBreak(); foreach ($reportTitle as $title) { $this->_mainSection->addText(utf8_decode($title->nodeValue), $styleCell); } }