
<?php
   // session_start();
    include_once('../config/conn/db-connection.php');
    include_once('../config/class/sap_model.php');
    $SAP = new SAP_infosytem();

        if(ISSET($_POST)){

               $first_name = trim($_POST['first_name']);
               $last_name = trim($_POST['last_name']);
               $email = trim($_POST['email']);
               $contact_number = trim($_POST['contact_number']);
               $message = trim($_POST['message']);

               $SAP->add_contact($first_name, $last_name, $email, $contact_number, $message);
                  echo '<script type="text/javascript">';
                  echo 'setTimeout(function () { swal("Add Contact Successfully!","Message!","success");';
                  echo '}, 1000);</script>';
                  echo '<script type="text/javascript">';
                  echo 'setTimeout(function(){';
                  echo 'window.location = "/SAP_Information_System/contact/contact.php"';
                  echo '},1000)';
                  echo '</script>';
             
        }
?>