<?php
namespace KaliForms\Inc\Backend\PredefinedForms;

if (!defined('ABSPATH')) {
    exit;
}
class Package_Delivery_Request_Form extends Predefined_Form
{
    public function __construct()
    {
        parent::__construct();
        $this->id   = 'packageDeliveryRequestForm';
        $this->name = esc_html__('Package Delivery Request', 'kaliforms');

        $this->field_components = array(array("id" => "textbox", "internalId" => "textbox1", "label" => "Text box", "properties" => array("id" => "textbox1", "name" => "firstNameSender", "caption" => "First Name", "description" => "", "default" => "", "type" => "text", "placeholder" => "", "required" => false, "readonly" => false), "constraint" => 0), array("id" => "textbox", "internalId" => "textbox2", "label" => "Text box", "properties" => array("id" => "textbox12", "name" => "lastNameSender", "caption" => "Last Name", "description" => "", "default" => "", "type" => "text", "placeholder" => "", "required" => false, "readonly" => false), "constraint" => 0), array("id" => "email", "internalId" => "email3", "label" => "Email", "properties" => array("id" => "email3", "name" => "emailSender", "caption" => "Email", "description" => "", "default" => "", "placeholder" => "", "required" => false, "readonly" => false), "constraint" => 0), array("id" => "telephone", "internalId" => "telephone4", "label" => "Phone", "properties" => array("id" => "telephone4", "name" => "telephoneSender", "caption" => "Telephone", "description" => "", "default" => "", "placeholder" => "", "required" => false, "format" => "free", "readonly" => false), "constraint" => 0), array("id" => "freeText", "internalId" => "freetext5", "label" => "Free Text", "properties" => array("id" => "senderInformation", "name" => "sender", "content" => "Sender information", "triggerShortcode" => false), "constraint" => 0), array("id" => "freeText", "internalId" => "freetext6", "label" => "Free Text", "properties" => array("id" => "receiverInformation", "name" => "receiver", "content" => "Receiver information", "triggerShortcode" => false, "caption" => "undefined(duplicate)"), "constraint" => 0), array("id" => "textbox", "internalId" => "textbox7", "label" => "Text box", "properties" => array("id" => "textbox7", "name" => "firstNameReceiver", "caption" => "First Name", "description" => "", "default" => "", "type" => "text", "placeholder" => "", "required" => false, "readonly" => false), "constraint" => 0), array("id" => "textbox", "internalId" => "textbox8", "label" => "Text box", "properties" => array("id" => "textbox8", "name" => "lastNameReceiver", "caption" => "Last Name", "description" => "", "default" => "", "type" => "text", "placeholder" => "", "required" => false, "readonly" => false), "constraint" => 0), array("id" => "email", "internalId" => "email9", "label" => "Email", "properties" => array("id" => "email9", "name" => "emailReceiver", "caption" => "Email", "description" => "", "default" => "", "placeholder" => "", "required" => false, "readonly" => false), "constraint" => 0), array("id" => "telephone", "internalId" => "telephone10", "label" => "Phone", "properties" => array("id" => "telephone10", "name" => "telephoneReceiver", "caption" => "Telephone", "description" => "", "default" => "", "placeholder" => "", "required" => false, "format" => "free", "readonly" => false), "constraint" => 0), array("id" => "dateTimePicker", "internalId" => "datetimepicker12", "label" => "Date and Time picker", "properties" => array("id" => "pickUpDate", "name" => "pickUpDate", "caption" => "Pick Up date", "description" => "", "default" => "", "dateFormat" => "d-m-Y", "minDateToday" => true, "minDate" => "", "maxDate" => "", "showTime" => true, "minTime" => "09:00", "maxTime" => "13:30", "disabledDates" => "", "disabledPreviousSavedDates" => false, "coDependancyField" => "", "required" => false, "readonly" => false), "constraint" => "none"), array("id" => "textarea", "internalId" => "textarea14", "label" => "Textarea", "properties" => array("id" => "textarea14", "name" => "pickUpAddress", "caption" => "Pick Up Address", "description" => "", "default" => "", "placeholder" => "", "rows" => "5", "changeToEditor" => false, "required" => false, "readonly" => false), "constraint" => "none"), array("id" => "textarea", "internalId" => "textarea15", "label" => "Textarea", "properties" => array("id" => "textarea15", "name" => "deliveryAddress", "caption" => "Delivery Address", "description" => "", "default" => "", "placeholder" => "", "rows" => "5", "changeToEditor" => false, "required" => false, "readonly" => false), "constraint" => "none"), array("id" => "freeText", "internalId" => "freetext16", "label" => "Free Text", "properties" => array("id" => "information", "name" => "Information", "content" => "After submitting this form one of our agents will contact you via telephone to confirm your pickup time and location. The average delivery time for our company is between 48 - 72 hours.", "triggerShortcode" => false), "constraint" => 0), array("id" => "submitButton", "internalId" => "submitbutton17", "label" => "Submit Button", "properties" => array("id" => "submit", "clickAction" => "", "caption" => "Submit", "description" => ""), "constraint" => 0));
        $this->grid             = array(array("h" => 1, "i" => "textbox1", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 6, "x" => 0, "y" => 2), array("h" => 1, "i" => "textbox7", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 6, "x" => 0, "y" => 7), array("h" => 1, "i" => "textbox8", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 6, "x" => 6, "y" => 7), array("h" => 1, "i" => "textbox2", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 6, "x" => 6, "y" => 2), array("h" => 1, "i" => "email3", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 7, "x" => 0, "y" => 3), array("h" => 1, "i" => "email9", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 7, "x" => 0, "y" => 8), array("h" => 1, "i" => "telephone10", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 5, "x" => 7, "y" => 8), array("h" => 1, "i" => "telephone4", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 5, "x" => 7, "y" => 3), array("h" => 1, "i" => "freetext6", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 6), array("h" => 1, "i" => "freetext5", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 1), array("h" => 1, "i" => "datetimepicker12", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 4), array("h" => 1, "i" => "textarea15", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 9), array("h" => 1, "i" => "textarea14", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 5), array("h" => 1, "i" => "freetext16", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 0), array("h" => 1, "i" => "submitbutton17", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 10));
        $this->emails           = array(array("fromName" => "{sitetitle}", "fromEmail" => "{admin_email}", "toEmail" => "{emailSender}", "replyTo" => "", "ccEmail" => "", "bccEmail" => "", "emailSubject" => "Delivery request confirmation", "emailAttachmentFilePaths" => "", "emailAttachment" => "", "emailAttachmentMediaIds" => array(), "emailBody" => "<p>Thank you for your submission, the details of your request are listed below:</p><p></p><p>Sender:&nbsp;</p><p>{firstNameSender} {lastNameSender}, {emailSender}</p><p>{telephoneSender}</p><p>{pickUpDate}</p><p>{pickUpAddress}</p><p></p><p>Receiver:</p><p>{firstNameReceiver} {lastNameReceiver}, {emailReceiver}</p><p>{telephoneReceiver}</p><p>{deliveryAddress}</p>"), array("fromName" => "{sitetitle}", "fromEmail" => "{admin_email}", "toEmail" => "{admin_email}", "replyTo" => "", "ccEmail" => "", "bccEmail" => "", "emailSubject" => "A new request has been submitted!", "emailAttachmentFilePaths" => "", "emailAttachment" => "", "emailAttachmentMediaIds" => array(), "emailBody" => "<p>A new delivery request has been submitted.&nbsp;</p><p></p><p>Sender:&nbsp;</p><p>{firstNameSender} {lastNameSender}, {emailSender}</p><p>{telephoneSender}</p><p>{pickUpDate}</p><p>{pickUpAddress}</p><p></p><p>Receiver:</p><p>{firstNameReceiver} {lastNameReceiver}, {emailReceiver}</p><p>{telephoneReceiver}</p><p>{deliveryAddress}</p>"));

        $this->form_info = [
            'showThankYouMessage' => '1',
            'saveFormSubmissions' => '1',
            'thankYouMessage'     => '<p>Thank you for your submission!</p>',
        ];
    }
}
