<?php
require 'config.php';

if($_POST['region'])
{
 $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("insert into ethiopia(region,registration_date,total,male,female,minors,children_male,children_female,unspecified_male,unspecified_female,unspecified,voluntaryreturns,involuntaryreturns)values(:region,:registration_date,:total,:male,:female,:minors, :children_male, :children_female, :unspecified_male, :unspecified_female,:unspecified, :voluntaryreturns,:involuntaryreturns)");
 $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;
 }
}
?>
