<?php
header('Content-Type: application/json; charset=utf-8');
include("../function/func.php");
$data = json_decode(file_get_contents('php://input'), true);
/*
//var_dump($data);
$keys = array_keys((array)$data);
foreach($keys as $key){
    echo "$".$key."=\$data['".$key."'];\r\n";
}*/

$orderID=$data['orderID'];
$testDate=$data['testDate'];
$projectName=$data['projectName'];
$applicantName=$data['applicantName'];
$businessOwner=$data['businessOwner'];
$supervisor=$data['supervisor'];
$contractor=$data['contractor'];
$sampler=$data['sampler'];
$examinator=$data['examinator'];
$structuralPart=$data['structuralPart'];
$remark=$data['remark'];
$productionDate=$data['productionDate'];
$testedMaterial=$data['testedMaterial'];
$weather=$data['weather'];
$materialsUsed=$data['materialsUsed'];
$surfaceTemp=$data['surfaceTemp'];
$equipUsed=$data['equipUsed'];
$materialsName=$data['materialsName'];
$paymentCompany=$data['paymentCompany'];
$paymentTax=$data['paymentTax'];
$paymentAddr=$data['paymentAddr'];
$paymentContactor=$data['paymentContactor'];
$paymentPhone=$data['paymentPhone'];
$paymentFee=$data['paymentFee'];
$tester=$data['tester'];

$result=createNewOrder($orderID,$testDate,$projectName,$applicantName,$businessOwner,$supervisor,$contractor,$sampler,$examinator,$structuralPart,$remark,$productionDate,$testedMaterial,$weather,$materialsUsed,$surfaceTemp,$equipUsed,$materialsName,$paymentCompany,$paymentTax,$paymentAddr,$paymentContactor,$paymentPhone,$paymentFee,$tester);

$resultCode['retCode']=1;
$resultCode['resMessage']="";
if($result!=1){
    $resultCode['retCode']=0;
    $resultCode['resMessage']=$result;
}
echo json_encode($resultCode);
?>