<?php

include('config.php');






//PROCESS VISITORS MESSAGES

if(isset($_POST["Vmessage"])){

	
		$message = htmlspecialchars($_POST["Vmessage"]);
		$name = htmlspecialchars($_POST["name"]);
		$phone = htmlspecialchars($_POST["phone"]);
		$email = htmlspecialchars($_POST["email"]);
		$date = date("jS F Y, h:i A");
	
	
		$query=$pdo->prepare("INSERT INTO visitorsmessage (message, name, received, phone, email) 
								VALUES (:message, :name, :received, :phone, :email)");
		$query->bindParam(":message", $message, PDO::PARAM_STR);
		$query->bindParam(":name", $name, PDO::PARAM_STR);
		$query->bindParam(":received", $received, PDO::PARAM_STR);
		$query->bindParam(":phone", $phone, PDO::PARAM_STR);
		$query->bindParam(":email", $email, PDO::PARAM_STR);
		$query->execute();
		
		if($query){
	
		echo 
		
		'
	<center>
	<div style="background: #f2fff7;font-size:18px;color:#1da958;display:flex;padding:10px;justify-content:center;width:320px;border-radius:10px;">
	<img src="img/tick.png" style="width:30px;height:30px;">
	<div>Sent Successfully<br><div style="font-size:14px;color:#597087">We will contact you shortly</div></div>
	</div><br><p>
	</center>
		
		';
		
		
		}
	
	
	
	
	
	
	
}