<?php
$page ='Contact';
?>
<?php
if(isset($_REQUEST['submit']))
{
$name = '';	 
$mobile = '';	 
$email = '';
$message = '';
    
function getIp()
{if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
	$ip_address=$_SERVER['HTTP_X_FORWARDED_FOR'];
}

if (!isset($ip_address)){
		if (isset($_SERVER['REMOTE_ADDR']))	
		$ip_address=$_SERVER['REMOTE_ADDR'];
}
return $ip_address;
}


//taking the data from form	


$name = addslashes(trim($_POST['name']));	
$mobile = addslashes(trim($_POST['mobile']));	
$email = addslashes(trim($_POST['email']));
$message = addslashes(trim($_POST['message']));
$subject = 'Online Inquiry';


//preparing mail

	//taking info about date, IP and user agent
	$timestamp = date("Y-m-d H:i:s");
	$ip   = getIp();
	$host = gethostbyaddr($ip); 
	$user_agent = $_SERVER["HTTP_USER_AGENT"];

	$headers = "MIME-Version: 1.0\n";
	$headers .= "Content-type: text/html; charset=utf-8\n";
	$headers .= "Content-Transfer-Encoding: quoted-printable\n";
	$headers .= "From: $email\n";

	$content = 'Subject: '.$subject.'<br>'.
	'Name: '.$name.'<br>'.
	'Mobile: '.$mobile.'<br>'.
	'E-mail: '.$email.'<br>'.
	'Message: '.$message.'<br>'.
	'Time: '.$timestamp.'<br>'.
	'IP: '.$host.'<br>'.
	'User agent: '.$user_agent;	
	
	$ok = mail("info@massliftsolutions.com, massliftsolution@gmail.com","Online Inquiry", $content, $headers);
	if($ok)
	{
		echo "<script type='text/javascript'>alert('Your inquiry has been submitted successfully....');</script>";
	}
	
	else {
	header("location:contact.php");
	}
}
?>
<!DOCTYPE html> 
<html>
<head>
	<meta charset="UTF-8">	
    <title>Mass Lift Solution : Contact Us</title>
<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
	
	<link href="<?php echo base_url(); ?>assets/frontend/style.css" rel="stylesheet" type="text/css" media="screen">
	<link href="<?php echo base_url(); ?>assets/frontend/style-headers.css" rel="stylesheet" type="text/css" media="screen">
	<link href="<?php echo base_url(); ?>assets/frontend/style-colors.css" rel="stylesheet" type="text/css" media="screen">
	<!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
		<link href="style-ie.css" rel="stylesheet" type="text/css" media="screen">
	<![endif]-->
</head>
<body class="home color-red">
<div class="root">
	<?php
	include "include/header.php";
	?>

	<section class="breadcrumb p07">
		<p><a href="index.php">Home</a> Contact Us</p>
	</section>

	<section class="content contact">
		<article class="main">
			
			<h2><span>Contact Us</span></h2>
			<p class="para">All enquiries will be addressed within 24 hours, when contacting via email. Please mention your contact details and preferred time of contacting.</p>
			<form action="" method="post" class="contact-form">
				<p>
					<label for="name">Name</label><input name="name">
				</p>
				<p class="half">
					<label for="email">Mobile </label><input name="mobile">
				</p>
                <p class="half">
					<label for="email">E-mail</label><input name="email">
				</p>
                <p>
					<label for="email">Subject</label>
                    <select name="subject">
                    <option>For AMC</option>
                    <option>For New Installation</option>
                    <option>For Modification and Renewation</option>
                    </select>
				</p>
			
				<p>
					<label for="message">Message</label><textarea name="message" rows="5" cols="20"></textarea>
				</p>
				<p>
				<input type="submit" name="submit" class="b" value="Send message" style="width:124px;">
				</p>
			</form>
		</article>
		<aside>
			<section>
				<div class='gmap' id="map">B-110 MIDC Sinnar, Nashik, India</div>
			</section><section>
				<h3><span><b>Contact details</b></span></h3>
				<p><b><?php echo $a_row->c_address; ?></b></p>
                <b>E-mail: <a href="#"><?php echo $a_row->c_email; ?></a></b>
				<p><b>Phone: <?php echo $a_row->c_phone;?></b>
                <br><b>Mr.Amit Ahire(Mobile) : 9823586080</b>
                <br><b>Mr.Sandip Patil(Mobile) : 9145105922</b>
                <br><br><b>Dhule Branch</b>
                <br><b>Mr.Amol Patil(Mobile) : 8007772299</b>
                </p>
			</section>
		</aside>
	</section>
	<?php 
	include "include/footer.php";
	?>
	</div>
	<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/frontend/js/jquery.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>assets/frontend/js/scripts.js"></script>
	<!--[if lt IE 9]>
		<script type="text/javascript" src="js/ie.js"></script>
	<![endif]-->
</body>

</html>