jobRecord->stock->$param) ? $this->jobRecord->stock->$param : $default; } /** * Utility for easy parameter retrieval. * @param string $param * @param unknown $default * @return unknown */ protected function getStockSubParam($ref, $param, $default) { $ref = !is_null($this->jobRecord->stock->$ref) ? $this->jobRecord->stock->$ref : null; return is_object($ref) ? $ref->$param : $default; } /** * Utility for easy parameter retrieval. * @param string $param * @param unknown $default * @return unknown */ protected function getValuationParam($param, $default) { return !is_null($this->jobRecord->stock->valuation) && !is_null($this->jobRecord->stock->valuation->$param) ? $this->jobRecord->stock->valuation->$param : $default; } /** * Build the content. */ public function build() { #-> Set data item to work with. $this->jobRecord = $this->_input['jobRecord']; $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat(); $dateFormat = \Utility\Definitions\Locale::getDateFormat(); $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix(); $authData = \Utility\Registry::getAuthData(); $auctionDate = $this->jobRecord->endDate->format($dateFormat); $dateOfPrint = 'Date of print: ' . date('Y-m-d H:i:s') . ''; $printedBy = 'Printed by: ' . $authData['firstName'] . ' ' . $authData['familyName'] . ''; $referenceNo = 'Reference no.: ' . $this->jobRecord->stock->referenceNumber . ''; /* --------------------------------- Buyer & Seller details --------------------------------- */ #-> Buyer & Seller details $table = $this->newTable( array(60, 40), 'padding:0;margin:0;font-size:10px;', '', 'padding:2px 3px 2px 0;margin:0;' ); $table ->addTitle('Buyer', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1) ->addKeyValueDataSet(array( 'Buyer dealership:' => $this->jobRecord->soldToCompany->name, 'Buyer name:' => $this->jobRecord->soldToCompany->contact->firstName, 'Buyer surname:' => $this->jobRecord->soldToCompany->contact->familyName, 'Buyer Mobile:' => $this->jobRecord->soldToCompany->contact->mobile, 'Buyer Email:' => $this->jobRecord->soldToCompany->contact->email, ), 0, 'font-weight:bold;', 'color:#666;'); $buyerDetail = $table->publish(); $table = $this->newTable( array(60, 40), 'padding:0;margin:0;font-size:10px;', '', 'padding:2px 3px 2px 0;margin:0;' ); $table ->addTitle('Seller', 'padding:0 0 10px 0;font-weight:bold;font-size:11px;', 0, 1) ->addKeyValueDataSet(array( 'Seller dealership:' => $this->jobRecord->company->name, 'Seller name:' => $this->jobRecord->company->contact->firstName, 'Seller surname:' => $this->jobRecord->company->contact->familyName, 'Seller Mobile:' => $this->jobRecord->company->contact->mobile, 'Seller Email:' => $this->jobRecord->company->contact->email, ), 0, 'font-weight:bold;', 'color:#666;'); $sellerDetail = $table->publish(); $container = $this ->newTable( array(45, 10, 45), 'margin:0;font-size:10px;vertical-align:top;', '', 'padding:10px 0 0 0;' ) ->setCellValue(0, 0, $buyerDetail) ->setCellValue(0, 2, $sellerDetail); $this->append($container->publish() . '
'); /* --------------------------------- DECLARATION --------------------------------- */ $this->append( '
' . '

DECLARATION

' . 'We, the undersigned, declare that:' . '

' . '1. The Purchaser purchased the abovementioned vehicle from the Seller by web-auction conducted by Bid4Cars on the ' . $auctionDate . '
' . '2. The Purchaser hereby acknowledges having taken delivery of the vehicle from the Seller and being satisfied that the vehicle is as described in the Seller’s Regulation 32 Notice.' . '
' . '3. We confirm and acknowledge that we are bound by the terms and conditions of auction and sale, as set out on the Bid4Cars site.' . '
' . '4. The provisions of the terms are to be read as if specifically set out and incorporated herein.' . '


' . 'DATED at: ' . $auctionDate . '
' . '
' ); /* --------------------------------- SIGNATURES --------------------------------- */ #-> Signatures. $this->append( $this->newSignatureLine() ->addSignatureLine('Purchaser', 'Signature', 'Date') ->addSignatureText('a', 'Who warrants being the authorized representative of the Purchaser.') ->addSignatureLine('Seller', 'Signature', 'Date') ->addSignatureText('b', 'Who warrants being the authorized representative of the Seller.') ->publish() ); $this->append( '
' . '' . '' . '' . '' . '' . '' . '' . '' . '
' . $dateOfPrint . ' ' . $printedBy . ' ' . $referenceNo . '
' . '
' ); } }