<?php

include("config.php");
session_start();

if(isset($_SESSION["user_login"])){
	$userid = $_SESSION["user_login"];
	
	
	
	
		//get user info
		$stmt=$pdo->prepare("SELECT * FROM users WHERE userid = :userid");
		$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$row=$stmt->fetch();
		$userimage = (!empty($row["profilepix"]) ? "img/users/".$row["profilepix"]: "img/avatar.png");
		
}


?>









<!DOCTYPE html>
<html lang="en">

<head>
    <!-- basic -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- mobile metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <!-- site metas -->
    <title>Contact Us |</title>
    <meta name="keywords" content="online,">
    <meta name="description" content="provides a full service focused on the market. A certified legal investment company incorporated and headquartered in Australia.">
    <meta name="author" content="Trade">
    <!-- bootstrap css -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- style css -->
    <link rel="stylesheet" href="css/styles.css">
    <!-- responsive-->
    <link rel="stylesheet" href="css/responsive.css">
    <!-- awesome fontfamily -->
    <link rel="stylesheet" href="css/font-awesome.min.css">
 
 </head>
<!-- body -->

<body class="main-layout inner_page" style="background:#061d38;">
    <!-- loader  
    <div class="loader_bg">
        <div class="loader"><img src="img/loading.gif" alt="" /></div>
    </div>-->
    <!-- end loader -->
	
	
    <div id="mySidepanel" class="sidepanel">
        <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
        <a href="index.php">Home</a>
        <a href="about.php">About</a>
        <a href="services.php">Plan & Services</a>
        <a class="active" href="contact.php">Contact</a>
		<a href="dashboard/tandc.php">Terms & Conditions</a>
		<?php 
		if(isset($userid)){
			echo '<a href="dashboard/logout.php">Logout</a>';
		}else{
			echo '<a href="register-login.php">Login | Sign Up</a>';
		}
		?>
    </div>
	
	
    <!-- header -->
  
		<?php include("header.php"); ?>
	
    <!-- end header -->
	
	
	<p><br><p><br>
    <div class="contact">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="titlepage text_align_center" style="margin:100px 0px 50px 0px;;">
                        <h2 style="color:#fff;">Contact Us</h2>
                    </div>
                </div>
				
				
				
                 <div class=" col-md-10 offset-md-1" id="callback">
				
				
                    <div id="request" class="main_form">
                        <div class="row">
                            <div class="col-md-6 ">
                                <input class="contactus" id="name" placeholder="Full Name" type="text" name="Full Name">
                            </div>
                            <div class="col-md-6">
                                <input class="contactus" id="email" placeholder="Email" type="email" name="Email">
                            </div>
                            <div class="col-md-6">
                                <input class="contactus" id="phone" placeholder="Phone number" type="text" name="Phone number">
                            </div>
                            <div class="col-md-6">
                                <textarea class="textarea" id="message" placeholder="Message" type="type" Message="Name"></textarea>
                            </div>
                            <div class="col-md-12">
                                <button class="send_btn" id="send">Send</button>
                            </div>
                        </div><br><p><br><p>
                    </div>
					
					
                </div>
				
				
				
				
            </div>
        </div>
    </div>
	
	
    <!-- footer -->
   
   <?php include("footer.php"); ?>
   
      <!-- end footer -->
	  
	  
	  
      <!-- Javascript files-->
      <script src="js/jquery.min.js "></script>
      <script src="js/bootstrap.bundle.min.js "></script>
      <script src="js/jquery-3.0.0.min.js "></script>
      <script src="js/custom.js "></script>
	  
	  
	  
	  
	  
	  <script>
	  

$(document).ready(function(){

//Visitors message
 
 $("#send").click(function(){
	
	 
		let Vmessage = $("#message").val();
		let email = $("#email").val();
		let phone = $("#phone").val().trim();
		let name = $("#name").val();
		
		
		if(name == "" || name == " "){
			$("#name").focus();
			return false;
		}
		else 
			if(phone == ""){
			$("#phone").focus();
			return false;
		}
		else
		
		if(Vmessage == ""){
			$("#message").focus();
			$("#message").selectionEnd= end +7;
			return false;
			
		}else{
		
		$.ajax({
			url:'proccessVisitorMsg.php',
			method:'POST',
			data:{Vmessage:Vmessage, email:email, phone:phone, name:name},
			success:function(data){
				
				$("#callback").slideUp(function(){
				
				$(".main_form").fadeOut("fast");
				
				$("#callback").slideDown(function(){
					$("#callback").html(data);
				});
				
				});
				
				
				
				
		 
				
			}
		});
		
		}
		
		});
		
 
		
		
		});
	




	  </script>
	  
	  
	  
	  
	  
	  
	  
	  
	  
	  
   </body>
</html>