<?php
require 'config.php';

if($_POST['id'])
{
 $id = $_POST['id'];
 $region = $_POST['region'];
 $registration_date = $_POST['registration_date'];
 $total = $_POST['total'];
 $male = $_POST['male'];
 $female = $_POST['female'];
 $minors = $_POST['minors'];
 $children_male = $_POST['children_male'];
 $children_female = $_POST['children_female'];
 $unspecified_male = $_POST['unspecified_male'];
 $unspecified_female = $_POST['unspecified_female'];
 $unspecified = $_POST['unspecified'];
 $voluntaryreturns = $_POST['voluntaryreturns'];
 $involuntaryreturns = $_POST['involuntaryreturns'];
 $stmt=$pdo->prepare("update ethiopia set region=:region, registration_date=:registration_date, total=:total, male=:male, female=:female, minors=:minors,  children_male=:children_male, children_female=:children_female, unspecified_male=:unspecified_male, unspecified_female=:unspecified_female, unspecified=:unspecified, voluntaryreturns=:voluntaryreturns, involuntaryreturns=:involuntaryreturns WHERE id=:id");
 $stmt->bindParam(':id', $id);
 $stmt->bindParam(':region', $region);
 $stmt->bindParam(':registration_date', $registration_date);
 $stmt->bindParam(':total', $total);
 $stmt->bindParam(':male', $male);
 $stmt->bindParam(':female', $female);
 $stmt->bindParam(':minors', $minors);
 $stmt->bindParam(':children_male', $children_male);
 $stmt->bindParam(':children_female', $children_female);
 $stmt->bindParam(':unspecified_male', $unspecified_male);
 $stmt->bindParam(':unspecified_female', $unspecified_female);
 $stmt->bindParam(':unspecified', $unspecified);
 $stmt->bindParam(':voluntaryreturns', $voluntaryreturns);
 $stmt->bindParam(':involuntaryreturns', $involuntaryreturns);
 if ($stmt->execute()) { 
	 echo 1;
     exit;
 }
 else{
	echo 0;
    exit;
 }
}
?>
