<?php

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

if(isset($_SESSION["user_login"])){
	$userid = $_SESSION["user_login"];
}else{
		header("location: ../register-login.php");
	}
	

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

<style>
form label{
	font-weight:500!important;
	color:#444;
	cursor:pointer;
	font-size:16px!important;
}
</style>


<!DOCTYPE html>

<html lang="en">

<head>

        <meta charset="utf-8" />

        <title> Contact Us </title>

        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <meta content="A fully featured cryptocurrency investment platform" name="description" />

        <meta content="Coderthemes" name="author" />

        <meta http-equiv="X-UA-Compatible" content="IE=edge" />

      

            <link rel="stylesheet" type="text/css" href="w3.css">

        <!-- Bootstrap Css -->

        <link href="assets/css/bootstrap.min.css" id="bootstrap-stylesheet" rel="stylesheet" type="text/css" />

        <!-- Icons Css -->

        <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />

        <!-- App Css-->

        <link href="assets/css/app.min.css" id="app-stylesheet" rel="stylesheet" type="text/css" />

		<link href="../css/style7eda3860.css" rel="stylesheet">

    </head>



    <body>


	<div class='coversoverlay'>
	<center><img src="../img/loader.gif" style="width:60px; margin-top:20%;"></center>
	</div>

  <!-- Begin page -->
  <div id="wrapper" style="overflow:auto!important">

   
   
   <!-- Topbar Start -->
	<?php
	include("header.php");
	?>
    <!-- end Topbar -->
   
   

    <!-- ========== Left Sidebar Start ========== -->
    <div class="left-side-menu">

      <div class="slimscroll-menu">

        <!-- User box -->
        <div class="user-box text-center ">

          <div class="dropdown">
            <a href="#" class="user-name dropdown-toggle h5 mt-2 mb-1 d-block" data-toggle="dropdown" aria-expanded="false"></a>
            <div class="dropdown-menu user-pro-dropdown">




            </div>
          </div>


        </div>

        <!--- Sidemenu -->
        <?php include("sidebar.php");?>
		
        <!-- End Sidebar -->
        <div class="clearfix"></div>



                </div>

                <!-- Sidebar -left -->



            </div>

            <!-- Left Sidebar End -->






            <div class="content-page" >

                <div class="content" style="width: 100%;color: white;">



                    <!-- Start Content-->

                    <div class="container-fluid" >

                        <div id="google_translate_element"></div>

                         <div class="row">

                            <div class="col-md-12" style="padding-left:0px; padding-right:0px">
                            
						
						
				<form class="col-md-7" style="margin-top:20px!important;margin: auto;">
				
                <div class="card-box">
				<h2 align="center" style='color:#767e80' id="wlcm">Contact Us</h2><br>
				<div class="dropdown-divider"></div>
		
		<section id="suc" class="display-none">
		<div class="success-display">Your message has been recieved <i class="fas fa-check"></i></div>
		<div style="color:#2e657e;font-size:15px; font-weight:bold; cursor:pointer; text-align:center;margin:20px;">
		<i class="fas fa-envelope"></i> We will get back to you</div>
		<p><center>
		<a href="inbox.php"><div class="btn btn-primary btnss">Chat us with photo upload &nbsp;<i class="fas fa-comments"></i></div></a>
		</center><p>
		<div class="dropdown-divider"></div>
		<div style="text-align:center">
		<a href="account.php" style="color:#2e657e; font-size:16px;"><i class="fas fa-tachometer-alt"></i> Dashboard</a> 
		&nbsp; &nbsp; <a href="../" style="color:#2e657e; font-size:16px;"> <i class="fas fa-home"></i> Back Home</a>
		</div>
		</section>
		
		<div align="center" style="color:#ff3737; margin-left:-20px!important; margin-bottom:30px;font-size:17px;font-weight:500" id="result"></div>
				
				<div id="contactForm">
				
				  <div class="form-group">
                    <label for="username" style="margin-left:10px"><i class="fas fa-user"></i> Username</label>
                    <div class="col-sm-12">
                      <input type="text" name="username" readonly class="form-control" id="username" value="<?php echo htmlspecialchars($row["username"])?>" placeholder="Enter a username">
                    </div>
                  </div>
				  
				  <div class="form-group">
                    <label for="email" style="margin-left:10px"><i class="fas fa-envelope"></i> Email</label>
                    <div class="col-sm-12">
                      <input type="email" name="email" class="form-control" readonly id="email" 
					  value="<?php echo htmlspecialchars($row["email"])?>">
                    </div>
                  </div>
				  
				 
				 
				  <br>
				  <div class="form-group">
                    <label for="messages" style="margin-left:10px; color:#396f89"><i class="fas fa-edit"></i> Enter your message</label>
                    <div class="col-sm-12">
                   
				   <textarea name="message" class="form-control" id="messages"  placeholder="Please be descriptive enough"></textarea>
                   <div style="color:#888; margin:10px 0px;font-size:14px">We will get back to you via your inbox <a href="inbox.php">Here</a> </div>
					
					
					</div>
                  </div>
                 
	
                  <button type="submit" id="contactUs" class="btn btnss btn-block">Send message</button>
                
               </div>
			   
			   
               </div>
              </form>

                   
						   </div>
							</div> <!-- container-fluid -->



                </div> <!-- content -->
                </div> 
              
					</div> 
	
					</div>
               


       

        <!-- Vendor js -->

        <script src="assets/js/vendor.min.js"></script>



        <!-- knob plugin -->

        <script src="assets/libs/jquery-knob/jquery.knob.min.js"></script>



        <!--Morris Chart-->

        <script src="assets/libs/morris-js/morris.min.js"></script>

        <script src="assets/libs/raphael/raphael.min.js"></script>



        <!-- Dashboard init js-->

        <script src="assets/js/pages/dashboard.init.js"></script>



        <!-- App js -->

        <script src="assets/js/app.min.js"></script>

   
   
   
   
   
   
   
   
   
   <script>
   
   $(document).ready(function(){
	
	$('.coversoverlay').hide();
		 
 
 
 
 //send message
 
 $("#contactUs").click(function(e){
	 e.preventDefault();
	 
		let contactUs = "contactUs";
			
		let message = $("#messages").val();
		

		$.ajax({
			url:'function.php',
			method:'POST',
			data:{message:message, contactUs:contactUs},
			beforeSend:function(){$(".coversoverlay").show()},
			success:function(data){
				$("#result").html(data);
				
				//console.log(data);
				$(".coversoverlay").hide();
				
			}
		});
		
		});
	
 
 
 
	 
   });
   
   
   
   
   </script>
   
   
   
   
   <!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/649b88c194cf5d49dc6039bd/1h3vosdlg';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
<!--End of Tawk.to Script-->
   
   
   
   
   
   
 
   
   
   
   
    </body>

</html>