<?php
require 'config.php';

if($_POST['id'])
{
 $id = $_POST['id'];
 $agegroup = $_POST['agegroup'];
 $registration_date = $_POST['registration_date'];
 $involuntary = $_POST['involuntary'];
 $voluntary = $_POST['voluntary'];
 $stmt=$pdo->prepare("update duration set agegroup=:agegroup, registration_date=:registration_date,involuntary=:involuntary, voluntary=:voluntary WHERE id=:id");
 $stmt->bindParam(':id', $id);
 $stmt->bindParam(':agegroup', $agegroup);
 $stmt->bindParam(':registration_date', $registration_date);
 $stmt->bindParam(':involuntary', $involuntary);
 $stmt->bindParam(':voluntary', $voluntary);
 if ($stmt->execute()) { 
	 echo 1;
     exit;
 }
 else{
	echo 0;
    exit;
 }
}
?>
