<?php

namespace email\templates;

use email\helpers\email_template;

class email_template_booking_notification
{
    use email_template;

    protected int $booking_id;
    protected string $company_name;
    protected int $customer_id;
    protected string $contact_email;
    protected string $reference_number;
    protected string $vehicle_registration_truck;
    protected string $vehicle_registration_trailer;
    protected string $wants_wash_certificate;
    protected string $wash_certificate_email;
    protected string $date;
    protected string $department;
    protected string $address;
    protected string $pickup;
    protected string $notes;

    public function __construct(
        int    $booking_id,
        string $company_name,
        int    $customer_id,
        string $contact_email,
        string $reference_number,
        string $vehicle_registration_truck,
        string $vehicle_registration_trailer,
        string $wants_wash_certificate,
        string $wash_certificate_email,
        string $date,
        string $department,
        string $address,
        string $pickup,
        string $notes
    )
    {
        $this->booking_id = $booking_id;
        $this->company_name = $company_name;
        $this->customer_id = $customer_id;
        $this->contact_email = $contact_email;
        $this->reference_number = $reference_number;
        $this->vehicle_registration_truck = $vehicle_registration_truck;
        $this->vehicle_registration_trailer = $vehicle_registration_trailer;
        $this->wants_wash_certificate = $wants_wash_certificate;
        $this->wash_certificate_email = $wash_certificate_email;
        $this->date = $date;
        $this->department = $department;
        $this->address = $address;
        $this->pickup = $pickup;
        $this->notes = $notes;
    }

    public function generate_text(): string
    {
        return "";
    }

    public function generate_html(): string
    {
        ob_start();
        # Start of the html
        ?>

        <!-- Email template -->
        <p>Du har modtaget en booking.</p>
        <p>Her er detaljerne:</p>
        <br>
        <p><strong>Virksomhed:</strong> <?= $this->company_name ?></p>
        <p><strong>Kunde nummer:</strong> <?= $this->customer_id ?></p>
        <p><strong>Kontakt email:</strong> <?= $this->contact_email ?></p>
        <p><strong>Referencenummer / kode:</strong> <?= $this->reference_number ?></p>
        <p><strong>Reg. nr. Trækker:</strong> <?= $this->vehicle_registration_truck ?></p>
        <p><strong>Reg. nr. Trailer:</strong> <?= $this->vehicle_registration_trailer ?></p>
        <p><strong>Ønsker vaskecertifikat:</strong> <?= $this->wants_wash_certificate ?></p>
        <p><strong>Vaskecertifikat email:</strong> <?= $this->wash_certificate_email ?></p>
        <p><strong>Dato:</strong> <?= $this->date ?></p>
        <p><strong>Afdeling:</strong> <?= $this->department ?></p>
        <p><strong>Addresse:</strong> <?= $this->address ?></p>
        <p><strong>Skal afhentes:</strong> <?= $this->pickup ?></p>
        <p><strong>Noter:</strong> <?= $this->notes ?></p>
        <p><strong>Booking ID:</strong> <?= $this->booking_id ?></p>
        <br>
        <p>Med venlig hilsen, Truck Wash</p>
        <!-- End of the email template -->

        <?php
        # End of the html
        return ob_get_clean();
    }
}