-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Profile page done. Attempt to make a profile module
- Loading branch information
1 parent
1f3fc57
commit a865888
Showing
5 changed files
with
95 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = function(req, res) { | ||
changeName = function(id, firstname, lastname) { | ||
connection.query("UPDATE users SET firstname = ?, lastname = ? WHERE id = ?", [firstname, lastname, id], function(err, rows) { | ||
if (err) throw err; | ||
}); | ||
} | ||
|
||
changeEmail = function(id, email) { | ||
connection.query("UPDATE users SET email = ? WHERE id = ?", [email, id], function(err, rows) { | ||
if (err) throw err; | ||
}); | ||
} | ||
}; | ||
var mysql = require('mysql'); | ||
var dbconfig = require('../config/database'); | ||
var bcrypt = require('bcrypt-nodejs'); | ||
var connection = mysql.createConnection(dbconfig.connection); | ||
connection.query('USE ' + dbconfig.database); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
<nav class="navbar navbar-expand-md navbar-dark bg-dark"> | ||
<nav class="navbar navbar-expand-md navbar-custom"> | ||
<div class="navbar-collapse collapse w-100 order-1 order-md-0 dual-collapse2"> | ||
<ul class="navbar-nav mr-auto"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="word-list">Word List</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="#">Dictionary</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="#">Review</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="#">Statistics</a> | ||
</li> | ||
</ul> | ||
<ul class="navbar-nav mr-auto"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="word-list">Word List</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="#">Dictionary</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="#">Review</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="#">Statistics</a> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="mx-auto order-0"> | ||
<a class="navbar-brand" href="/home">Vocabulary Builder</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".dual-collapse2"> | ||
<a class="navbar-brand" href="/home">Vocabulary Builder</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".dual-collapse2"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
</div> | ||
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2"> | ||
<ul class="navbar-nav ml-auto"> | ||
<ul class="navbar-nav ml-auto"> | ||
<% if (title === 'Profile') { %> | ||
<li class="nav-item active"> | ||
<a class="nav-link" href="/profile">Profile</a> | ||
</li> | ||
<% } else { %> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="/profile"><%= user.firstname %></a> | ||
<a class="nav-link" href="/profile">Profile</a> | ||
</li> | ||
<li class="nav-item"> | ||
<% } %> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="/logout">Logout</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
</nav> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters