<?php
include('../includes/session.php');
include('../includes/config.php');
include('../template/ahkweb/index.php');

?>
<?php
if (isset($_POST['txn_form']) && $_POST['txn_form'] == "ahkwebsolutions"  ){
  
  $name = mysqli_real_escape_string($ahk_conn, $_POST['name']);
  $email = mysqli_real_escape_string($ahk_conn, $_POST['email']);
  $sub = mysqli_real_escape_string($ahk_conn, $_POST['sub']);
  $mess = mysqli_real_escape_string($ahk_conn, $_POST['mess']);
  $res = mysqli_query($ahk_conn,"INSERT INTO `contact`(`name`, `email`, `sub`, `mess`,`status`,`reply`) VALUES ('$name','$email','$sub','$mess','pending','Not Solve Yet')");
  if($res){
      ?>
      <script>
          $(function(){
              Swal.fire(
                  'Success',
                  'Message Send Successfully',
                  'success'
              )

          });
           
  window.setTimeout(function() {
  window.location.href = "index.php";
  }, 1500);
      </script>
      <?php
  }else{
      ?>
      <script>
          $(function(){
              Swal.fire(
                  'Opps',
                  'Internal Server Problem Please Try Again Lates!',
                  'error'
              )

          });
      </script>
      <?php

  }
  
}
?>