Converted CRLF to LF line endings

This commit is contained in:
2023-01-29 17:05:10 +01:00
parent 116dc1dcb0
commit 57b80a398d
2 changed files with 132 additions and 132 deletions

View File

@@ -1,21 +1,21 @@
const mysql = require('mysql'); const mysql = require('mysql');
var connection = mysql.createConnection({ var connection = mysql.createConnection({
host : 'localhost', host : 'localhost',
database : 'testing', database : 'testing',
user : 'root', user : 'root',
password : '' password : ''
}); });
connection.connect(function(error){ connection.connect(function(error){
if(error) if(error)
{ {
throw error; throw error;
} }
else else
{ {
console.log('MySQL Database is connected Successfully'); console.log('MySQL Database is connected Successfully');
} }
}); });
module.exports = connection; module.exports = connection;

View File

@@ -1,113 +1,113 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<!-- Required meta tags --> <!-- Required meta tags -->
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS --> <!-- CSS -->
<link rel='stylesheet' href='/css/materialdesignicons.min.css' /> <link rel='stylesheet' href='/css/materialdesignicons.min.css' />
<link rel='stylesheet' href='/css/style.css' /> <link rel='stylesheet' href='/css/style.css' />
<!-- JS Scripts --> <!-- JS Scripts -->
<script src="/js/table-sort.js"></script> <script src="/js/table-sort.js"></script>
<title><%= title %></title> <title><%= title %></title>
</head> </head>
<body> <body>
<% if(action == 'view') { %> <% if(action == 'view') { %>
<!-- Ride Page --> <!-- Ride Page -->
<link rel='stylesheet' href='/css/modal.css' /> <link rel='stylesheet' href='/css/modal.css' />
<link rel='stylesheet' href='/css/button.css' /> <link rel='stylesheet' href='/css/button.css' />
<div id="modal" class="overlay"> <div id="modal" class="overlay">
<a class="cancel" href="#" onclick="history.go(-1)"></a> <a class="cancel" href="#" onclick="history.go(-1)"></a>
<div class="modal"> <div class="modal">
<h2>Ride info</h2> <h2>Ride info</h2>
<div class="content"> <div class="content">
<% if( data !== undefined ) {%> <% if( data !== undefined ) {%>
<p>Date: <%= data.date %></p> <p>Date: <%= data.date %></p>
<p>From: <%= data.start_point %></p> <p>From: <%= data.start_point %></p>
<p>To: <%= data.end_point %></p> <p>To: <%= data.end_point %></p>
<p>RoutID <%= data.route_id %></p> <p>RoutID <%= data.route_id %></p>
<p>Time Taken: <%= data.time_taken %> Min</p> <p>Time Taken: <%= data.time_taken %> Min</p>
<p>Average speed: <%= data.average_speed %> Km/h</p> <p>Average speed: <%= data.average_speed %> Km/h</p>
<p>Departed : <%= new Date (data.departure).toLocaleTimeString("en-US" , { hour: 'numeric', minute: 'numeric'}); %> <br> <%= new Date (data.departure).toLocaleDateString("en-GB", { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'}) %> </p> <p>Departed : <%= new Date (data.departure).toLocaleTimeString("en-US" , { hour: 'numeric', minute: 'numeric'}); %> <br> <%= new Date (data.departure).toLocaleDateString("en-GB", { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'}) %> </p>
<p>Arived : <%= new Date (data.arival).toLocaleTimeString("en-US" , { hour: 'numeric', minute: 'numeric'}); %> <br> <%= new Date (data.arival).toLocaleDateString("en-GB", { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'}) %></p> <p>Arived : <%= new Date (data.arival).toLocaleTimeString("en-US" , { hour: 'numeric', minute: 'numeric'}); %> <br> <%= new Date (data.arival).toLocaleDateString("en-GB", { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'}) %></p>
<button class="btn btn-delete" onclick="location.href='/delete/<%= data.id %>'"> <button class="btn btn-delete" onclick="location.href='/delete/<%= data.id %>'">
<span class="mdi mdi-delete mdi-24px"></span> <span class="mdi mdi-delete mdi-24px"></span>
<span class="mdi mdi-delete-empty mdi-24px"></span> <span class="mdi mdi-delete-empty mdi-24px"></span>
</button> </button>
<% } else { %> <% } else { %>
<p style="color: red;"> Error: This ride does not exist</p> <p style="color: red;"> Error: This ride does not exist</p>
<% } %> <% } %>
</div> </div>
</div> </div>
</div> </div>
<% } else { %> <% } else { %>
<!-- Overview Page --> <!-- Overview Page -->
<link rel='stylesheet' href='/css/table.css' /> <link rel='stylesheet' href='/css/table.css' />
<div class="container"> <div class="container">
<h1 class="text-center mt-3 mb-3"> <h1 class="text-center mt-3 mb-3">
<span class="mdi mdi-bicycle HeadIcon"></span><br> <span class="mdi mdi-bicycle HeadIcon"></span><br>
<%= title %> <%= title %>
</h1> </h1>
<% if(message.length > 0) { %> <% if(message.length > 0) { %>
<div class="alert alert-danger"><%= message %></div> <div class="alert alert-danger"><%= message %></div>
<% } %> <% } %>
<div style="overflow-x:auto;"> <div style="overflow-x:auto;">
<table class="table table-sort table-arrows"> <table class="table table-sort table-arrows">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>From</th> <th>From</th>
<th>To</th> <th>To</th>
<th>Time taken</th> <th>Time taken</th>
<th>Avg. Speed</th> <th>Avg. Speed</th>
<!-- Uncomment next line to add an action row (Delete and Info button) to the table <!-- Uncomment next line to add an action row (Delete and Info button) to the table
<th class="TableActions">Action</th> <th class="TableActions">Action</th>
--> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- Check if there Rides loaded from DB --> <!-- Check if there Rides loaded from DB -->
<% <%
if(TheData.length > 0) if(TheData.length > 0)
<!-- If there are Rides output as table --> <!-- If there are Rides output as table -->
{ TheData.forEach(function(data){ { TheData.forEach(function(data){
%> %>
<tr onclick="location.href='/view/<%= data.id %>'"> <tr onclick="location.href='/view/<%= data.id %>'">
<td><%= new Date (data.departure).toLocaleDateString("en-GB", { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric'}) %></td> <td><%= new Date (data.departure).toLocaleDateString("en-GB", { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric'}) %></td>
<td><%= data.start_point %></td> <td><%= data.start_point %></td>
<td><%= data.end_point %></td> <td><%= data.end_point %></td>
<td><%= data.time_taken %> Min</td> <td><%= data.time_taken %> Min</td>
<td><%= data.average_speed %> Km/h</td> <td><%= data.average_speed %> Km/h</td>
<!-- Uncomment next lines to add an action row (Delete and Info button) to the table <!-- Uncomment next lines to add an action row (Delete and Info button) to the table
<td class="TableActions"> <td class="TableActions">
<button class="btn btn-delete" onclick="location.href='/delete/<%= data.id %>'"> <button class="btn btn-delete" onclick="location.href='/delete/<%= data.id %>'">
<span class="mdi mdi-delete mdi-24px"></span> <span class="mdi mdi-delete mdi-24px"></span>
<span class="mdi mdi-delete-empty mdi-24px"></span> <span class="mdi mdi-delete-empty mdi-24px"></span>
</button> </button>
<button class="btn btn-info" onclick="location.href='/view/<%= data.id %>'"> <button class="btn btn-info" onclick="location.href='/view/<%= data.id %>'">
<span class="mdi mdi-information-outline mdi-24px"></span> <span class="mdi mdi-information-outline mdi-24px"></span>
<span class="mdi mdi-information mdi-24px"></span> <span class="mdi mdi-information mdi-24px"></span>
</button> </button>
</td> </td>
--> -->
</tr> </tr>
<% }); } else { %> <% }); } else { %>
<tr> <tr>
<td colspan="5">No Data Found</td> <td colspan="5">No Data Found</td>
</tr> </tr>
<% } %> <% } %>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<% } %> <% } %>
<footer> <footer>
<div class="left"> <div class="left">
<p>BikeRideViewer | By brammp</p> <p>BikeRideViewer | By brammp</p>
</div> </div>
<div class="right"> <div class="right">
<p><a href="https://git.bprieshof.nl/brammp/BikeRideViewer"><span class="mdi mdi-git mdi-18px"></span>SourceCode</a></p> <p><a href="https://git.bprieshof.nl/brammp/BikeRideViewer"><span class="mdi mdi-git mdi-18px"></span>SourceCode</a></p>
</div> </div>
</footer> </footer>
</body> </body>
</html> </html>