<?php
include($_SERVER['DOCUMENT_ROOT'] . "/API-Others/connection/conn.php");
// error_reporting(E_ALL);
// ini_set('display_errors', '1');
header('content-type:application/json');
$customer = isset($_POST['customerName']) ? $_POST['customerName'] : '';
$warehouse = isset($_POST['warehouse']) ? $_POST['warehouse'] : '';
$productSerialNumber = isset($_POST['productSerialNumber']) ? $_POST['productSerialNumber'] : '';
$frameType = isset($_POST['frameType']) ? $_POST['frameType'] : '';
$frameSize = isset($_POST['frameSize']) ? $_POST['frameSize'] : '';
$date = isset($_POST['date']) ? $_POST['date'] : '';
$sql = ("INSERT INTO finishedproductsentry (Customer, Warehouse, SerialNumber, FrameType, FrameSize, Date) VALUES ('$customer','$warehouse', '$productSerialNumber', '$frameType', '$frameSize','$date')");
if (mysqli_query($conn, $sql)) {
    $statusCode = 200;
    $statusMessage = "Saved Successfully";
} else {
    $error = "Error: " . mysqli_error($conn);
}

$resultData = array('code' => $statusCode, 'message' => $statusMessage);
echo json_encode($resultData);
