<?php
ob_start();
session_start();
require_once("../conn/conn.php");
//include('../utility/chksession.php');
date_default_timezone_set("Asia/Bangkok");


$id_posub=$_POST['id_posub'];
$qc_datechecker=$_POST['qc_datechecker'];
$part_qtyqc=$_POST['part_qtyqc'];
$qc_checker=$_POST['qc_checker'];
$part_qty=$_POST['part_qty'];


if($part_qtyqc > $part_qty){
    ?>
                <script language="JavaScript" type="text/javascript">
                    <!--
                    alert("โปรตรวจสอบจำนวนตรวจรับ เนื่องจากเกินจำนวน !!!");
                    location.href='../user/sent_jobqc.php?id_posub=<?=$id_posub;?>';
                    //-->
                </script>
            <?php

}else{
    
    $sql = "UPDATE pd_posub SET part_qtyqc = '$part_qtyqc',qc_checker = '$qc_checker',qc_datechecker = '$qc_datechecker'  WHERE id_posub = '$id_posub'";
	$query = mysqli_query($con,$sql);
	
	
        if($query){
            ?>
                <script language="JavaScript" type="text/javascript">
                    <!--
                    alert("บันทึกข้อมูลเรียบร้อย");
                    location.href='../user/data_qc.php';
                    //-->
                </script>
            <?php
        }else{
            
            echo "Error: " . $sql . "<br>" . mysqli_error($con);

        }
        mysqli_close($con);
}


?>