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

$no_po=$_POST['no_po'];
$id_name=$_POST['id_name'];
$order_date=$_POST['order_date'];
$comfirm_date=$_POST['comfirm_date'];
$complete_date=$_POST['complete_date'];
$delivery_date=$_POST['delivery_date'];
$remark=$_POST['remark'];
$qty=$_POST['qty'];
$unit=$_POST['unit'];
 echo $order_date;

//exit;    
  
    $sql = "INSERT INTO `pd_po` (`no_po`, `id_name`,`order_date`,`comfirm_date`,`complete_date`,
    `delivery_date`,`remark`,`qty`,`unit`,`po_status`) 
    VALUES ('$no_po', '$id_name', '$order_date','$comfirm_date','$complete_date', '$delivery_date', '$remark', '$qty', '$unit','รอดำเนินการ')";
	$query = mysqli_query($con,$sql);
        if($query){
            ?>
                <script language="JavaScript" type="text/javascript">
                    <!--
                    alert("บันทึกข้อมูลเรียบร้อย");
                    location.href='../admin/data_po.php';
                    //-->
                </script>
            <?php
        }else{
            
            echo "Error: " . $sql . "<br>" . mysqli_error($con);

        }
        mysqli_close($con);





?>