/home/desid573/svoldvine.com.au
Edit: /home/desid573/svoldvine.com.au/blockadd.php (1929B)
connect_error);
$variety = $_POST["variety"];
if($variety == "other") {
$variety = $_POST["variety-other"];
}
$rootstock_bool = $_POST["rootstock_bool"];
if($rootstock_bool == "rootstock") {
$rootstock = $_POST["rootstock"];
if($rootstock == "other") {
$rootstock = $_POST["rootstock-other"];
}
} else {
$rootstock = "";
}
$soil = $_POST["soil"];
if($soil == "other") {
$soil = $_POST["soil-other"];
}
$training = $_POST["training"];
if($training == "other") {
$training = $_POST["training-other"];
}
$orientation = $_POST["orientation"];
if($orientation == "other") {
$orientation = $_POST["orientation-other"];
}
$query = "INSERT INTO `block`(`id`, `vid`, `old_vine`, `variety`, `year`, `block`, `clone`, `no_vines`, `area`, `rootstock_bool`, `rootstock`, `soil_type`, `training`, `orientation`) VALUES (NULL,".$_POST["vid"].",'".$_POST["age"]."','".$variety."','".$_POST["year"]."','".$_POST["block"]."','".$_POST["clone"]."','".$_POST["vines"]."','".$_POST["area"]."','".$rootstock_bool."','".$rootstock."','".$soil."','".$training."','".$orientation."')";
$result = $conn->query($query);
if(!$result) {
error_log("error adding block ".$conn->error);
header('Location: block.php?redirect=error&id='.$_POST["login_code"]);
exit;
} else {
header('Location: block.php?redirect=success&id='.$_POST["login_code"]);
exit;
}