<?php
include "../classes/db.class.php";
$db = new db();

$pv = $_GET['pv'];
$ffa = $_GET['ffa'];
$variety = $_GET['variety'];
$weight = $_GET['weight'];
$size = $_GET['size'];
$sound_not_sound = $_GET['sound_not_sound'];
$mold = $_GET['mold'];
$moisture = $_GET['moisture'];
$client = $_GET['client'];
$shell = $_GET['shell'];
$date = date("Y-m-d H:i", strtotime("+ 2hours"));

// echo "INSERT INTO `batches`(`pv`, `ffa`, `variety_id`, `weight`, `size`, `sound_not_sound`, `mold`, `moisture`, `client_id`, `shell`, `date`) VALUES ('$pv','$ffa','$variety','$weight','$size','$sound_not_sound','$mold','$moisture','$client','$shell','$date')";

$res = $db->insert("INSERT INTO `batches`(`pv`, `ffa`, `variety_id`, `weight`, `size`, `sound_not_sound`, `mold`, `moisture`, `client_id`, `shell`, `date`) VALUES ('$pv','$ffa','$variety','$weight','$size','$sound_not_sound','$mold','$moisture','$client','$shell','$date')");

if ($res) {
    echo 1;
} else{
    echo 0;
}