예제 #1
0
    header('location: ../home/login.php');
}
$db = new User_model();
$username = $_SESSION['username'];
$userInfo = $db->getUser($username);
$userReviews = $db->getUserReviews($_SESSION['user_id']);
$userReservations = $db->getUserReservations($_SESSION['user_id']);
if ($_POST) {
    $newPhoneNum = htmlspecialchars($_POST['phone_number']);
    $newEmail = htmlspecialchars($_POST['email']);
    $newPassword = htmlspecialchars($_POST['password']);
    $newImage = null;
    if (is_uploaded_file($_FILES['user-profile-image']['tmp_name'])) {
        $newImage = file_get_contents($_FILES["user-profile-image"]["tmp_name"]);
    }
    $db->updateUser($username, $newPhoneNum, $newEmail, $newPassword, $newImage);
    $userInfo = $db->getUser($username);
}
?>
<!DOCTYPE HTML> 
<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>TableMe</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/css/bootstrap-select.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>