<?php
include "../../root.class.php";
$db = new db_safeguard();

$date = date("Y-m-d H:i", strtotime("+2 Hours"));
var_dump($_POST);

$kernal_id = $db->query("kernal_analysis","INSERT INTO `pre_crack_kernal_analysis`(`receiving_batch_no`, `date`, `total_sample_wnis_mass`, `total_sample_dnis`, `shell_mass`, `nis_moisture_loss`, `sound_kernal_mass`, `onion_ring`, `unsound_kernal_mass`, `total_kernal_mass`, `usk_recovery`, `nis_usk_recovery`, `sound_kernal_recovery`, `immature_percentage`, `total_kernal_recovery`, `mould`, `immature`, `shell_mark`, `pit_center`, `early_sting_bug`, `nutborer`, `germination`, `adhered_skin`, `pink_staining`, `spot_791`, `open_micropyl`, `brown_center`, `late_sting_bug`, `total`) VALUES ('{$_POST['receiving_batch_no']}', '{$date}', '{$_POST['total_wnis_sample_mass']}', '{$_POST['total_dnis_sample_mass']}', '{$_POST['shell_mass']}', '{$_POST['nis_moisture_loss']}', '{$_POST['sound_kernel_mass']}', '{$_POST['onion_ring']}', '{$_POST['unsound_kernel_mass']}', '{$_POST['total_kernel_mass']}', '{$_POST['usk_recovery']}', '{$_POST['nis_usk_recovery']}', '{$_POST['sound_kernel_recovery']}', '{$_POST['immature_percent']}', '{$_POST['total_kernel_recovery']}', '{$_POST['mould']}', '{$_POST['immature']}', '{$_POST['shell_mark']}', '{$_POST['pit_center']}', '{$_POST['early_sting_bug']}', '{$_POST['nutborer']}', '{$_POST['germination']}' , '{$_POST['adhered_skin']}', '{$_POST['pink_staining']}', '{$_POST['791_spot']}', '{$_POST['open_micropyl']}', '{$_POST['brown_center']}', '{$_POST['late_sting_bug']}', '{$_POST['total']}')");

$nut_progess = $db->query("nut_analysis_report","UPDATE `nut_analysis_report` SET `status` = 'STYLE BREAKDOWN' WHERE `receiving_batch_no` = '{$_POST['receiving_batch_no']}'");

echo "
<script>
window.location.href = 'style_breakdown.php';
</script>
";