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">
|
|
|
|
|
|
|
|
<title>Wymiary</title><link rel="Shortcut icon" href="img/logo2.jpg" />
|
|
|
|
<link type="text/css" href="/static/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">
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js">
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
function placeOrder1(form) {
|
|
|
|
if( validateZIPCode(form["talia"], form["talia_help"]) && validateZIPCode(form["biodra"], form["biodra_help"]) &&validateZIPCode(form["waga"], form["waga_help"])) {
|
|
|
|
form.submit()}
|
|
|
|
else {
|
|
|
|
alert("Przykro mi, ale podane informacje nie s¹ prawid³owe.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function placeOrder2(form) {
|
|
|
|
if( 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="container">
|
|
|
|
<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-right mainmenu" id="mainmenu">
|
|
|
|
<ul class="nav navbar-nav">
|
|
|
|
|
|
|
|
|
|
|
|
<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-20 11:32:43 +01:00
|
|
|
<li><a class="btn btn-default" href="/wyniki/">Wyniki</a></li>
|
|
|
|
<li><a class="nav-link" href="/dodajcwiczenie/">Dodaj ćwiczenie</a></li>
|
|
|
|
|
2019-01-28 21:15:21 +01:00
|
|
|
<li><a class="nav-link lista-menu" href="/wymiary/">Wymiary</a></li>
|
2019-01-20 11:32:43 +01:00
|
|
|
<li> <form action="/logowanie" method="GET"> <button class="btn btn-default" style="height: 50px" value="brak" name="cookies" >Wyloguj</button></form></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
</div><br>
|
|
|
|
<br><br>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
2019-02-09 22:12:27 +01:00
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="col-lg-8 text-center" > {{range.}}
|
|
|
|
<span style="font-size: 18px;">{{.Nazwa}}</span>
|
|
|
|
|
|
|
|
<canvas id="{{.Nazwa}}" width="400" height="150"></canvas>
|
2019-01-20 11:32:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2019-02-09 22:12:27 +01:00
|
|
|
var ctx = document.getElementById("{{.Nazwa}}");
|
2019-01-20 11:32:43 +01:00
|
|
|
var myChart = new Chart(ctx, {
|
|
|
|
type: 'line',
|
|
|
|
data: {
|
|
|
|
labels: [
|
2019-02-09 22:12:27 +01:00
|
|
|
{{range.Wymiary_2}}{{.Data}},{{end}}
|
2019-01-20 11:32:43 +01:00
|
|
|
],
|
|
|
|
datasets: [{
|
|
|
|
label: 'Twoje wyniki',
|
|
|
|
|
|
|
|
data: [
|
2019-02-09 22:12:27 +01:00
|
|
|
{{range.Wymiary_2}}{{.Wymiar}},{{end}}
|
2019-01-20 11:32:43 +01:00
|
|
|
],
|
|
|
|
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
|
|
|
|
},
|
|
|
|
]},
|
|
|
|
options: {
|
|
|
|
scales: {
|
|
|
|
yAxes: [{
|
|
|
|
ticks: {
|
|
|
|
beginAtZero:true
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2019-02-09 22:12:27 +01:00
|
|
|
</script>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
|
|
|
<link rel="stylesheet" href="/resources/demos/style.css">
|
|
|
|
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
|
|
|
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
|
|
|
<script>
|
|
|
|
$( function() {
|
|
|
|
var date = $('#datepicker').datepicker({ dateFormat: 'yy-mm-dd' }).val(); } );
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-lg-offset-1 col-lg-3" style="background-color: #B8C07978; vertical-align: top; padding: 40px; ">
|
|
|
|
<div class="col-lg-12 text-center" style="font-size: 16px;">Dodaj wymiar</div>
|
|
|
|
|
|
|
|
<form action="/wymiary/" method="POST">
|
|
|
|
|
|
|
|
<select name="Nazwa" style="width: 180px; margin-top: 20px">
|
|
|
|
<option>Waga</option>
|
|
|
|
<option>Wymiar-biodra</option>
|
|
|
|
|
|
|
|
<option>Wymiar-talia</option>
|
|
|
|
|
|
|
|
<option>Wymiar-biceps</option>
|
|
|
|
|
|
|
|
<option>Wymiar-udo</option>
|
|
|
|
</select>
|
|
|
|
<input type="text" class="form-control" id="wymiar" name="wymiar" placeholder="wymiar" style="width: 180px; margin-top: 10px; margin-bottom: 10px">
|
|
|
|
|
|
|
|
<button type="submit" name="Akcja" value="Dodaj" class="btn btn-default" style="margin-bottom: 20px">Dodaj</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
<div class="col-lg-12 text-center" style="font-size: 16px;">Edytuj wymiar</div>
|
|
|
|
<form action="/wymiary/" method="POST">
|
|
|
|
|
|
|
|
<select name="Nazwa" style="width: 180px; margin-top: 20px">
|
|
|
|
<option>Waga</option>
|
|
|
|
<option>Wymiar-biodra</option>
|
|
|
|
|
|
|
|
<option>Wymiar-talia</option>
|
|
|
|
|
|
|
|
<option>Wymiar-biceps</option>
|
|
|
|
|
|
|
|
<option>Wymiar-udo</option>
|
|
|
|
</select>
|
|
|
|
<input type="text" class="form-control" id="wymiar" name="wymiar" placeholder="wymiar" style="width: 180px; margin-top: 10px; margin-bottom: 10px">
|
|
|
|
<input type="text" class="form-control" id="datepicker" name="DataEdycja" placeholder="Data" style="width: 180px; margin-top: 10px; margin-bottom: 10px">
|
|
|
|
<button type="submit" name="Akcja" value="Edytuj" class="btn btn-default" style="margin-bottom: 20px">Edytuj</button>
|
|
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
<div class="col-lg-12 text-center" style="font-size: 16px;">Usuń wymiary z danej kategori</div>
|
|
|
|
<form action="/wymiary/" method="POST">
|
|
|
|
|
|
|
|
<select name="Nazwa" style="width: 180px; margin-top: 20px">
|
|
|
|
<option>Waga</option>
|
|
|
|
<option>Wymiar-biodra</option>
|
|
|
|
|
|
|
|
<option>Wymiar-talia</option>
|
|
|
|
|
|
|
|
<option>Wymiar-biceps</option>
|
|
|
|
|
|
|
|
<option>Wymiar-udo</option>
|
|
|
|
</select>
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
<button type="submit" name="Akcja" value="Usun" class="btn btn-default" style="margin-top: 20px">Usuń</button>
|
|
|
|
|
|
|
|
|
|
|
|
</form>
|
2019-01-20 11:32:43 +01:00
|
|
|
</div>
|
2019-02-09 22:12:27 +01:00
|
|
|
</div>
|
2019-01-20 11:32:43 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-02-09 22:12:27 +01:00
|
|
|
|
2019-01-20 11:32:43 +01:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
{{end}}
|