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

$jobh_id=$_POST['jobh_id'];
$id_posub=$_POST['id_posub'];
$part_qty=$_POST['part_qty'];
$id_dep = $_SESSION['id_dep'];
$mac_id = $_POST['mac_id'];
$job_pdid=$_POST['job_pdid'];
$job_date=$_POST['job_date'];
$job_enddate=$_POST['job_enddate'];
$jobh_id=$_POST['jobh_id'];
$job_respon=$_POST['job_respon'];
$job_qty=$_POST['job_qty'];
$id_dep = $_SESSION['id_dep'];
//$stop_total =$_POST['stop_total'];
$job_round=$_POST['job_round'];
echo $id_posub;
echo $id_dep;

//exit;

            
            $sqljob = "INSERT INTO `pd_jobsub` (`job_id`,`job_round`,`jobh_id`,`id_posub`,`id_dep`,`mac_id`,`job_pdid`,`job_date`,`job_enddate`,`job_respon`,`job_qty`,`job_record`) 
            VALUES ('NULL','$job_round','$jobh_id','$id_posub','$id_dep','$mac_id','$job_pdid','$job_date','$job_enddate','$job_respon','$job_qty',NOW())";
	        $queryjob = mysqli_query($con,$sqljob);
                if($queryjob){
                    ?>
                    <script language="JavaScript" type="text/javascript">
                        <!--
                        alert("บันทึกข้อมูลเรียบร้อย");
                        location.href='../user/user_jobsub2.php?id_posub=<?=$id_posub;?>';
                        //-->
                    </script>
                    <?php
                }else{
                    
                    echo "Error: " . $sqljob . "<br>" . mysqli_error($con);
        
                }
        mysqli_close($con);
            
            










?>