<?php
require 'config.php';

if($_POST['hardship'])
{
 $hardship = $_POST['hardship'];
 $registration_date = $_POST['registration_date'];
 $cases = $_POST['cases'];
 $percentage = $_POST['percentage'];
 $stmt=$pdo->prepare("insert into hardships(cases,registration_date,name,percentage)values(:cases,:registration_date,:hardship,:percentage)");
 $stmt->bindParam(':hardship', $hardship);
 $stmt->bindParam(':registration_date', $registration_date);
 $stmt->bindParam(':cases', $cases);
 $stmt->bindParam(':percentage', $percentage);
 if ($stmt->execute()) { 
	 echo 1;
     exit;
 }
 else{
	echo 0;
    exit;
 }
}
?>
