<?php include "../../root.class.php";
$html = new html();
$html->add_styles_page();
$db = new db_safeguard();

$analysist_name = new input();
$analysist_name->type("text");
$analysist_name->name("analysist_name");
$analysist_name->id("analysist_name");
$analysist_name->style("width: 100%; margin: 1vw auto;");

$farm = new input();
$farm->type("text");
$farm->name("farm");
$farm->id("farm");
$farm->style("width: 100%; margin: 1vw auto;");

$date_harvested = new input();
$date_harvested->type("date");
$date_harvested->name("date_harvested");
$date_harvested->id("date_harvested");
$date_harvested->style("width: 100%; margin: 1vw auto;");

$date_received = new input();
$date_received->type("date");
$date_received->name("date_received");
$date_received->id("date_received");
$date_received->style("width: 100%; margin: 1vw auto;");

$blocks = new input();
$blocks->type("text");
$blocks->name("blocks");
$blocks->id("blocks");
$blocks->style("width: 100%; margin: 1vw auto;");

$wnis_delivery_weight = new input();
$wnis_delivery_weight->type("number");
$wnis_delivery_weight->name("wnis_delivery_weight");
$wnis_delivery_weight->id("wnis_delivery_weight");
$wnis_delivery_weight->style("width: 100%; margin: 1vw auto;");

$moisture_content_pre_crack_sample = new input();
$moisture_content_pre_crack_sample->type("number");
$moisture_content_pre_crack_sample->name("moisture_content_pre_crack_sample");
$moisture_content_pre_crack_sample->id("moisture_content_pre_crack_sample");
$moisture_content_pre_crack_sample->style("width: 100%; margin: 1vw auto;");

$receiving_batch_no = new input();
$receiving_batch_no->type("number");
$receiving_batch_no->name("receiving_batch_no");
$receiving_batch_no->id("receiving_batch_no");
$receiving_batch_no->style("width: 100%; margin: 1vw auto;");

$dnis_sizing_18mm = new input();
$dnis_sizing_18mm->type("number");
$dnis_sizing_18mm->name("dinis_sizing_18mm");
$dnis_sizing_18mm->id("dinis_sizing_18mm");
$dnis_sizing_18mm->style("width: 100%; margin: 1vw auto;");

$dnis_sizing_18_20mm = new input();
$dnis_sizing_18_20mm->type("number");
$dnis_sizing_18_20mm->name("dinis_sizing_18_20mm");
$dnis_sizing_18_20mm->id("dinis_sizing_18_20mm");
$dnis_sizing_18_20mm->style("width: 100%; margin: 1vw auto;");

$dnis_sizing_20_22mm = new input();
$dnis_sizing_20_22mm->type("number");
$dnis_sizing_20_22mm->name("dinis_sizing_20_22mm");
$dnis_sizing_20_22mm->id("dinis_sizing_20_22mm");
$dnis_sizing_20_22mm->style("width: 100%; margin: 1vw auto;");

$dnis_sizing_22_25mm = new input();
$dnis_sizing_22_25mm->type("number");
$dnis_sizing_22_25mm->name("dinis_sizing_22_25mm");
$dnis_sizing_22_25mm->id("dinis_sizing_22_25mm");
$dnis_sizing_22_25mm->style("width: 100%; margin: 1vw auto;");

$dnis_sizing_25mm = new input();
$dnis_sizing_25mm->type("number");
$dnis_sizing_25mm->name("dinis_sizing_25mm");
$dnis_sizing_25mm->id("dinis_sizing_25mm");
$dnis_sizing_25mm->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("text");
$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_comments");
$other_comments->id("other_comments");
$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;");

$farm_delivery_note = new input();
$farm_delivery_note->type("text");
$farm_delivery_note->name("farm_delivery_note");
$farm_delivery_note->id("farm_delivery_note");
$farm_delivery_note->style("width: 100%; margin: 1vw auto;");

$total_wnis_sample_mass = new input();
$total_wnis_sample_mass->type("number");
$total_wnis_sample_mass->name("total_wnis_sample_mass");
$total_wnis_sample_mass->id("total_wnis_sample_mass");
$total_wnis_sample_mass->style("width: 100%; margin: 1vw auto;");

$total_dnis_sample_mass = new input();
$total_dnis_sample_mass->type("number");
$total_dnis_sample_mass->name("total_dnis_sample_mass");
$total_dnis_sample_mass->id("total_dnis_sample_mass");
$total_dnis_sample_mass->style("width: 100%; margin: 1vw auto;");

$shell_mass = new input();
$shell_mass->type("number");
$shell_mass->name("shell_mass");
$shell_mass->id("shell_mass");
$shell_mass->style("width: 100%; margin: 1vw auto;");

$kernal_m_c = new input();
$kernal_m_c->type("number");
$kernal_m_c->name("kernal_m_c");
$kernal_m_c->id("kernal_m_c");
$kernal_m_c->style("width: 100%; margin: 1vw auto;");

$nis_moisture_loss = new input();
$nis_moisture_loss->type("number");
$nis_moisture_loss->name("nis_moisture_loss");
$nis_moisture_loss->id("nis_moisture_loss");
$nis_moisture_loss->style("width: 100%; margin: 1vw auto;");

$sound_kernel_mass = new input();
$sound_kernel_mass->type("number");
$sound_kernel_mass->name("sound_kernel_mass");
$sound_kernel_mass->id("sound_kernel_mass");
$sound_kernel_mass->style("width: 100%; margin: 1vw auto;");

$mould = new input();
$mould->type("number");
$mould->name("mould");
$mould->id("mould");
$mould->style("width: 100%; margin: 1vw auto;");

$spot_791 = new input;
$spot_791->type("number");
$spot_791->name("791_spot");
$spot_791->id("791_spot");
$spot_791->style("width: 100%; margin: 1vw auto;");

$onion_ring = new input();
$onion_ring->type("number");
$onion_ring->name("onion_ring");
$onion_ring->id("onion_ring");
$onion_ring->style("width: 100%; margin: 1vw auto;");

$immature = new input();
$immature->type("number");
$immature->name("immature");
$immature->id("immature");
$immature->style("width: 100%; margin: 1vw auto;");

$open_micro = new input();
$open_micro->type("number");
$open_micro->name("open_micro");
$open_micro->id("open_micro");
$open_micro->style("width: 100%; margin: 1vw auto;");

$unsound_kernel_mass = new input();
$unsound_kernel_mass->type("number");
$unsound_kernel_mass->name("unsound_kernel_mass");
$unsound_kernel_mass->id("unsound_kernel_mass");
$unsound_kernel_mass->style("width: 100%; margin: 1vw auto;");

$shell_mark = new input();
$shell_mark->type("number");
$shell_mark->name("shell_mark");
$shell_mark->id("shell_mark");
$shell_mark->style("width: 100%; margin: 1vw auto;");

$brown_center = new input();
$brown_center->type("number");
$brown_center->name("brown_center");
$brown_center->id("brown_center");
$brown_center->style("width: 100%; margin: 1vw auto;");

$total_kernel_mass = new input();
$total_kernel_mass->type("number");
$total_kernel_mass->name("total_kernel_mass");
$total_kernel_mass->id("total_kernel_mass");
$total_kernel_mass->style("width: 100%; margin: 1vw auto;");

$pit_center = new input();
$pit_center->type("number");
$pit_center->name("pit_center");
$pit_center->id("pit_center");
$pit_center->style("width: 100%; margin: 1vw auto;");

$late_sting_bug = new input();
$late_sting_bug->type("number");
$late_sting_bug->name("late_sting_bug");
$late_sting_bug->id("late_sting_bug");
$late_sting_bug->style("width: 100%; margin: 1vw auto;");

$usk_recovery = new input();
$usk_recovery->type("number");
$usk_recovery->name("usk_recovery");
$usk_recovery->id("usk_recovery");
$usk_recovery->style("width: 100%; margin: 1vw auto;");

$early_sting_bug = new input();
$early_sting_bug->type("number");
$early_sting_bug->name("early_sting_bug");
$early_sting_bug->id("early_sting_bug");
$early_sting_bug->style("width: 100%; margin: 1vw auto;");

$nis_usk_recovery = new input();
$nis_usk_recovery->type("number");
$nis_usk_recovery->name("nis_usk_recovery");
$nis_usk_recovery->id("nis_usk_recovery");
$nis_usk_recovery->style("width: 100%; margin: 1vw auto;");

$nutborer = new input();
$nutborer->type("number");
$nutborer->name("nutborer");
$nutborer->id("nutborer");
$nutborer->style("width: 100%; margin: 1vw auto;");

$sound_kernel_recovery = new input();
$sound_kernel_recovery->type("number");
$sound_kernel_recovery->name("sound_kernel_recovery");
$sound_kernel_recovery->id("sound_kernel_recovery");
$sound_kernel_recovery->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;");

$immature_percent = new input();
$immature_percent->type("number");
$immature_percent->name("immature_percent");
$immature_percent->id("immature_percent");
$immature_percent->style("width: 100%; margin: 1vw auto;");

$adhered_skin = new input();
$adhered_skin->type("number");
$adhered_skin->name("adhered_skin");
$adhered_skin->id("adhered_skin");
$adhered_skin->style("width: 100%; margin: 1vw auto;");

$total_kernel_recovery = new input();
$total_kernel_recovery->type("number");
$total_kernel_recovery->name("total_kernel_recovery");
$total_kernel_recovery->id("total_kernel_recovery");
$total_kernel_recovery->style("width: 100%; margin: 1vw auto;");

$pink_staining = new input();
$pink_staining->type("number");
$pink_staining->name("pink_staining");
$pink_staining->id("pink_staining");
$pink_staining->style("width: 100%; margin: 1vw auto;");

$total = new input();
$total->type("number");
$total->name("total");
$total->id("total");
$total->style("width: 100%; margin: 1vw auto;");

$style_0 = new input();
$style_0->type("number");
$style_0->name("style_0");
$style_0->id("style_0");
$style_0->style("width: 100%; margin: 1vw auto;");

$style_1 = new input();
$style_1->type("number");
$style_1->name("style_1");
$style_1->id("style_1");
$style_1->style("width: 100%; margin: 1vw auto;");

$style_1s = new input();
$style_1s->type("number");
$style_1s->name("style_1s");
$style_1s->id("style_1s");
$style_1s->style("width: 100%; margin: 1vw auto;");

$style_4xl = new input();
$style_4xl->type("number");
$style_4xl->name("style_4xl");
$style_4xl->id("style_4xl");
$style_4xl->style("width: 100%; margin: 1vw auto;");

$style_4l = new input();
$style_4l->type("number");
$style_4l->name("style_4l");
$style_4l->id("style_4l");
$style_4l->style("width: 100%; margin: 1vw auto;");

$style_4 = new input();
$style_4->type("number");
$style_4->name("style_4");
$style_4->id("style_4");
$style_4->style("width: 100%; margin: 1vw auto;");

$style_5 = new input();
$style_5->type("number");
$style_5->name("style_5");
$style_5->id("style_5");
$style_5->style("width: 100%; margin: 1vw auto;");

$style_6 = new input();
$style_6->type("number");
$style_6->name("style_6");
$style_6->id("style_6");
$style_6->style("width: 100%; margin: 1vw auto;");

$style_7 = new input();
$style_7->type("number");
$style_7->name("style_7");
$style_7->id("style_7");
$style_7->style("width: 100%; margin: 1vw auto;");

$style_1c = new input();
$style_1c->type("number");
$style_1c->name("style_1c");
$style_1c->id("style_1c");
$style_1c->style("width: 100%; margin: 1vw auto;");

$style_1cs = new input();
$style_1cs->type("number");
$style_1cs->name("style_1cs");
$style_1cs->id("style_1cs");
$style_1cs->style("width: 100%; margin: 1vw auto;");

$style_4c = new input();
$style_4c->type("number");
$style_4c->name("style_4c");
$style_4c->id("style_4c");
$style_4c->style("width: 100%; margin: 1vw auto;");

$submit_btn = new button();
$submit_btn->class("submit_btn");
$submit_btn->value("Submit");
$submit_btn->onclick("crack analysis()");

?>

<div class="form_down">
    <h1>Pre Crack Analysis</h1><br>
    <style>
        table,
        th,
        td {
            border: 2px solid black;
            border-collapse: collapse;
            padding: 5px;
        }
    </style>

    <table style="width: 90%">
        <tr style="background-color: #004aad80;">
            <th colspan="4">NUT ANALYSIS REPORT FORM - Pre-Crack Sample</th>
        </tr>
        <tr>
            <td>
                Analyst Name
            </td>
            <td colspan="3">
                <?php
                $analysist_name->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>Farm</td>
            <td>
                <?php
                $farm->add();
                ?>
            </td>
            <td>Date Harvested</td>
            <td>
                <?php
                $date_harvested->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>Date Received</td>
            <td>
                <?php
                $date_received->add();
                ?>
            </td>
            <td>Farm Delivery Note #</td>
            <td>
                <?php
                $farm_delivery_note->add();
                ?>
            </td>

        </tr>
        <tr>
            <td>Block/s</td>
            <td>
                <?php
                $blocks->add();
                ?>
            </td>
            <td>Receiving batch No</td>
            <td>
                <?php
                $receiving_batch_no->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>wnis delivery weight</td>
            <td>
                <?php
                $wnis_delivery_weight->add();
                ?>
            </td>
            <td>moisture content of pre crack sample</td>
            <td>
                <?php
                $moisture_content_pre_crack_sample->add();
                ?>
            </td>
        </tr>
    </table>

    <br>

    <table style="width: 90%">
        <tr>
            <th colspan="6" style="background-color: #004aad80;"> NUT IN SHELL REPORT AT RECEPTION</th>
        </tr>
        <tr>
            <td>DNIS SIZING (NIS)</td>
            <td>
                < 18mm </td>
            <td>
                18 - 20mm
            </td>
            <td>
                20 - 22mm
            </td>
            <td>
                22 - 25mm
            </td>
            <td>
                25mm +
            </td>
        </tr>
        <tr>
            <td>

            </td>
            <td>
                <?php
                $dnis_sizing_18mm->add();
                ?>
            </td>
            <td>
                <?php
                $dnis_sizing_18_20mm->add();
                ?>
            </td>
            <td>
                <?php
                $dnis_sizing_20_22mm->add();
                ?>
            </td>
            <td>
                <?php
                $dnis_sizing_22_25mm->add();
                ?>
            </td>
            <td>
                <?php
                $dnis_sizing_25mm->add();
                ?>
            </td>
        </tr>
    </table>

    <br>
    <br>

    <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</td>
            <td>
                <?php
                $other->add();
                ?>
            </td>
            <td colspan="4">
                <?php
                $other_comments->add();
                ?>
            </td>
        </tr>
    </table>

    <br>

    <!-- <table style="width: 90%">
        <tr>
            <th colspan="5">DNIS INSPECTION</th>
        </tr>
        <tr>
            <th></th>
            <th>SPECIFICATION</th>
            <th>RESULTS</th>
            <th>MEASURING UNIT</th>
            <th>PERCENTAGE</th>
        </tr>
        <tr>
            <td>MECHANICAL DAMAGE (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>HALF NUT (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>OPEN MICROPYLE (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>STING BUG (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>PALE SHELL (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>MIS-SHAPPED (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>DARK SHELL (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>GERMINATION (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>NUT BORER (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>CALCIUM DEF (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>OTHER (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
        <tr>
            <td>NIH QUANTITY (g)</td>
            <td></td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
            <td>
                <?php

                ?>
            </td>
        </tr>
    </table> -->

    <br>

    <table style="width: 90%">
        <tr>
            <th colspan="6" style="background-color: #004aad80;">KERNEL PRE-CRACK ANALYSIS</th>
        </tr>
        <tr>
            <td>
                A. TOTAL MASS OF SAMPLE WNIS (g):
            </td>
            <td colspan="5">
                <?php
                $total_wnis_sample_mass->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>
                B. TOTAL MASS OF SAMPLE DNIS (DATE) (g):
            </td>
            <td colspan="5">
                <?php
                $total_dnis_sample_mass->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>
                MASS OF SHELL (g)
            </td>
            <td>
                <?php
                $shell_mass->add();
                ?>
            </td>
            <td colspan="2">
                KERNAL M/C (%)
            </td>
            <td colspan="2">
                <?php
                $kernal_m_c->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>
                NIS MOISTURE LOSS (A - B ÷ A x 100) (g)
            </td>
            <td>
                <?php
                $nis_moisture_loss->add();
                ?>
            </td>
            <td colspan="4">
                UNSOUND ANALYSIS
            </td>
        </tr>
        <tr>
            <td>C. MASS OF SOUND KERNEL (%)</td>
            <td>
                <?php
                $sound_kernel_mass->add();
                ?>
            </td>
            <td>MOULD (g)</td>
            <td>
                <?php
                $mould->add();
                ?>
            </td>
            <td> 791 SPOT</td>
            <td>
                <?php
                $spot_791->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>ONION RING / DISCOLOURATION (g)</td>
            <td>
                <?php
                $onion_ring->add();
                ?>
            </td>
            <td>IMMATURE (g)</td>
            <td>
                <?php
                $immature->add();
                ?>
            </td>
            <td>OPEN MICROPYL (g)</td>
            <td>
                <?php
                $open_micro->add();
                ?>
            </td>

        </tr>
        <tr>
            <td>D. MASS OF UNSOUND KERNEL (g)</td>
            <td>
                <?php
                $unsound_kernel_mass->add();
                ?>
            </td>
            <td>SHELL MARK (g)</td>
            <td>
                <?php
                $shell_mark->add();
                ?>
            </td>
            <td>BROWN CENTER (g)</td>
            <td>
                <?php
                $brown_center->add();
                ?>
            </td>

        </tr>
        <tr>
            <td>E. TOTAL MASS OF KERNEL (C + ONION RING/DISC + D) (g)</td>
            <td>
                <?php
                $total_kernel_mass->add();
                ?>
            </td>
            <td>PIT CENTER (g)</td>
            <td>
                <?php
                $pit_center->add();
                ?>
            </td>
            <td>LATE STING BUG (g)</td>
            <td>
                <?php
                $late_sting_bug->add();
                ?>
            </td>

        </tr>
        <tr>
            <td>USK RECOVERY % (D ÷ E) X 100 (%)</td>
            <td>
                <?php
                $usk_recovery->add();
                ?>
            </td>
            <td>EARLY STING BUG (g)</td>
            <td>
                <?php
                $early_sting_bug->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>NIS USK RECOVERY (D ÷ B) X 100 (%)</td>
            <td>
                <?php
                $nis_usk_recovery->add();
                ?>
            </td>
            <td>NUTBORER</td>
            <td>
                <?php
                $nutborer->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>SOUND KERNEL RECOVERY % (C + ONION RING/DISC ÷ B X 100) (%)</td>
            <td>
                <?php
                $sound_kernel_recovery->add();
                ?>
            </td>
            <td>GERMINATION</td>
            <td>
                <?php
                $germination->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>IMMATURE % (IMM ÷ E) X 100 (%)</td>
            <td>
                <?php
                $immature_percent->add();
                ?>
            </td>
            <td>ADHERDED SKIN</td>
            <td>
                <?php
                $adhered_skin->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>TOTAL KERNEL RECOVERY % (E ÷ B) X 100 (%)</td>
            <td>
                <?php
                $total_kernel_recovery->add();
                ?>
            </td>
            <td>PINK STAINING</td>
            <td>
                <?php
                $pink_staining->add();
                ?>
            </td>
        </tr>
        <tr>
            <td colspan="4">TOTAL (g)</td>
            <td colspan="2">
                <?php
                $total->add();
                ?>
            </td>
        </tr>
    </table>

    <br>
    <!-- 
    <table>
        <tr>
            <th style="width: 25%;"></th>
            <th style="width: 15%;">Specification</th>
            <th>RESULTS</th>
            <th>MEASURING UNIT</th>
            <th>PERCENTAGE</th>
        </tr>
        <?php foreach ($rows as $key => $arr) { ?>
            <tr>
                <td><?php echo $arr[0]; ?></td>
                <td><?php echo $arr[1]; ?></td>
                <td><?php $inputs[$key]['results']->add(); ?></td>
                <td><?php $inputs[$key]['measuring_unit']->add(); ?></td>
                <td><?php $inputs[$key]['percentage']->add(); ?></td>
            </tr>
        <?php } ?>
    </table> -->

    <br>

    <table style="width: 90%">
        <tr>
            <th colspan="6" style="background-color: #004aad80;">STYLE BREAKDOWN OF SOUND KERNEL</th>
        </tr>
        <tr>
            <td>Style 0 (g)</td>
            <td>≥20mm</td>
            <td>
                <?php
                $style_0->add();
                ?>
            </td>
            <td>Style 5 (g)</td>
            <td>8 - 10mm</td>
            <td>
                <?php
                $style_5->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>Style 1 (g)</td>
            <td>16 - 20mm</td>
            <td>
                <?php
                $style_1->add();
                ?>
            </td>
            <td>Style 6 (g)</td>
            <td>6 - 8mm</td>
            <td>
                <?php
                $style_6->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>Style 1S (g)</td>
            <td>13 - 16mm</td>
            <td>
                <?php
                $style_1s->add();
                ?>
            </td>
            <td>Style 7 (g)</td>
            <td>3 - 6mm</td>
            <td>
                <?php
                $style_7->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>Style 4XL (g)</td>
            <td>≥16mm</td>
            <td>
                <?php
                $style_4xl->add();
                ?>
            </td>
            <td>Style 1C (g)</td>
            <td>≥16mm</td>
            <td>
                <?php
                $style_1c->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>Style 4L (g)</td>
            <td>13 - 16mm</td>
            <td>
                <?php
                $style_4l->add();
                ?>
            </td>
            <td>Style 1CS (g)</td>
            <td>13 - 16mm</td>
            <td>
                <?php
                $style_1cs->add();
                ?>
            </td>
        </tr>
        <tr>
            <td>Style 4 (g)</td>
            <td>10 - 13mm</td>
            <td>
                <?php
                $style_4->add();
                ?>
            </td>
            <td>Style 4C (g)</td>
            <td>10 - 13mm</td>
            <td>
                <?php
                $style_4c->add();
                ?>
            </td>
        </tr>
    </table>

    <br>

    <table>
        <tr>
            <th style="background-color: #004aad80;">Abrreviations</th>
        </tr>
        <tr>
            <td>
                <b>DNIS</b> - (Dry Nut In Shell)
            </td>
        </tr>
        <tr>
            <td>
                <b>WNIS</b> - (Wet Nut In Shell)
            </td>
        </tr>
        <tr>
            <td>
                <b>NIH</b> - (Nut In Shell)
            </td>
        </tr>
    </table>

    <br>

    <?php
    $submit_btn->add();
    ?>
</div>

<script>
    function calcNIS() {
        var total_wnis = parseFloat(document.getElementById('total_wnis_sample_mass').value);
        var total_dnis = parseFloat(document.getElementById('total_dnis_sample_mass').value);
        var total_nis = ((total_wnis + total_dnis) / total_wnis * 100).toFixed(2);
        document.getElementById('nis_moisture_loss').value = total_nis;
    }

    function calcMassOFKernal() {
        var sound_kernel_mass = parseFloat(document.getElementById('sound_kernel_mass').value);
        var onion_ring = parseFloat(document.getElementById('onion_ring').value);
        var unsound_kernel_mass = parseFloat(document.getElementById('unsound_kernel_mass').value);

        var total_kernel_mass = (sound_kernel_mass + onion_ring + unsound_kernel_mass).toFixed(2);
        document.getElementById('total_kernel_mass').value = total_kernel_mass;
    }

    function calcUSK() {
        var unsound_kernel_mass = parseFloat(document.getElementById('unsound_kernel_mass').value);
        var total_kernal_mass = parseFloat(document.getElementById('total_kernel_mass').value);

        var usk = ((unsound_kernel_mass / total_kernal_mass) * 100).toFixed(2);
        document.getElementById('usk_recovery').value = usk;
    }

    function calcNIS_USK() {
        var unsound_kernel_mass = parseFloat(document.getElementById('unsound_kernel_mass').value);
        var total_dnis = parseFloat(document.getElementById('total_dnis_sample_mass').value);

        var nis_usk = ((unsound_kernel_mass / total_dnis) * 100).toFixed(2);
        document.getElementById('nis_usk_recovery').value = nis_usk;
    }

    function calcSoundKernel() {
        var sound_kernel_mass = parseFloat(document.getElementById('sound_kernel_mass').value);
        var onion_ring = parseFloat(document.getElementById('onion_ring').value);
        var total_dnis = parseFloat(document.getElementById('total_dnis_sample_mass').value);

        var sound_kernel = ((sound_kernel_mass + onion_ring) / total_dnis * 100).toFixed(2);
        document.getElementById('sound_kernel_recovery').value = sound_kernel;
    }

    function immature() {
        var immature = parseFloat(document.getElementById('immature').value);
        var total_kernel_mass = parseFloat(document.getElementById('total_kernel_mass').value);

        var immature_percent = ((immature / total_kernel_mass) * 100).toFixed(2);
        document.getElementById('immature_percent').value = immature_percent;
    }

    function calcTotalKernelRecovery() {
        var total_kernel_mass = parseFloat(document.getElementById('total_kernel_mass').value);
        var total_dnis = parseFloat(document.getElementById('total_dnis_sample_mass').value);

        var total_kernel_recovery = ((total_kernel_mass / total_dnis) * 100).toFixed(2);
        document.getElementById('total_kernel_recovery').value = total_kernel_recovery;
    }
</script>

<?php
