<?php include "../../root.class.php";
$html = new html();
$html->add_styles_page();
$db = new db_safeguard();

$receiving_batch_no = new input();
$receiving_batch_no->type("hidden");
$receiving_batch_no->name("receiving_batch_no");
$receiving_batch_no->id("receiving_batch_no");
$receiving_batch_no->value($_GET['receiving_batch_no']);
$receiving_batch_no->style("width: 100%; margin: 1vw auto;");

$mechanical_damage = new input();
$mechanical_damage->type("number");
$mechanical_damage->name("mechanical_damage");
$mechanical_damage->id("mechanical_damage");
$mechanical_damage->style("width: 100%; margin: 1vw auto;");

$half_nut = new input();
$half_nut->type("number");
$half_nut->name("half_nut");
$half_nut->id("half_nut");
$half_nut->style("width: 100%; margin: 1vw auto;");

$open_micropyle = new input();
$open_micropyle->type("number");
$open_micropyle->name("open_micropyle");
$open_micropyle->id("open_micropyle");
$open_micropyle->style("width: 100%; margin: 1vw auto;");

$sting_bug = new input();
$sting_bug->type("number");
$sting_bug->name("sting_bug");
$sting_bug->id("sting_bug");
$sting_bug->style("width: 100%; margin: 1vw auto;");

$cracked = new input();
$cracked->type("number");
$cracked->name("cracked");
$cracked->id("cracked");
$cracked->style("width: 100%; margin: 1vw auto;");

$pale_shell = new input();
$pale_shell->type("number");
$pale_shell->name("pale_shell");
$pale_shell->id("pale_shell");
$pale_shell->style("width: 100%; margin: 1vw auto;");

$mis_shaped = new input();
$mis_shaped->type("number");
$mis_shaped->name("mis_shaped");
$mis_shaped->id("mis_shaped");
$mis_shaped->style("width: 100%; margin: 1vw auto;");

$dark_shell = new input();
$dark_shell->type("number");
$dark_shell->name("dark_shell");
$dark_shell->id("dark_shell");
$dark_shell->style("width: 100%; margin: 1vw auto;");

$germination = new input();
$germination->type("number");
$germination->name("germination");
$germination->id("germination");
$germination->style("width: 100%; margin: 1vw auto;");

$nut_borer = new input();
$nut_borer->type("number");
$nut_borer->name("nut_borer");
$nut_borer->id("nut_borer");
$nut_borer->style("width: 100%; margin: 1vw auto;");

$calcuim_def = new input();
$calcuim_def->type("number");
$calcuim_def->name("calcuim_def");
$calcuim_def->id("calcuim_def");
$calcuim_def->style("width: 100%; margin: 1vw auto;");

$other = new input();
$other->type("number");
$other->name("other");
$other->id("other");
$other->style("width: 100%; margin: 1vw auto;");

$other_comments = new input();
$other_comments->type("text");
$other_comments->name("other_comment");
$other_comments->id("other_comment");
$other_comments->placeholder("COMMENTS / REASONS");
$other_comments->style("width: 100%; margin: 1vw auto;");

$nih_quantity = new input();
$nih_quantity->type("number");
$nih_quantity->name("nih_quantity");
$nih_quantity->id("nih_quantity");
$nih_quantity->style("width: 100%; margin: 1vw auto;");

$status = new input();
$status->type("hidden");
$status->name("status");
$status->id("status");
$status->value("KERNAL ANALYSIS");
$status->style("width: 100%; margin: 1vw auto;");

$submit_btn = new button();
$submit_btn->class("submit_btn");
$submit_btn->value("Submit");
// $submit_btn->onclick("dnis(), update_nut_analysis()");
?>
<form method="post" action="save_dnis.php">
    <div class="form_down">
        <h1>DNIS INSPECTION</h1>
        <style>
            table,
            th,
            td {
                border: 2px solid black;
                border-collapse: collapse;
                padding: 5px;
            }
        </style>
        <?php
        $receiving_batch_no->add();
        ?>
        <table style="width: 90%">
            <tr>
                <th colspan="6" style="background-color: #004aad80;"> DNIS INSPECTION</th>
            </tr>
            <tr>
                <td>MECHANICAL (g)</td>
                <td>
                    <?php
                    $mechanical_damage->add();

                    ?>
                </td>
                <td>CRACKED (g)</td>
                <td>
                    <?php
                    $cracked->add();
                    ?>
                </td>
                <td>GERMINATION (g)</td>
                <td>
                    <?php
                    $germination->add();
                    ?>
                </td>
            </tr>
            <tr>
                <td>HALF NUT (g)</td>
                <td>
                    <?php
                    $half_nut->add();
                    ?>
                </td>
                <td>PALE SHELL (g)</td>
                <td>
                    <?php
                    $pale_shell->add();
                    ?>
                </td>
                <td>NUT BORER (g)</td>
                <td>
                    <?php
                    $nut_borer->add();
                    ?>
                </td>
            </tr>
            <tr>
                <td>OPEN MICROPYLE (g)</td>
                <td>
                    <?php
                    $open_micropyle->add();
                    ?>
                </td>
                <td>MIS-SHAPED (g)</td>
                <td>
                    <?php
                    $mis_shaped->add();
                    ?>
                </td>
                <td>
                    CALCIUM DEF (g)
                </td>
                <td>
                    <?php
                    $calcuim_def->add();
                    ?>
                </td>
            </tr>
            <tr>
                <td>STING BUG (g)</td>
                <td>
                    <?php
                    $sting_bug->add();
                    ?>
                </td>
                <td>DARK SHELL (g)</td>
                <td>
                    <?php
                    $dark_shell->add();
                    ?>
                </td>
            </tr>
            <tr>
                <td>OTHER (g)</td>
                <td>
                    <?php
                    $other->add();
                    ?>
                </td>
                <td colspan="4">
                    <?php
                    $other_comments->add();
                    ?>
                </td>
            </tr>
            <tr>
                <td colspan="3">NIH QUANTITY (KG)</td>
                <td colspan="3">
                    <?php
                    $nih_quantity->add();
                    ?>
                </td>
            </tr>
        </table>
        <br>
        <?php
        $submit_btn->add();
        ?>
    </div>
</form>


<?php

// $date = date("Y-m-d H:i", strtotime("+2 Hours"));

// $ajax = new js_ajax();
// $ajax->function_name("dnis");
// $ajax->insert("dnis_inspection");
// $ajax->add_column_and_value("date = {$date}");

// $update_ajax = new js_ajax();
// $update_ajax->function_name("update_nut_analysis");
// $update_ajax->update("nut_analysis_report");
// $update_ajax->selected_div("update_process");
// $update_ajax->on_success("DATA CAPTURED SUCCESSFULLY");
// $update_ajax->redirect("../pre-crack/kernal_analysis.php");

// $update_ajax->dev_mode();