diff --git a/js/timelaps.js b/js/timelaps.js
index bdcccc2..bc81efd 100644
--- a/js/timelaps.js
+++ b/js/timelaps.js
@@ -43,16 +43,13 @@ function getKartsMenu() {
url: api_url + 'karts/',
dataType: 'json',
success: function (data, status) {
- console.log(data);
$.each(data, function (index, value) {
- console.log(index);
- console.log(value.name);
$('#link_all').after("" +
- " \n" +
+ " \n" +
" \n" +
" \n" +
"\n" +
- " "+value.name+"" +
+ " " + value.name + "" +
" ");
});
},
@@ -64,4 +61,75 @@ function getKartsMenu() {
function getPilotsByKart() {
+ $.ajax({
+ type: 'GET',
+ crossDomain: true,
+ url: api_url + 'karts/',
+ dataType: 'json',
+ success: function (data, status) {
+ $.each(data, function (index, value) {
+ $('.container-fluid').append("" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ " Order | \n" +
+ " Short Name | \n" +
+ " First Name | \n" +
+ " Last Name | \n" +
+ " Ref time (Sec) | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ "
" +
+ "");
+
+ $('#dataTable_pilots'+value.id).DataTable({
+ data: value.drivers,
+ columns: [
+ {
+ data: "id",
+ render: function (data, type, row, meta) {
+ return ' ';
+ }
+ },
+ {
+ data: "order"
+ },
+ {
+ data: "first_name"
+ },
+ {
+ data: "first_name"
+ },
+ {
+ data: "last_name"
+ },
+ {
+ data: "ref_time"
+ }
+ ]
+ });
+
+ });
+ },
+ error: function (xhr) {
+ alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
+ },
+ });
}
diff --git a/pilots.html b/pilots.html
index 2275d1c..b5c8293 100644
--- a/pilots.html
+++ b/pilots.html
@@ -13,10 +13,15 @@
+
+
+
+
@@ -185,226 +190,6 @@
-
-
-
-
-
-
-
-
- |
- Order |
- Short Name |
- First Name |
- Last Name |
- Ref time (Sec) |
-
-
-
-
-
-
-
-
-
-
-
- |
- 1 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
-
-
-
- |
- 2 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
-
-
-
- |
- 3 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
- Order |
- Short Name |
- First Name |
- Last Name |
- Ref time (Sec) |
-
-
-
-
-
-
-
-
-
-
-
- |
- 1 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
-
-
-
- |
- 2 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
-
-
-
- |
- 3 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
- Order |
- Short Name |
- First Name |
- Last Name |
- Ref time (Sec) |
-
-
-
-
-
-
-
-
-
-
-
- |
- 1 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
-
-
-
- |
- 2 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
-
-
-
- |
- 3 |
- BGL |
- Nicolas |
- Riault |
- 59 |
-
-
-
-
-
-
@@ -442,6 +227,8 @@
+
+
@@ -449,10 +236,11 @@
$(document).ready(function () {
getKartsMenu();
- showKarts();
+ getPilotsByKart();
});
+