';
/** Add the styles */
$html .= self::getDefaultStyles();
/** Add the header */
//$html .= self::getHeader();
/** Add the issuer company */
//$html .= self::getIssuerCompany();
/** Open the content div */
$html .= '';
/** Add the title */
//$html .= self::getTitle('Wash Certificate');
/** Add the seal number */
//$html .= self::getSealNumber();
/** Add the registration numbers, time, date and the carried out by */
//$html .= self::getDetails();
/** Add the provider details */
//$html .= self::getProviderDetails();
/** Add the regarding this document */
//$html .= self::getRegardingThisDocument('DK');
/** Add the regarding this document in English */
//$html .= self::getRegardingThisDocument('EN');
/** Add the signature */
//$html .= self::getSignature();
$html .= self::setDocumentFields(
self::getKey('booking_number') ?: '-',
self::getKey('time') . ' ' . self::getKey('date'),
self::getKey('carried_out_by') ?: '-',
self::getKey('seal_number') ?: '-',
);
$html .= self::setDocumentRegistrationNumberFields(
self::getKey('reg_1') ?: '-',
self::getKey('reg_2') ?: '-',
);
$html .= self::setDocumentCustomerSupplierFields(
[
self::getKey('customer_name') ?: '-',
self::getKey('customer_address') ?: '-',
],
[
self::getKey('department_name') ?: '-',
self::getKey('department_address') ?: '-',
],
);
$html .= self::setSignatureField(
'123',
);
/** Close the content div */
$html .= '
';
/** Close the page */
$html .= '';
return $html;
}
private function setDocumentFields(string $document_number_column, string $time_and_date_column, string $carried_out_by_column, string $safety_seal_or_plom_number_column): string
{
$column_width_px = 125;
return '
|
' . htmlspecialchars($document_number_column, ENT_QUOTES, 'UTF-8') . '
|
' . htmlspecialchars($time_and_date_column, ENT_QUOTES, 'UTF-8') . '
|
' . htmlspecialchars($carried_out_by_column, ENT_QUOTES, 'UTF-8') . '
|
' . htmlspecialchars($safety_seal_or_plom_number_column, ENT_QUOTES, 'UTF-8') . '
|
';
}
private function setDocumentRegistrationNumberFields(string $truck_registration_number_column, string $trailer_registration_number_column): string
{
$column_width_px = 132;
$spacer_width_px = 66;
return '
|
' . htmlspecialchars($truck_registration_number_column, ENT_QUOTES, 'UTF-8') . '
|
|
' . htmlspecialchars($trailer_registration_number_column, ENT_QUOTES, 'UTF-8') . '
|
';
}
private function setDocumentCustomerSupplierFields(array $customer_details_column, array $supplier_details_column): string
{
$column_width_px = 257;
$spacer_width_px = 32;
$column_2_additional_width_px = 12;
// Parse the customer details column
$customer_details_html = '';
foreach ( $customer_details_column as $key => $value ) {
// If the item is the first item, add a strong tag
if ($key === 0) {
$customer_details_html .= '' . htmlspecialchars($value, ENT_QUOTES, 'UTF-8') . '
';
} else {
$customer_details_html .= htmlspecialchars($value, ENT_QUOTES, 'UTF-8') . '
';
}
}
// Parse the supplier details column
$supplier_details_html = '';
foreach ( $supplier_details_column as $key => $value ) {
// If the item is the first item, add a strong tag
if ($key === 0) {
$supplier_details_html .= '' . htmlspecialchars($value, ENT_QUOTES, 'UTF-8') . '
';
} else {
$supplier_details_html .= htmlspecialchars($value, ENT_QUOTES, 'UTF-8') . '
';
}
}
return '
|
' . $customer_details_html . '
|
|
' . $supplier_details_html . '
|
';
}
private function setSignatureField(string $column_1): string
{
$column_width_px = 219;
$column_height_px = 30;
$margin_left_px = 263;
$margin_right_px = $margin_left_px;
return '
';
}
/**
* Get the seal number for the wash certificate
* @notation This method is used to generate the seal number for the wash certificate.
* @return string HTML table
* @see addData() - This method is used to add data to the template.
*/
public function getSealNumber(): string
{
return '
SEAL/PLOM number ' . htmlspecialchars($this->getKey('seal_number'), ENT_QUOTES, 'UTF-8') . '
|
';
}
/**
* Get the HTML details for the wash certificate
* @notation This method is used to generate the details of the wash certificate. (E.g. registration numbers, time, date and the carried out by)
* @return string HTML table
* @see addData() - This method is used to add data to the template.
*/
public function getDetails(): string
{
return '
Company name ' . htmlspecialchars($this->getKey('customer_name'), ENT_QUOTES, 'UTF-8') . '
|
Reg.no. ' . htmlspecialchars($this->getKey('reg_1'), ENT_QUOTES, 'UTF-8') . '
|
Date ' . htmlspecialchars($this->getKey('time'), ENT_QUOTES, 'UTF-8') . ' ' . htmlspecialchars($this->getKey('date'), ENT_QUOTES, 'UTF-8') . '
|
Type ' . htmlspecialchars($this->getKey('type'), ENT_QUOTES, 'UTF-8') . '
|
Trailerno. ' . htmlspecialchars($this->getKey('reg_2'), ENT_QUOTES, 'UTF-8') . '
|
Time ' . htmlspecialchars($this->getKey('time'), ENT_QUOTES, 'UTF-8') . '
|
';
}
/**
* Get the HTML provider details for the wash certificate
* @notation This method is used to generate the provider details of the wash certificate. (E.g. department, company name, address, zip, city, phone prefix, phone, email and website)
* @return string HTML table
* @see addData() - This method is used to add data to the template.
*/
public function getProviderDetails(): string
{
return '
Service Provider
' . self::getCompanyName() . '
' . self::getCompanyAddress() . '
' . self::getCompanyZip() . ' ' . self::getCompanyCity() . '
|
Contact Details
+' . self::getCompanyPhoneCountryCode() . ' ' . self::getCompanyPhone() . '
' . self::getCompanyEmail() . '
|
Carried Out By
' . htmlspecialchars($this->getKey('carried_out_by'), ENT_QUOTES, 'UTF-8') . '
|
';
}
/**
* Get the regarding this document
* @notation This method is used to generate the regarding this document.
* @param string $language Language code (e.g. 'DK', 'EN', etc.)
* @return string HTML table
*/
public function getRegardingThisDocument(string $language = 'DK'): string
{
$translations = [
'DK' => [
'Angående dette dokument',
'Der kvitteres herved for udførelse af indvendig vask af denne trailer. Vasken er udført med en godkendt sæbe til formålet – samt afskyllet med vand bagefter.',
'Der er udført egenkontrol af vasken, Herved bekræftes det at vasken er udført optimalt.',
'Datablade kan rekvireres hos Copenhagen Truck Wash.',
'Bakterielle prøver bør tages umiddelbart efter vask, dog max 3 timer efter. Prøven skal tages på et tørt sted og ikke på gulvet',
],
'EN' => [
'Regarding this document',
'This is hereby confirmed for the performance of internal washing of this trailer. The wash has been performed with an approved soap for the purpose - and rinsed with water afterwards.',
'Self-control of the wash has been performed, hereby confirming that the wash has been performed optimally.',
'Data sheets can be requested from Copenhagen Truck Wash.',
'Bacterial samples should be taken immediately after washing, but no later than 3 hours after. The sample should be taken in a dry place and not on the floor.',
],
];
return '
' . htmlspecialchars($translations[$language][0], ENT_QUOTES, 'UTF-8') . '
' . htmlspecialchars($translations[$language][1], ENT_QUOTES, 'UTF-8') . '
' . htmlspecialchars($translations[$language][2], ENT_QUOTES, 'UTF-8') . '
' . htmlspecialchars($translations[$language][3], ENT_QUOTES, 'UTF-8') . '
' . htmlspecialchars($translations[$language][4], ENT_QUOTES, 'UTF-8') . '
|
';
}
private function getBackground(): string
{
// add the template pdf as a background
$template = self::pathSrc('wash_certificate_template.png');
$html = '';
//$html .= self::addImage($template, 'Certificate Image', -1, -1, 'center', 'background');
$html .= '
';
return $html;
}
}