<?php 
require "../../includes/database.php"
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
  

  $sql = "INSERT INTO NewMember(NewMemberFirstName, NewMemberLastName, NewMembertPhoneNumber, NewMemberEmail, NewMemberLastChurch, NewMemberMaritalStatus, NewMemberBirthDay, NewMemberFormPastor)
          VALUES ('" . mysqli_escape_string($conn, $_POST['NewMemberFirstName']) . "', '"
                      . mysqli_escape_string($conn, $_POST['NewMemberLastName']) . "', '"
                      . mysqli_escape_string($conn, $_POST['NewMemberPhoneNumber']) . "', '"
                      . mysqli_escape_string($conn, $_POST['NewMemberEmail']) . "', '"
                      . mysqli_escape_string($conn, $_POST['NewMemberMaritalStatus']) . "', '"
                      . mysqli_escape_string($conn, $_POST['NewMemberBirthDay']) . "', '"
                      . mysqli_escape_string($conn, $_POST['NewMemberFormPastor']) . "', '"
                     . mysqli_escape_string($conn, $_POST['NewMemberLastChurch']) . "')";

  $results= mysqli_query($conn, $sql);

  if ($results === false) {
    echo mysqli_error($conn);
  } else {
    $id = mysqli_insert_id($conn);
    echo "Thank you for choosing our church to be a member. Your confirmation Id is: $id";
    
    

  }

}
 ?>
 
 <div>
     <h2>Next class will be started on July 20, 25 at 9:am at the church  address at the main church</h2>
     <h2>Please arrive 15 minutes early receive the documents for the class</h2>
 </div>