<!DOCTYPE html>
<html lang="en">
<head>
    
    <?php include('includes/meta.php');?>
    <title>H2O | Hosting</title>
    <?php include('includes/css.php');?>
    
</head>
  <body>
  
  <div class="site-wrap">

  <?php include('includes/social.php');?>
    <!-- Header Section -->
    <?php include('layouts/navbar.php');?>
    <!-- Header Section end -->

  
    <div class="unit-5 overlay" style="background-image: url('images/hero_bg_2.jpg');">
      <div class="container text-center">
        <h2 class="mb-0">Contact Us</h2>
        <p class="mb-0 unit-6"><a href="index.php">Home</a> <span class="sep">></span> <span>Contact us</span></p>
      </div>
    </div>

    <?php
				// function __autoload($class){
				// 	require_once "classes/$class.php";
				// }
				spl_autoload_register(function($class) {
					include 'classes/' . $class . '.php';
				});
				
				$emails = new Emailpro();


				if(isset($_POST['send'])){

					$details = [
						"names"      => $_POST['names'],
						"email"      => $_POST['email'],
						"phone"      => $_POST['phone'],
						"subject"    => $_POST['subject'],
						"message"    => $_POST['message'],
					];

					$res = $emails->sendemail($details);
					if($res){
						?>
						<script>
							Swal.fire(
								'Email Sent!',
								'Thank you for emailing us , we will respond soon!',
								'success'
								)
						</script>
						<?php
					}else{
						?>
						<script>
							Swal.fire(
								'Failed to send email!',
								'Sorry we could not send you email , please try again!',
								'error'
								)
						</script>
						<?php
					}

				}
			?>
    <div class="site-section bg-light">
      <div class="container">
        <div class="row">
       
          <div class="col-md-12 col-lg-8 mb-5">
          
            
          
            <form action="contact.php" method="POST" class="p-5 bg-white">

              <div class="row form-group">
                <div class="col-md-12 mb-3 mb-md-0">
                  <label class="font-weight-bold" for="fullname">Full Name</label>
                  <input type="text" id="fullname" class="form-control" name="names" placeholder="Full Name">
                </div>
              </div>
              <div class="row form-group">
                <div class="col-md-12">
                  <label class="font-weight-bold" for="email">Phone Number</label>
                  <input type="phone" id="phone" class="form-control" name="phone" placeholder="Email Address">
                </div>
              </div>
              <div class="row form-group">
                <div class="col-md-12">
                  <label class="font-weight-bold" for="email">Email</label>
                  <input type="email" id="email" class="form-control" name="email" placeholder="Email Address">
                </div>
              </div>
              <div class="row form-group">
                <div class="col-md-12">
                  <label class="font-weight-bold" for="email">Subject</label>
                  <input type="text" id="subject" class="form-control" name="subject" placeholder="Enter Subject">
                </div>
              </div>
              

              <div class="row form-group">
                <div class="col-md-12">
                  <label class="font-weight-bold" for="message">Message</label> 
                  <textarea name="message" id="message" name="message" cols="30" rows="5" class="form-control" placeholder="Say hello to us"></textarea>
                </div>
              </div>

              <div class="row form-group">
                <div class="col-md-12">
                  <input type="submit" name="send" value="Send" class="btn btn-primary  py-2 px-4 rounded-0">
                </div>
              </div>

  
            </form>
          </div>

          <div class="col-lg-4">
            <div class="p-4 mb-3 bg-white">
              <h3 class="h5 text-black mb-3">Contact Info</h3>
              <p class="mb-0 font-weight-bold">Address</p>
              <p class="mb-4">36 Serena 16 Watkinson road , Driekhoock , Germiston</p>

              <p class="mb-0 font-weight-bold">Phone</p>
              <p class="mb-4"><a href="#">068 016 2109</a></p>

              <p class="mb-0 font-weight-bold">Email Address</p>
              <p class="mb-0"><a href="#">info@h2ohosting.co.za</a></p>

            </div>
            
            <div class="p-4 mb-3 bg-white">
              <h3 class="h5 text-black mb-3">More Info</h3>
              <p>Our support team is always available ,ready to assist you</p>
              <p><a href="about.php" class="btn btn-primary  py-2 px-4 rounded-0">Learn More</a></p>
            </div>
          </div>
        </div>
      </div>
    </div>

   <!-- Header Section -->
   <?php include('layouts/footer.php');?>
    <!-- Header Section end -->
  </div>

  <?php include('includes/js.php');?>
    
  </body>
</html>