<?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'];
$job_pdid=$_POST['job_pdid'];



if($job_pdid == "" ){
    ?>
        <script language="JavaScript" type="text/javascript">
			<!--
			alert("กรุณากรอกข้อมูลให้ครบถ้วน !!! ");
			location.href='../admin/add_jobid.php';
			//-->
		</script>
    <?php 
}else{
    
    $sql = "INSERT INTO `pd_job` (`jobh_id`, `id_posub`, `job_pdid`, `jobh_status`) VALUES ('NULL', '$id_posub', '$job_pdid', 'รอดำเนินการ')";
	$query = mysqli_query($con,$sql);
        if($query){
            ?>
                <script language="JavaScript" type="text/javascript">
                    <!--
                    alert("บันทึกข้อมูลเรียบร้อย");
                    location.href='../user/user_job.php';
                    //-->
                </script>
            <?php
        }else{
            
            echo "Error: " . $sql . "<br>" . mysqli_error($con);

        }
        mysqli_close($con);
}




?>