<?php

include "core/database/connect.php";
include "core/functions/general.php";
include "core/validation.php";
$profile = retrieveProfile(activeUser(), $dbconn);
$user = retrieveUser(activeUser(), $dbconn);
?>

<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">
<title>BookHunters</title>


<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- BookHunters -->
<link rel="stylesheet" href="css/bootstrap.css">

</head>
<body>
<?php 
include 'components/header.php';
?>


<div class="container" style="padding-top: 5px;">
  <h2 class="page-header">Edit Profile</h2>
<?php

include 'database/connect.php';
include 'functions/general.php';
include "/lib/PHPMailer/PHPMailerAutoload.php";
session_start();
if (isset($_POST['user'])) {
    $user = trim($_POST['user']);
    $user = retrieveUserByName($user, $dbconn);
    if ($user != -1) {
        $profile = retrieveProfile($user['UserId'], $dbconn);
        $user_activation_hash = sha1(uniqid(mt_rand(), true));
        //creating ramdom string<!---->
        $mail = new PHPMailer();
        $mail->IsSMTP();
        $mail->CharSet = 'UTF-8';
        $mail->SMPTSecure = 'tls';
        $mail->Host = "smtp.mandrillapp.com";
        // SMTP server
        $mail->Username = "******";
        // SMTP account username
        $mail->Password = "******";
        // SMTP account password
        $mail->SMTPAuth = true;
        // enable SMTP authentication
        $mail->Port = 587;
        // set the SMTP port for the server
        $mail->From = "*****@*****.**";
        //the email the mail comes from
        $mail->FromName = "BookHunters";
        //what name should be shown at the email