<?php
$mailResult=null;
if(isset($_POST['name'],$_POST['emailaddress'],$_POST['description'])) { //check if there is POST data, e.g. the form has been submitted
	// Contact Subject
	$subject = "Sion website visitor";
	// Details
	$name = $_POST['name'];
	//$name = "Tisho";
	$message = htmlspecialchars($_POST['description']); //sanitize message contents to avoid code injection in the email
	//$message = "Test with strings";

	// Mail of sender
	$mail_from = $_POST['emailaddress'];
	//$mail_from = "tishkatap@gmail.com";

	// From
	$header = "From: $name<$mail_from>". "\r\n";
	$header  .= 'MIME-Version: 1.0' . "\r\n";
	$header .= 'Content-type: text/plain; charset=utf-8' . "\r\n";

	// Your email address

	$to = "iyanev@sion.bg";

	// $send_contact = mail($to, $subject, $message, $header);
	$mailResult = mail($to, $subject, $message, $header);

	// Check if message is sent
	// Display message

	if($mailResult){
		//echo "Sent";
		header('Location: '.$scriptname.'?result=ok');
		exit();
	}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="SION JSCo">
    <title>Sion Contacts</title>
    <link rel="icon" type="image/png" href="img/SionLogoSignOnly.png">
    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- Fonts google -->
    <link href='https://fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700,800,900' rel='stylesheet'
          type='text/css'>
    <!-- Custom CSS -->
    <link href="css/carousel.css" rel="stylesheet">
    <link href="css/navbarMediaOnly.css" rel="stylesheet">
    <link href="css/heroClassStyles.css" rel="stylesheet">
    <link href="css/flipButtonsStyle.css" rel="stylesheet">
    <link href="css/aboutUsStyle.css" rel="stylesheet">
    <link href="css/contactsStyle.css" rel="stylesheet">



    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top">
    <div class="row">
        <div class="navbar-header col-md-3">
            <button type="button" class="navbar-toggle" id="nav-icon1" data-toggle="collapse" data-target="#myNavbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <div class="navbar-a-holder>">
                <a class="navbar-brand" href="index.html">
                    <img class="img-responsive" alt="Brand" id="nav-logo-img" src="img/SION-Logo.png">
                </a>
            </div>
        </div>
        <div class="collapse navbar-collapse col-sm-9" id="myNavbar" style="border-top-width: 0;">
            <ul class="nav navbar-nav" id="nav-ul">
                <li><a href="business.html" class="navbarCustText"><span>&#x276F;&emsp;</span>BUSINESS <br
                        class="br">DESCRIPTION</a></li>
                <li><a href="softwareDev.html" class="navbarCustText"><span>&#x276F;&emsp;</span>SOFTWARE <br
                        class="br">DEVELOPMENT</a></li>
                <li><a href="hardwareDev.html" class="navbarCustText"><span>&#x276F;&emsp;</span>HARDWARE <br
                        class="br">DEVELOPMENT</a></li>
                <li><a href="industrialDesign.html" class="navbarCustText"><span>&#x276F;&emsp;</span>INDUSTRIAL <br class="br">DESIGN </a>
                </li>
                <li><a href="uiux.html" class="navbarCustText"><span>&#x276F;&emsp;</span>UI / UX <br class="br">DESIGN </a>
                </li>
            </ul>
        </div>
    </div>
</nav>
<div class="content-pusher"></div>
<!-- END Navigation -->
<div class="overlay"></div>

<!-- CONTACTS MAIN SECTION -->

<div class="wrapper">
    <div class="container">
        <!--<div class="overlay"></div>-->
        <div class="col-sm-12 text-center col-md-10 col-md-push-1 central-container">
            <div class="container logo" id="logo">
                <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 col-xs-offset-2" id="logo-left">
                    <img class="img-responsive logo-big" alt="Brand" src="img/logo-big.png">
                    <img class="img-responsive logo-small" alt="Brand" src="img/SionLogoSignOnly.png">
                </div>
                <div class="col-lg-5 col-md-5 col-sm-12 col-xs-12" id="logo-right">
                    <!--<div class="col-xs-12" id="first-half">-->
                    <p class="col-xs-12 left-p">YOU HAVE A DREAM ...</p>
                    <p class="col-xs-12">YOU WANT TO BUILD IT ...</p>
                    <!--</div>-->
                    <!--<div class="col-xs-12" id="second-half">-->
                    <p class="col-xs-12 right-p">ALL YOU NEED IS TO ... </p>
                    <p class="col-xs-12"><a href="Contacts.php" id="contact">CONTACT US.</a></p>
                    <!--</div>-->
                </div>
            </div>
            <div class="container contact-us-container">
<?php
if(!isset($_GET['result']) || $_GET['result']!='ok') { //show input form if no message is send or there is an error {// ?>
				<form action="<?php echo $scriptname; ?>" method="post" enctype="application/x-www-form-urlencoded" accept-charset="UTF-8">
					<input name="name" placeholder="NAME /" class="name" required="required" id="username" value="<?php if(isset($_POST['name'])) echo htmlspecialchars($_POST['name']); ?>" />
					<input name="emailaddress" placeholder="EMAIL ADDRESS /" class="email" type="email" id="customer_mail" required="required" value="<?php if(isset($_POST['emailaddress'])) echo htmlspecialchars($_POST['emailaddress']); ?>" />
					<textarea rows="4" cols="50" name="description" placeholder="DESCRIPTION /" class="message" id="description" required="required"><?php if(isset($_POST['description'])) echo htmlspecialchars($_POST['description']); ?></textarea>
					<input name="submit" class="btn-submit" type="submit" value="SEND" />
				</form>
<?php
} //} show input form if no message is send or there is an error//
else { //the result is "OK", so show a success message {//
?>
				<div class="success" style="color: white;
                                         font-size: 1.5em;
                                     ">Message send successfully</div>
<?php
}//} the result is "OK", so show a success message//
?>
            </div>
            <div class="bottom-nav-buttons-container container-fluid">
                <div class="container-fluid col-xs-12" id="bottom-nav-buttons">
                    <div class="cube flip-to-top">
                        <div class="default-state">
                            <a href="About%20Us.html">
                                <div class="btn btn-hero btn-lg btn-clear btn-sm btn-min-block">ABOUT US</div>
                            </a>
                        </div>
                        <div class="active-state">
                            <a href="About%20Us.html">
                                <div class="btn btn-hero btn-lg btn-clear btn-sm btn-min-block">ABOUT US</div>
                            </a>
                        </div>
                    </div>
                    <div class="cube flip-to-top">
                        <div class="default-state">
                            <a href="Contacts.php">
                                <div class="btn btn-hero btn-lg btn-clear btn-sm btn-min-block">CONTACTS</div>
                            </a>
                        </div>
                        <div class="active-state">
                            <a href="Contacts.php">
                                <div class="btn btn-hero btn-lg btn-clear btn-sm btn-min-block">CONTACTS</div>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- END ABOUT US MAIN SECTION -->


<!-- FOOTER -->
<div class="container-fluid" id="footer-container">
    <!-- Footer -->
    <footer>
            <div class="row">
                <div class="col-md-6 col-xs-12">
                    <p id="footer-text-bottom">All work products for the TAO, TAO-WellShell ,TAO-Wellness and Variobics brands and products are fully protected by international trademark, copyright and patent laws.
                        All rights reserved 2008-2016 TAO-Wellness.  TAO-Wellness & EZD Productions are legal names for EZ As A Drink Productions, Inc, a Nevada Corporation.</p>
                </div>
                <div class="col-md-6 col-xs-12">
                    <p id="footer-text-left">Copyright &copy; 2006 - 2024 Sion JSCo All rights reserved.</p>

                </div>

            </div>
        </footer>
</div>
<!-- END FOOTER -->

<!-- jQuery -->
<!--<script src="js/jquery.mobile.custom.min.js"></script>-->
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="js/jquery.js" async></script>
<script src="js/myJS.js" async></script>

<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js" async></script>

</body>
</html>
