PracowniaProgramowania/trening-planer/wyniki.html

166 lines
5.4 KiB
HTML
Raw Normal View History

2019-01-20 11:32:43 +01:00
{{ define "Index" }}
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
2018-12-31 00:56:25 +01:00
2019-02-09 22:12:27 +01:00
<title>Wyniki</title><link rel="Shortcut icon" href="img/logo2.jpg" />
2019-01-20 11:32:43 +01:00
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link rel="Stylesheet" type="text/css" href="/static/css_moje/style_moje.css" />
<link href="http://fonts.googleapis.com/css?family=Roboto:400,700,400italic,500italic&subset=latin,latin-ext" rel="stylesheet">
<style>
body {
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
}</style>
2019-02-09 22:12:27 +01:00
<script type="text/javascript">
function komunikat(){
alert("Dodano już to ćwiczenieee");
}
</script>
2019-01-20 11:32:43 +01:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js">
function placeOrder2(form) {
if( validateZIPCode(form["Serie"], form["Serie_help"]) && validateZIPCode(form["Powtorzenia"], form["Powtorzenia_help"]) &&validateZIPCode(form["Ciezar"], form["Ciezar_help"]) ) {
form.submit()}
else {
alert("Przykro mi, ale podane informacje nie s¹ prawid³owe.");
}
}
function sprawdzanieFormularza(inputField){
var regex=/\d/;
if(regex.test(inputField.value)){
alert("Podaj cyfry");
}
}
function validateZIPCode(inputField, helpText) {
// Najpierw sprawdzamy, czy d³ugoœæ pola jest ró¿na od 5
// Teraz sprawdzamy, czy w polu wpisano liczbê
if (isNaN(inputField.value)) {
// Dane nie s¹ prawid³owe, wyœwietlamy zatem komunikat o b³êdzie
if (helpText != null)
helpText.innerHTML = "Proszê wpisaæ same cyfry.";
return false;
}
else {
// Dane s¹ w porz¹dku, usuwamy komunikat o b³êdzi
if (helpText != null)
helpText.innerHTML = "";
return true;
}
}</script>
</head>
<body>
<div class="row">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse"
data-target="#mainmenu"
aria-expanded="false">
<span class="sr-only">Przełącznik nawigacji</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse navbar-left mainmenu" style="margin-top: 15px;">Witaj</div>
<div class="collapse navbar-collapse navbar-right mainmenu" id="mainmenu">
2018-12-31 00:56:25 +01:00
<ul class="nav navbar-nav">
2019-01-20 11:32:43 +01:00
2019-01-16 23:47:40 +01:00
<li><a class="nav-link" href="/planer/">Zaplanuj nowy trening</a></li>
2019-02-09 22:12:27 +01:00
<li><a class="nav-link" href="/trening/">Twoj trening</a></li>
2019-01-28 21:15:21 +01:00
<li><a class="btn btn-default lista-menu" href="/wyniki/">Wyniki</a></li>
2019-01-16 23:47:40 +01:00
<li><a class="nav-link" href="/dodajcwiczenie/">Dodaj ćwiczenie</a></li>
2019-01-20 11:32:43 +01:00
<li><a class="nav-link" href="/wymiary/">Wymiary</a></li>
2019-01-16 23:47:40 +01:00
<li> <form action="/logowanie" method="GET"> <button class="btn btn-default" style="height: 50px" value="brak" name="cookies" >Wyloguj</button></form></li>
2018-12-31 00:56:25 +01:00
</ul>
</div>
2019-01-20 11:32:43 +01:00
</div>
</nav>
</div>
<div class="container" style="margin-top:100px;">
<div class="row">
2019-02-09 22:12:27 +01:00
<div class="rejestracja col-lg-8 text-center">
2019-01-20 11:32:43 +01:00
{{range.}}
<span style="font-size: 18px">{{.Nazwa}}<br><br>
</span>
<canvas id="{{.NumerCwiczenia}}" width="400" height="150"></canvas>
<script>
var ctx = document.getElementById("{{.NumerCwiczenia}}");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: [
{{range .Wyniki}}
2019-01-16 23:47:40 +01:00
{{.Data_t}},
2019-01-20 11:32:43 +01:00
{{end}}
],
datasets: [{
2019-01-20 14:22:29 +01:00
label: 'Twój wynik',
2018-12-31 00:56:25 +01:00
2019-01-20 11:32:43 +01:00
data: [
{{range .Wyniki}}
2018-12-31 00:56:25 +01:00
{{.Ciezar_rzecz}},
2019-01-20 11:32:43 +01:00
{{end}}
],
backgroundColor: [
2019-02-09 22:12:27 +01:00
'#B8C07978',
2019-01-20 11:32:43 +01:00
],
borderColor: [
2019-02-09 22:12:27 +01:00
'#B8C07978',
2019-01-20 11:32:43 +01:00
],
borderWidth: 1
},
{
label: 'Twój cel',
data: [ {{range .Wyniki}}
2018-12-31 00:56:25 +01:00
{{.Ciezar_cel}},
2019-01-20 11:32:43 +01:00
{{end}}
],
backgroundColor: [
2019-02-09 22:12:27 +01:00
'#94B8B85C',
2019-01-20 11:32:43 +01:00
],
borderColor: [
2019-02-09 22:12:27 +01:00
'#94B8B85C',
2019-01-20 11:32:43 +01:00
],
borderWidth: 1
}]},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
2018-12-31 00:56:25 +01:00
}
2019-01-20 11:32:43 +01:00
});
</script>
{{end}}
2018-12-31 00:56:25 +01:00
2019-02-09 22:12:27 +01:00
</div>
2019-01-20 11:32:43 +01:00
{{end}}
2018-12-31 00:56:25 +01:00