<?php header('Location: https://blink.emtel.com/');?>
<?php
session_start();
if(isset($_POST['postData'])){
    parse_str($_POST['postData'], $postData);
    $name = $postData['name'];
    $email = $postData['email'];
    $message = $postData['message'];
	$token = $postData['token'];
	
    $from = 'From: '.$email;
    $to = 'emtel@emtel.com';
    $subject = 'Emtel Cash';

    $body = "From: $name\n e-mail: $email\n
    message: $message";

    $result['result'] = 0;
    $result['msg'] = "Something went wrong, go back and try again!";
	
 if(isset($_SESSION['token']) && $token == $_SESSION['token']){
		if(mail($to, $subject, $body, $from)){	
			$result['result'] = 1;
			$result['msg'] = "Your message has been sent!";							  
		}
	}
	echo json_encode($result);
	die();
}

define("salt","12345678abcdefghijkl");
$hash = uniqid(mt_rand(), true).salt;
$token = md5($hash);
$_SESSION['token'] = $token;
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Emtel Cash | Contact Us</title>
        <?php include ('inc/assets.php'); ?>
		<link rel="shortcut icon" type="images/icon" href="<?php echo site_path; ?>/assets/img/favicon.ico" sizes="16x16"/>
    </head>
    <body>
        <?php include('inc/header.php');?>
        <div class="container">
        <div class="navigation">
        <div class="navigation___logo">
            <a href="index.php"><img src="<?php echo site_path; ?>/assets/img/emtel_cash_logo.png" alt="Emtel cash logo"/></a>
        </div>
        <div class="mobile__menu">
            <img src="<?php echo site_path; ?>/assets/img/hamburger_menu.png"/>
        </div>
        <div class="navigation__menu">
            <ul>
				<li><a href="<?php echo site_path; ?>/">Home</a></li>
                <li><a href="<?php echo site_path; ?>/get-started.php"> get started </a></li>
				<!--<li><a href="<?php echo site_path; ?>/merchants.php"> Merchants </a></li>-->
                <li><a href="<?php echo site_path; ?>/security.php"> security </a></li>
                <li><a href="<?php echo site_path; ?>/downloads.php"> downloads </a></li>
                <li><a href="<?php echo site_path; ?>/faq.php"> faq </a></li>
            </ul>
        </div>
    </div>

</div>
<?php include('inc/slider.php'); ?>
<div class="container">
<div class="default__wrapper">
    <h1> Contact Us </h1>
    <div class="container">
        <div class="contact-left">
        <p id="msg"></p>
		<p id="token"></p>
        <div class="contact-form">
            <form action="<?php echo site_path?>/contact-us.php" method="POST" id="sendMailFrm">
            <input type="hidden" name="token" value="<?php echo $token;?>">
			<input name="name" placeholder="Your Name" required> <br>
            <input name="email" type="email" placeholder="Email" required> <br>
            <textarea name="message" placeholder="Message" required></textarea> <br>
            <input id="sendMailBtn" name="submit" type="submit">
            </form>
        </div>
    </div>
    <div class="contact-right">
        <p><strong>Emtel Customer Care</strong></p>
	<p>To ensure you are assisted at all times please use the following numbers for your queries:</p>
	<p><strong>8970</strong>: From 09:00 till 19:00 everyday for any Emtel Cash queries</p>
	<p><strong>(Call FREE from your Emtel or Emtel Fixed Phone)</strong></p>
	<p><strong>57298000: (Emergency Hotline) </strong> to report cases of Fraud/losses/theft of your respective Emtel Cash wallet.
</p>
    <p><strong>Emtel World</strong></p>
	<p>10 Ebene Cybercity, Ebene 72201, Mauritius</p>
	<p>Head Office: +230 572 95400</p>
	<p>Fax: +230 454 1010</p>
	<p>Email: emtel@emtel.com</p>
    </div>
    </div>

</div>
</div>
        <?php include('inc/footer.php');?>
    <body>
</html>

