<?php
  include '_connect.php';
  $BILL_DATE = $_POST['BILL_DATE'];
  $BR_ID = $_POST['BR_ID'];
  $CT_NO = $_POST['CT_NO'];
  $PS_NAME = $_POST['PS_NAME'];
  $FEE_STATUS = $_POST['FEE_STATUS'];
  $CROP_NAME = $_POST['CROP_NAME'];
  $BRAND_NAME = $_POST['BRAND_NAME'];
  $SERIAL_NO = $_POST['SERIAL_NO'];
  $CC_SIZE = $_POST['CC_SIZE'];
  $FEE_SUMPRICE = $_POST['FEE_SUMPRICE'];
  $BILL_DATE2 = $_POST['BILL_DATE2'];
  $BILL_NO = $_POST['BILL_NO'];
  $FEE_PRICE = $_POST['FEE_PRICE'];
  $ACT_DATE = $_POST['ACT_DATE'];
  $PLOCNO = $_POST['PLOCNO'];
  $PLCDATE = $_POST['PLCDATE'];
  $PLATE = $_POST['PLATE'];
  $PR_CODE = $_POST['PR_CODE'];
  $REF_NO = $_POST['REF_NO'];
  $FEE_SNO = $_POST['FEE_SNO'];
  $sql_ib64 = "INSERT INTO CONFIG.dbo.ACT_NEWACTS
  (BILL_DATE, BR_ID, CT_NO, PS_NAME, FEE_STATUS, CROP_NAME,
  BRAND_NAME, SERIAL_NO, CC_SIZE, FEE_SUMPRICE, BILL_DATE2, BILL_NO,
  FEE_PRICE, ACT_DATE, PLOCNO, PLCDATE, PLATE, PR_CODE,
  REF_NO, FEE_SNO)
  VALUES ('$BILL_DATE', '$BR_ID', '$CT_NO', '$PS_NAME', '$FEE_STATUS', '$CROP_NAME',
  '$BRAND_NAME', '$SERIAL_NO', '$CC_SIZE', '$FEE_SUMPRICE', '$BILL_DATE2', '$BILL_NO',
  '$FEE_PRICE', '$ACT_DATE', '$PLOCNO', '$PLCDATE', '$PLATE', '$PR_CODE',
  '$REF_NO', '$FEE_SNO')";
  // echo $sql_ib64;
  $result = $conn->query($sql_ib64);
  if ($result) {
    // echo "บันทึกข้อมูลสำเร็จ";
    // header("location:act_index_new2.php");
    echo "<script>alert('บันทึกข้อมูลสำเร็จ');window.location='act_index_new2.php';</script>";
  }
  else {
    echo "Error : " . $sql . "<br>" . $conn->error;
    // header("location:act_index_new2.php");
    echo "<script>alert('บันทึกข้อมูลไม่สำเร็จ');window.location='act_index_new2.php';</script>";
  }
?>
