<?php include "../../root.class.php";
$html = new html();
$html->add_styles_page();
$db = new db_safeguard();
// $html->check_user_type("ADMIN");

// HTML FORM ELEMENTS

$delivery_date_label = new label();
$delivery_date_label->for("delivery_date_label");
$delivery_date_label->value("DELIVERY DATE");

$delivery_date = new input();
$delivery_date->type("datetime-local");
$delivery_date->name("delivery_date");
$delivery_date->id("delivery_date");
$delivery_date->placeholder("Delivery Date");

$purchase_order_no_label = new label();
$purchase_order_no_label->for("purchase_order_no_label");
$purchase_order_no_label->value("PURCHASE ORDER NO");

$purchase_order_no = new input();
$purchase_order_no->type("text");
$purchase_order_no->name("purchase_order_no");
$purchase_order_no->id("purchase_order_no");
$purchase_order_no->placeholder("Purchase Order No");

$contact_name_label = new label();
$contact_name_label->for("contact_name_label");
$contact_name_label->value("CONTACT NAME");

$contact_name = new input();
$contact_name->type("text");
$contact_name->name("contact_name");
$contact_name->id("contact_name");
$contact_name->placeholder("Contact Name");

$contact_number_label = new label();
$contact_number_label->for("contact_number_label");
$contact_number_label->value("CONTACT NUMBER");

$contact_number = new input();
$contact_number->type("text");
$contact_number->name("contact_number");
$contact_number->id("contact_number");
$contact_number->placeholder("Contact Number");
$contact_number->onchange("checkno();");

$email_label = new label();
$email_label->for("email_label");
$email_label->value("EMAIL");

$email = new input();
$email->type("text");
$email->name("email");
$email->id("email");
$email->placeholder("Email");

$issue_delivery_certificate_label = new label();
$issue_delivery_certificate_label->for("issue_delivery_certificate_label");
$issue_delivery_certificate_label->value("WOULD YOU LIKE TO ISSEUE DELIVERY CERTIFICATE?");

$issue_delivery_certificate = new select();
$issue_delivery_certificate->name('Issue Delivery Certificate');
$issue_delivery_certificate->id('issue_delivery_certificate');
$issue_delivery_certificate->add_option('YES', 'YES');
$issue_delivery_certificate->add_option('NO', 'NO');

$submit_btn = new button();
$submit_btn->value("ADD");
$submit_btn->onclick("submit_delivery_shedule();");

?>

<div class="form_down">
    <h1>DELIVERY SCHEDULE REQUEST</h1>

    <?php
    $delivery_date_label->add();
    $delivery_date->add();
    $purchase_order_no_label->add();
    $purchase_order_no->add();
    ?>

    <h2>SEND DELIVERY CERTIFICATE TO</h2>

    <div style="display: flex; flex-direction: row; width: 60%; justify-content: space-evenly;">
        <div style="display: flex; flex-direction: column;">
            <?php
            $contact_name_label->add();
            $contact_name->add();
            ?>
        </div>
        <div style="display: flex; flex-direction: column;">
            <?php
            $contact_number_label->add();
            $contact_number->add();
            ?>
        </div>
        <div style="display: flex; flex-direction: column;">
            <?php
            $email_label->add();
            $email->add();
            ?>
        </div>
    </div>

    <?php
    $issue_delivery_certificate_label->add();
    $issue_delivery_certificate->add();
    $submit_btn->add();
    ?>
</div>






<?php

$ajax = new js_ajax();
$ajax->function_name("submit_sample");
$ajax->submit_btn_id("submit");
$ajax->insert("qa_sample_management");
$ajax->on_success("SAMPLE SUBMITTED SUCCESSFULLY");