<?php include "../../root.class.php";
$html = new html();
$html->add_styles_page();
$db = new db_safeguard();

$time_label = new label();
$time_label->for("date_time_started_label");
$time_label->value("Date Time Started:");

$date_time_started = new input();
$date_time_started->type("datetime-local");
$date_time_started->id("date_time_started");
$date_time_started->name("date_time_started");
$date_time_started->class("inputs");

$estimated_time_label = new label();
$estimated_time_label->for("estimated_time_label");
$estimated_time_label->value("Estimated Time To Complete:");

$estimated_time = new select();
$estimated_time->id("estimated_time");
$estimated_time->name("estimated_time");
$estimated_time->class("inputs");
$estimated_time->add_option("", "");
$estimated_time->add_option("24 hours", "24 hours");
$estimated_time->add_option("48 hours", "48 hours");
$estimated_time->add_option("1 Week", "1 Week");
$estimated_time->add_option("2 Week", "2 Week");
$estimated_time->add_option("1 Month", "1 Month");
$estimated_time->add_option("Other", "Other");

$supervisor_siganture_label = new label();
$supervisor_siganture_label->for("supervisor_signature");
$supervisor_siganture_label->value("Supervisor Signature:");

$supervisor_siganture = new signature();
$supervisor_siganture->id("supervisor_signature");
$supervisor_siganture->name("supervisor_signature");
$supervisor_siganture->send_file_path("../maintenance/upload_signature.php");
$supervisor_siganture->submit_btn_id("submit_btn");

$submit_btn = new input();
$submit_btn->class("submit_btn");
$submit_btn->value("Submit");
$submit_btn->onclick("sign_off");
$submit_btn->id("submit_btn");

?>

<form action="update_maintenance.php" method="post">
    <div class="form_down">
        <h1>SUPERVISOR CHECK AND SIGN OFF</h1>
        <?php
        $time_label->add();
        $date_time_started->add();
        $estimated_time_label->add();
        $estimated_time->add();
        ?>
        <p><b><i>I hereby support the notes from the technician and approve for this job card to be re-scheduled for completion:  </i></b></p>
        <p><b><i>I hereby support the approval & completion of this job card: </i></b></p>
        <?php
        $supervisor_siganture_label->add();
        $supervisor_siganture->add();
        $submit_btn->add();
        ?>
    </div>
</form>

<?php

$date = date("Y-m-d H:i", strtotime("+2 Hours"));

$ajax = new js_ajax();
$ajax->function_name("sign_off");
$ajax->insert("");
$ajax->on_success("");
$ajax->redirect("");