namibia
df0489e1eeeeab5a9bd44e1d84fce49924fe1bac
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
<?php namespace Stock\Pdf; class TuhpiAccident extends \Utility\Service\PdfTemplate { /** * PDF title. * @var string */ protected $_title = 'HPI Accident Only Report'; /** * @var \Stock\Entity\Stock */ protected $jobRecord; /** * @var boolean */ protected $showCustomerDetails = false; /** * @var boolean */ protected $showValuationDetails = false; /** * @var boolean */ protected $showPricingDetails = false; /** * @var boolean */ protected $showVehicleDetails = false; /** * @var boolean */ protected $showVehicleNotes = false; /** * @var boolean */ protected $showDamageDetails = false; /** * @var boolean */ protected $showAccessoryDetails = false; /** * @var boolean */ protected $showSignatureLines = false; /** * @var boolean */ protected $showTermsAndConditions = false; /** * @var boolean */ protected $showOffersReceived = false; /** * @var boolean */ protected $showOfferMade = false; /** * Utility for easy parameter retrieval. * @param string $param * @param unknown $default * @return unknown */ protected function getStockParam($param, $default) { return !is_null($this->jobRecord->$param) ? $this->jobRecord->$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->$ref) ? $this->jobRecord->$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->valuation) && !is_null($this->jobRecord->valuation->$param) ? $this->jobRecord->valuation->$param : $default; } /** * Build the content. */ public function build() { ini_set('memory_limit','-1'); #-> Set data item to work with. $authData = \Utility\Registry::getAuthData(); $this->jobRecord = $this->_input['jobRecord']; $recordId = $this->_input['contract']->PdfTemplate['recordId']; if(!empty($recordId) && '' != $recordId) { $result = $this->em->createQuery( 'SELECT tuhpi ' . 'FROM \Stock\Entity\Tuhpi tuhpi ' . 'JOIN tuhpi.stock stock ' . 'WHERE tuhpi.id = :id ' . 'ORDER BY tuhpi.created ASC ' ) ->setParameter( 'id' , $recordId ); } else { $result = $this->em->createQuery( 'SELECT tuhpi ' . 'FROM \Stock\Entity\Tuhpi tuhpi ' . 'JOIN tuhpi.stock stock ' . 'WHERE stock.id = :stockId ' . ' AND IDENTITY(tuhpi.company) = :companyId ' . 'ORDER BY tuhpi.created ASC ' ) ->setParameter( 'stockId' , $this->jobRecord->id ) ->setParameter( 'companyId' , $authData['company']['id'] ); } // \Utility\Debug::errorLog('$result->getSQL()',$result->getSQL()); // \Utility\Debug::errorLog('$result->getParameters()',$result->getParameters()); $result = $result->getResult(); foreach ($result as $data) { // \Utility\Debug::errorLog('$data->id',$data->id); $companyProfileOffice = $data->company->contact->office; $companyProfilefax = $data->company->contact->fax; $companyRegion = $data->company->region->name; $companyCity = $data->company->city->name; $companyPostalCode = $data->company->postalCode; $companyStreet = $data->company->street; // \Utility\Debug::errorLog('$data->ah_data',$data->ah_data); $ah_data = unserialize($data->ah_data); } $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat(); $currencyPrefix = \Utility\Definitions\Locale::getCurrencyPrefix(); $authData = \Utility\Registry::getAuthData(); $msg = 'NO RECORD FOUND ON OUR DATABASE'; //\Utility\Debug::errorLog('$authData', $authData['']); // $test = '* Year of Manufacturer - The year of manufacture and the year of first registration normally coincides. If not, the difference is caused by vehicles being // manufactured/imported late in one year but being sold and first registered as new in a later year. // TransUnion HPI is a registered financial services provider (22938). // _______________________________________________________________________________________________________________________ // Please check this confirmation carefully to ensure that you enquired on the correct VIN/Engine number. Should you have any queries, please contact // Customer Services at: (0861) 507 507 // Report Date: 2014/08/15 11:22 AM '; // // $dateOfPrint = 'Date of print HPI: <span style="color:#333;">' . date('Y-m-d H:i:s') . '</span>'; // $printedBy = 'Printed by HPI: <span style="color:#333;">' . $authData['firstName'] // . ' ' . $authData['familyName'] . '</span>'; // $referenceNo = 'Reference no.: <span style="color:#333;">' . $this->jobRecord->referenceNumber . '</span>'; // $this->_logo = ' // <h1 style="font-size:20px; margin:0 auto; text-align:center">TRANSUNION REPORT</h1> // <div style="width:100%"></div> // // <div style="display:block; width:115px; height:82px; margin-left:640px; margin-top:-40px; " > // <img style="" width="115px" height="82px" src="' . __DIR__ . '/../../../../../public/img/app/logos/tuhpi.jpg" style="padding:0;margin:0;width:100%;" /> // </div> // '; // $this->_logo = ' // <img width="53" height="67" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/logo.png"/> // <div style="padding-left: 1pt;text-indent: 0pt;text-align: left;margin-top: 25px;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 20.5pt;"> // Trans // <span style=" color: #00a6d2;margin-left:-10px;">Union</span> // <span style="color: #B8C8C3;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 5pt;margin-left:-7px;" >®</span> // </div> // '; $this->_logo = ' <div style="text-align: left;margin-bottom: 25px;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 20.5pt;"> <img width="261" height="50" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/TULogo_blue.jpg"/> </div> '; /* --------------------------------- USER, TransUnion --------------------------------- */ // $type = $this->jobRecord->type; $intro =' <div style="background-image:linear-gradient(to bottom,#d6d0c4,white 20%);position: relative;"> <table style="width:100%;margin-top:-20px;"> <tr> <td style="width:70%;"> <p style="line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;"> Wanderers Office Park, 52 Corlett Drive, lllovo, 2196 </p> <p style="margin-top:-1px;line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;"> P O Box 4522, Johannesburg, 2000 </p> </td> <td style="width:30%;"> <p style="text-indent: 50%;line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;"> Web: <a href="http://www.transunion.co.za/" target="_blank" style="color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;"> www.transunion.co.za </a> </p> <p style="margin-top:-1px;line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt"> Call Centre: 0861 504 504 </p> <p style="margin-top:-1px;line-height: 5pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt"> Email: <a href="mailto:dealersguide@transunion.co.za" style="color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;"> dealersguide@transunion.co.za </a> </p> </td> </tr> </table> <p style="line-height: 20pt;text-align: left;color: #04a6cd;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 18pt;"> Vehicle Accident Report </p> <table style="width:90%;text-align: left;margin-top:-20px;"> <tr> <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> Name : </td> <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> ' . $authData['firstName']. ' ' . $authData['familyName'] . ' </td> </tr> <tr> <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> Tel. Number : </td> <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> ' . $companyProfileOffice . ' </td> </tr> <tr> <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> Fax Number : </td> <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> ' . $companyProfilefax . ' </td> </tr> <tr> <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> Address : </td> <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> ' . $companyStreet . ' ' . $companyRegion . ' ' . $companyCity . ' ' . $companyPostalCode . ' </td> </tr> <tr> <td style="width:20%;border: 1px solid;padding-left: 5pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> Date Requested : </td> <td style="width:80%;border: 1px solid;padding-left: 10pt;line-height: 10pt;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 10pt;"> ' . date('Y-m-d H:i:s') . ' </td> </tr> </table> <div style="width:90%;margin-top:50pt;"> <p style="text-indent: 0pt;line-height: 56%;text-align: left;"> <img width="26" height="27" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/Image_012.jpg"/> <p style="text-align: left;margin-left: 30px;margin-top: -25px;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;line-height: 12pt;font-size: 12pt;"> Thank you for your enquiry. The vehicle description you have submitted has been checked against our records, the result of the search is displayed below. </p> </p> <span style="text-indent: 0pt;text-align: left;padding-top:5px;"></span> <p style="text-indent: 0pt;line-height: 56%;text-align: left;"> <img width="29" height="26" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/Image_013.jpg"/> <p style="text-align: left;margin-left: 30px;margin-top: -25px;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;line-height: 12pt;font-size: 12pt;"> To assist you we have added details explanations in each section. </p> </p> <span style="text-indent: 0pt;text-align: left;padding-top:5px;"></span> <p style="text-indent: 0pt;line-height: 56%;text-align: left;"> <img width="26" height="27" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/Image_012.jpg"/> <p style="text-align: left;margin-left: 30px;margin-top: -25px;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;line-height: 12pt;font-size: 12pt;"> Should you have any queries please contact TransUnion on 0861 482 482 from Monday to Friday 08h00 -17h00 and Saturday 08h00 -13h00. </p> </p> <span style="text-indent: 0pt;text-align: left;padding-top:5px;"></span> <p style="text-indent: 0pt;line-height: 56%;text-align: left;"> <img width="29" height="26" alt="image" src="' . __DIR__ . '/../../../../../public/img/app/logos/Image_013.jpg"/> <p style="text-align: left;margin-left: 30px;margin-top: -25px;color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;line-height: 12pt;font-size: 12pt;"> By accessing and relying on this report you are deemed to have read and agreed to AIS's terms and conditions as reflected at <a href="http://www.motoronline.co.za/portal/page?_pageid=0,4049541,0_8493546&_dad=portal30&_schema=PORTAL30" target="_blank" style="color: #050505;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;"> http://www.motoronline.co.za/portal/page?_pageid=0,4049541,0_8493546&_dad=portal30&_schema=PORTAL30 </a>. </p> </p> </div> <div style="width:90%;margin-top:300pt;"> <p style="text-indent: 0pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 8pt;"> Registered with the National Credit Regulator - Reg Number NCRCB4 </p> </div> </div> '; $this->append($intro); /* $container = $this ->newTable( array(30, 5, 30, 5, 30), 'margin:0;font-size:10px;vertical-align:top;', '', 'padding:10px 0 0 0;' ) ->setCellValue(0, 0, $intro); $this->append($container->publish()); */ /* --------------------------------- INFORMATION SUPPLIED / INFORMATION VERIFIED --------------------------------- */ // $vehicleInfo =' // // '; // $this->append($vehicleInfo); /* --------------------------------- ACCIDENT HISTORY --------------------------------- */ $accidentHistory = '<br /> <div style="margin-top:50pt;"></div> <div style="height: 30px;background-image:linear-gradient(to right,#9bb5c4,white 80%);"></div> <p style="margin-left: 20pt;text-align: left;margin-top: -45px; color: #030505;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 18pt;"> Car Accident History Report </p> <ol> <li style="margin-left: 20px;color: #04a6cd;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 12pt;"> <span style="-webkit-border-radius: 0px 99px 99px 20px;-moz-border-radius: 0px 99px 99px 20px;border-radius: 0px 99px 99px 20px;max-width: 500px !important;padding-right: 10%;"> VEHICLE DETAILS SUPPLIED </span> <table style="width:90%;text-align: left;margin-left: -30px;margin-top: 10px;" > <tr> <td style="width:30%;"> <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> VIN Number: </span> </td> <td style="width:70%;"> <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> ' . $this->getStockParam('vinNumber', '') . ' </span> </td> </tr> <tr > <td style="width:30%;"> <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> Engine Number: </span> </td> <td style="width:70%;"> <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> ' . $this->getStockParam('engineNumber', '') . ' </span> </td> </tr> <tr > <td style="width:30%;"> <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> Registration Number: </span> </td> <td style="width:70%;"> <span style="line-height: 20pt;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> ' . $this->getStockParam('registrationNumber', '') . ' </span> </td> </tr> </table> </li> <li style="margin-left: 20px;padding-top: 20px;color: #04a6cd;font-family: Arial, sans-serif;font-style: normal;font-weight: bold;text-decoration: none;font-size: 12pt;"> <span style="-webkit-border-radius: 0px 99px 99px 20px;-moz-border-radius: 0px 99px 99px 20px;border-radius: 0px 99px 99px 20px;max-width: 500px !important;padding-right: 10%;"> ACCIDENT HISTORY </span>'; // \Utility\Debug::errorLog('$ah_data',$ah_data); if (!empty($ah_data)) { $accidentHistory .= ' <table style="width:100%;text-align: left;margin-left: -30px;margin-top: 10px;" > <tr> <td style="width:15%;"> <span style="margin-top:-17px;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> <p>Source</p> </span> </td> <td style="width:15%;"> <span style="text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> <p>Assessment Date</p> </span> </td> <td style="width:20%;"> <span style="text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> <p>Vehicle Description</p> </span> </td> <td style="width:15%;"> <span style="margin-top:-17px;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> <p>Vin Match</p> </span> </td> <td style="width:15%;"> <span style="margin-top:-17px;text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> <p>REG Match</p> </span> </td> <td style="width:20%;"> <span style="text-align: left;font-weight: bold;color: #030505;font-family: Arial, sans-serif;font-style: normal;text-decoration: none;font-size: 12pt;"> <p>Repair Cost Indicator</p> </span> </td> </tr>'; foreach ($ah_data as $ah) { \Utility\Debug::errorLog('$ah',$ah); $accidentHistory .= ' <tr> <td style="width:15%;"> <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;"> ' . $ah['source'] . ' </p> </td> <td style="width:15%;"> <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;"> ' . str_replace('T',' ',$ah['assessmentDate']) . ' </p> </td> <td style="width:20%;"> <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;"> ' . $ah['vehicleDescription'] . ' </p> </td> <td style="width:15%;"> <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;"> ' . $ah['vinMatch'] . ' </p> </td> <td style="width:15%;"> <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;"> ' . $ah['regMatch'] . ' </p> </td> <td style="width:20%;"> <p style="line-height: 13pt;text-align: left;color: #030505;font-family: Arial, sans-serif;font-size: 12pt;font-weight: normal;"> ' . $ah['estimatedRepairCost'] . ' </p> </td> </tr> '; } } else { $accidentHistory .= '<table style="width:90%;text-align: left;margin-left: -30px;margin-top: 10px;" > <tr> <td style="width:90%;"> <p style="text-indent: 0pt;text-align: left;color: #8A8379;font-family: Arial, sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 12pt;"> ' . $msg . ' </p> </td> </tr>'; } $accidentHistory .= ' </table> </li> </ol>'; $this->append($accidentHistory); //$this->_page++; return; } } |
Commits for namibiamodule/Stock/src/Stock/Pdf/TuhpiAccident.php
Revision | Author | Commited | Message |
---|---|---|---|
df0489 ... | Mark | Fri 14 Oct, 2016 10:01:00 +0000 | initial commit |