diff --git a/server.js b/server.js index 8f2a3fa..7437369 100644 --- a/server.js +++ b/server.js @@ -53,14 +53,19 @@ app.use(express.static(__dirname + '/public')); app.get('/', function (req, res) { var player_number = 0; + var stats_number = 0; database.get("SELECT COUNT(*) FROM players", function (err, row) { player_number = row; }); + database.get("SELECT COUNT(*) FROM stats", function (err, row) { + stats_number = row; + }); res.render('index', { title: 'My Game', - player_num: player_number + player_num: player_number, + stats_num: stats_number }); }); diff --git a/views/index.jade b/views/index.jade index d9e6626..42ede3c 100644 --- a/views/index.jade +++ b/views/index.jade @@ -4,12 +4,7 @@ block content p | Registered players: #{player_num} p - | Donec congue lacinia dui, a porttitor - | lectus condimentum laoreet. Nunc eu - | ullamcorper orci. Quisque eget odio ac - | lectus vestibulum faucibus eget in metus. - | In pellentesque faucibus vestibulum. Nulla - | at nulla justo, eget luctus tortor. + | Stats registered: #{stats_num} block sidebar .widget h1 Access @@ -17,6 +12,12 @@ block sidebar ul li a(href='/') Main + ul + li + a(href='/register') Register New Player + ul + li + a(href='/remove') Remove Player ul li a(href='/config') Configuration