Dev commit
This commit is contained in:
commit
19416820e4
@ -2,7 +2,6 @@ from flask import Blueprint
|
||||
routes = Blueprint('routes', __name__)
|
||||
|
||||
from .dashboard import *
|
||||
from ._search import *
|
||||
from ._matches import *
|
||||
from ._hkfcD_motm import *
|
||||
from ._convenor import *
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
#import MySQLdb
|
||||
import pymysql
|
||||
import os
|
||||
from flask import render_template, request
|
||||
@ -8,7 +7,7 @@ from dbWrite import sql_read, sql_write, sql_read_static, sql_write_static
|
||||
from forms import addPlayerForm, addTeamForm, addClubForm, playerDbCreateForm, squadListForm
|
||||
from tables import clubList, convenorSquadListTable, convenorFixtureList
|
||||
from . import routes
|
||||
|
||||
from logging import error, info
|
||||
import json
|
||||
|
||||
BASIC_AUTH_USERNAME = 'admin'
|
||||
@ -134,9 +133,7 @@ def convenorAddPlayerResult():
|
||||
_playerNumber = request.form['playerNumber']
|
||||
_playerTelNumber = request.form['playerTelNumber']
|
||||
if _team and _playerSurname and _playerHkid and _playerNumber and request.method == 'POST':
|
||||
sql = "INSERT INTO _" + _club + "_players (playerTeam, playerForenames, playerSurname, playerNickname, playerChineseName, playerEmail, playerDob, playerHkid, playerNumber, playerTelNumber) VALUES ('" + _team + "', '" + _playerForename + "', '" + _playerSurname + "', '" + _playerNickname + "', '" + _playerChineseName_enc + "', '" + _playerEmail + "', '" + _playerDob + "', '" + _playerHkid + "', '" + _playerNumber + "', '" + _playerTelNumber + "')"
|
||||
print(_team)
|
||||
print(sql)
|
||||
sql = "INSERT INTO _" + _club + "_players (playerTeam, playerForenames, playerSurname, playerNickname, playerEmail, playerDob, playerHkid, playerNumber, playerTelNumber) VALUES ('" + _team + "', '" + _playerForename + "', '" + _playerSurname + "', '" + _playerNickname + "', '" + _playerEmail + "', '" + _playerDob + "', '" + _playerHkid + "', '" + _playerNumber + "', '" + _playerTelNumber + "')"
|
||||
sql_write(sql)
|
||||
return render_template('_convenorPlayerAddResults.html', club=_club, firstname=_playerForename, nickname=_playerNickname, surname=_surname, shirt=_playerNumber)
|
||||
except Exception as e:
|
||||
@ -206,8 +203,6 @@ def convenorDeletePlayer():
|
||||
@basic_auth.required
|
||||
def convenorEditPlayerResult():
|
||||
try:
|
||||
# _year = request.form['year']
|
||||
_year = "2018"
|
||||
_club = request.form['playerClub']
|
||||
_team = request.form['playerTeam']
|
||||
_playerForename = request.form['playerForenames']
|
||||
@ -222,7 +217,7 @@ def convenorEditPlayerResult():
|
||||
_playerNumber = request.form['playerNumber']
|
||||
_playerTelNumber = request.form['playerTelNumber']
|
||||
if _team and _playerSurname and _playerHkid and _playerNumber and request.method == 'POST':
|
||||
sql = "UPDATE _" + _club + "_players SET playerTeam='" + _team + "', playerForenames='" + _playerForename + "', playerSurname='" + _playerSurname + "', playerNickname='" + _playerNickname + "', playerChineseName='" + _playerChineseName_enc + "', playerEmail='" + _playerEmail + "', playerDob='" + _playerDob + "', playerHkid='" + _playerHkid + "', playerTelNumber='" + _playerTelNumber + "' WHERE playerNumber='" + _playerNumber + "'"
|
||||
sql = "UPDATE _" + _club + "_players SET playerTeam='" + _team + "', playerForenames='" + _playerForename + "', playerSurname='" + _playerSurname + "', playerNickname='" + _playerNickname + "', playerEmail='" + _playerEmail + "', playerTelNumber='" + _playerTelNumber + "' WHERE playerHkid='" + _playerHkid + "'"
|
||||
sql_write(sql)
|
||||
return render_template('_convenorEditPlayerResults.html', club=_club, firstname=_playerForename, nickname=_playerNickname, surname=_playerSurname, shirt=_playerNumber)
|
||||
except Exception as e:
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
<ooctype html>
|
||||
<head>
|
||||
<title>List of player team appearances from 2018/19 season - Python Flask MySQL app</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<ul class=flashes>
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</p>
|
||||
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
|
||||
<table class="table table-striped table-bordered table-hover table-condensed">
|
||||
<thead>
|
||||
{%- for column in columns %}
|
||||
<th>{{ column['Field'] }}</th>
|
||||
{%- endfor %}
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{%- for row in rows %}
|
||||
<tr>
|
||||
{%- for column in columns %}
|
||||
<td>{{ row[column['Field']] }}</td>
|
||||
{%- endfor %}
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
|
||||
</body>
|
||||
@ -1,70 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Club Player Playing Record Search *TESTING*</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<h2>Search Parameters - select a club to search their playing record</h2>
|
||||
<body onload="myFunction()">
|
||||
<dl>
|
||||
<p>
|
||||
{{ form.csrf_token }}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form class="col-sm-6" method="post" action="/clubPlayingRecordSearch">
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
|
||||
{{ form.season(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Club:</span>
|
||||
{{ form.clubName(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
{{ form.submitButton(class_="btn btn-success") }}
|
||||
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
|
||||
</p>
|
||||
</form>
|
||||
<div class="col-sm-0">
|
||||
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
</dl>
|
||||
|
||||
<script>
|
||||
var club_select = document.getElementById("clubName");
|
||||
var club_logo = document.getElementById("selectedClubLogo");
|
||||
|
||||
club_select.onchange = function() {myFunction()};
|
||||
|
||||
function myFunction() {
|
||||
|
||||
club = club_select.value;
|
||||
|
||||
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
|
||||
response.json().then(function(data) {
|
||||
var HTML = '';
|
||||
for (var logo of data) {
|
||||
HTML += logo.logoURL;
|
||||
}
|
||||
club_logo.src = HTML;
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,70 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Player Check *TESTING*</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<h2>Search Parameters - select a club to search for players who have played for 2 or more teams</h2>
|
||||
<body onload="myFunction()">
|
||||
<dl>
|
||||
<p>
|
||||
{{ form.csrf_token }}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form class="col-sm-6" method="post" action="/playerCheckResults">
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
|
||||
{{ form.season(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Club:</span>
|
||||
{{ form.clubName(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
{{ form.submitButton(class_="btn btn-success") }}
|
||||
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
|
||||
</p>
|
||||
</form>
|
||||
<div class="col-sm-0">
|
||||
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
</dl>
|
||||
|
||||
<script>
|
||||
var club_select = document.getElementById("clubName");
|
||||
var club_logo = document.getElementById("selectedClubLogo");
|
||||
|
||||
club_select.onchange = function() {myFunction()};
|
||||
|
||||
function myFunction() {
|
||||
|
||||
club = club_select.value;
|
||||
|
||||
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
|
||||
response.json().then(function(data) {
|
||||
var HTML = '';
|
||||
for (var logo of data) {
|
||||
HTML += logo.logoURL;
|
||||
}
|
||||
club_logo.src = HTML;
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,41 +0,0 @@
|
||||
<ooctype html>
|
||||
<head>
|
||||
<title>List of player team appearances from 2018/19 season - Python Flask MySQL app</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<ul class=flashes>
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</p>
|
||||
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
|
||||
<table class="table table-striped table-bordered table-hover table-condensed">
|
||||
<thead>
|
||||
{%- for column in columns %}
|
||||
<th>{{ column['Field'] }}</th>
|
||||
{%- endfor %}
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{%- for row in rows %}
|
||||
<tr>
|
||||
{%- for column in columns %}
|
||||
<td>{{ row[column['Field']] }}</td>
|
||||
{%- endfor %}
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
|
||||
</body>
|
||||
@ -1,90 +0,0 @@
|
||||
<doctype html>
|
||||
<head>
|
||||
<title>List of players from 2018/19 season - Python Flask MySQL app</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
|
||||
<style>
|
||||
tbody td {
|
||||
border: 1px solid #ccc;
|
||||
padding: 0px 0px;
|
||||
}
|
||||
|
||||
th.rotate {
|
||||
/* Something you can count on */
|
||||
height: 120px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th.rotate > div {
|
||||
transform:
|
||||
/* Magic Numbers */
|
||||
translate(23px, 0px)
|
||||
/* 45 is really 360 - 45 */
|
||||
rotate(315deg);
|
||||
width: 30px;
|
||||
}
|
||||
th.rotate > div > span {
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 0px 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<p>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<ul class=flashes>
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</p>
|
||||
<table class="table table-striped table-hover table-condensed">
|
||||
<thead>
|
||||
{%- for column in columns %}
|
||||
{% if column['Field'] == "playerNumber" %}
|
||||
<th><div><span>Player Number</span></div></th>
|
||||
{% elif column['Field'] == "playerName" %}
|
||||
<th><div><span>Player Name</span></div></th>
|
||||
{% elif column['Field'] == "appearances" %}
|
||||
<th><div><span>Appearances</span></div></th>
|
||||
{% elif column['Field'] == "goals" %}
|
||||
<th><div><span>Goals</span></div></th>
|
||||
{% elif column['Field'].startswith('22381goal') %}
|
||||
<th class="rotate"><div><span>NBC A goals</span></div></th>
|
||||
{% else %}
|
||||
{%- for match in matchesList %}
|
||||
{% if column['Field'].startswith(match) %}
|
||||
{% if column['Field'].endswith('played') %}
|
||||
<th class="rotate"><div><span>{{ matches[match] }} Played</span></div></th>
|
||||
{% elif column['Field'].endswith('goals') %}
|
||||
<th class="rotate"><div><span>{{ matches[match] }} Goals</span></div></th>
|
||||
{% elif column['Field'].endswith('capt') %}
|
||||
<th class="rotate"><div><span>{{ matches[match] }} Captain</span></div></th>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{%- endfor %}
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{%- for row in rows %}
|
||||
<tr>
|
||||
{%- for column in columns %}
|
||||
<td>{{ row[column['Field']] }}</td>
|
||||
{%- endfor %}
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
|
||||
</body>
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Player Playing Record Results Search *TESTING*</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<h2>Search Parameters - select both a club and team</h2>
|
||||
<body onload="myFunction()">
|
||||
<dl>
|
||||
<p>
|
||||
{{ form.csrf_token }}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form class="col-sm-6" method="post" action="/playerRecordSearch">
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
|
||||
{{ form.season(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Club:</span>
|
||||
{{ form.clubName(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
<div class = "col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon2">Team:</span>
|
||||
{{ form.teamName(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
{{ form.submitButton(class_="btn btn-success") }}
|
||||
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
|
||||
</p>
|
||||
</form>
|
||||
<div class="col-sm-0">
|
||||
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
</dl>
|
||||
|
||||
<script>
|
||||
var club_select = document.getElementById("clubName");
|
||||
var club_logo = document.getElementById("selectedClubLogo");
|
||||
var team_select = document.getElementById("teamName");
|
||||
|
||||
club_select.onchange = function() {myFunction()};
|
||||
|
||||
function myFunction() {
|
||||
|
||||
club = club_select.value;
|
||||
|
||||
fetch('/hkfc-d/motmAdmin/' + club).then(function(response) {
|
||||
response.json().then(function(data) {
|
||||
var optionHTML = '';
|
||||
for (var team of data) {
|
||||
optionHTML += '<option value="' + team.team + '">' + team.team + '</option>';
|
||||
}
|
||||
team_select.innerHTML = optionHTML;
|
||||
})
|
||||
|
||||
});
|
||||
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
|
||||
response.json().then(function(data) {
|
||||
var HTML = '';
|
||||
for (var logo of data) {
|
||||
HTML += logo.logoURL;
|
||||
}
|
||||
club_logo.src = HTML;
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,129 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Team Season Results Search *TESTING*</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<h2>Search Parameters - select both a club and team</h2>
|
||||
<body onload="myFunction()">
|
||||
<dl>
|
||||
<p>
|
||||
{{ form.csrf_token }}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form class="col-sm-6" method="post" action="/searchTeam">
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
|
||||
{{ form.season(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon2">Club:</span>
|
||||
{{ form.clubName(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
<div class = "col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon3">Team:</span>
|
||||
{{ form.teamName(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon4">Start Date:</span>
|
||||
{{ form.startDate(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
<div class = "col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon5">End Date:</span>
|
||||
{{ form.endDate(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
{{ form.submitButton(class_="btn btn-success") }}
|
||||
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
|
||||
</p>
|
||||
</form>
|
||||
<div class="col-sm-0">
|
||||
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
</dl>
|
||||
|
||||
<script>
|
||||
var season_select = document.getElementById("season");
|
||||
var season_start = document.getElementById("startDate");
|
||||
var club_select = document.getElementById("clubName");
|
||||
var club_logo = document.getElementById("selectedClubLogo");
|
||||
var team_select = document.getElementById("teamName");
|
||||
|
||||
season_select.onchange = function() {seasonFunction()};
|
||||
club_select.onchange = function() {myFunction()};
|
||||
|
||||
function myFunction() {
|
||||
|
||||
club = club_select.value;
|
||||
|
||||
fetch('/hkfc-d/motmAdmin/' + club).then(function(response) {
|
||||
response.json().then(function(data) {
|
||||
var optionHTML = '';
|
||||
for (var team of data) {
|
||||
optionHTML += '<option value="' + team.team + '">' + team.team + '</option>';
|
||||
}
|
||||
team_select.innerHTML = optionHTML;
|
||||
})
|
||||
|
||||
});
|
||||
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
|
||||
response.json().then(function(data) {
|
||||
var HTML = '';
|
||||
for (var logo of data) {
|
||||
HTML += logo.logoURL;
|
||||
}
|
||||
club_logo.src = HTML;
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function seasonFunction() {
|
||||
season = season_select.value;
|
||||
var startDate = '';
|
||||
if (season == '2018') {
|
||||
startDate = '2018-09-01'
|
||||
} else if (season == '2017') {
|
||||
startDate = '2017-01-09'
|
||||
} else if (season == '2016') {
|
||||
startDate = '2016-09-01'
|
||||
} else if (season == '2015') {
|
||||
startDate = '2015-09-01'
|
||||
} else if (season == '2014') {
|
||||
startDate = '2014-09-01'
|
||||
} else if (season == '2013') {
|
||||
startDate = '2013-09-01'
|
||||
} else if (season == '2012') {
|
||||
startDate = '2012-09-01'
|
||||
} else if (season == '2011') {
|
||||
startDate = '2011-09-01'
|
||||
} else if (season == '2010') {
|
||||
startDate = '2010-09-01'
|
||||
}
|
||||
season_start.value = startDate;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,26 +0,0 @@
|
||||
<doctype html>
|
||||
<head>
|
||||
<title>List of matches from 2018/19 season - Python Flask MySQL CRUD</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<ul class=flashes>
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</p>
|
||||
<table class="table table-striped table-hover table-condensed">
|
||||
{{ table }}
|
||||
</table>
|
||||
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
|
||||
</body>
|
||||
@ -1,26 +0,0 @@
|
||||
<doctype html>
|
||||
<head>
|
||||
<title>Team Results from 2018/19 season - Python Flask MySQL app</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<ul class=flashes>
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</p>
|
||||
<table class="table table-bordered table-striped table-hover table-condensed">
|
||||
{{ table }}
|
||||
</table>
|
||||
<a class="btn btn-primary" href="/dashboard" role="button">Home</a>
|
||||
</body>
|
||||
@ -1,85 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Team Results Record Search *TESTING*</title>
|
||||
<link rel="stylesheet" media="screen" href ="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<h2>Search Parameters - select both a club and team</h2>
|
||||
<body onload="myFunction()">
|
||||
<dl>
|
||||
<p>
|
||||
{{ form.csrf_token }}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form class="col-sm-6" method="post" action="/teamRecordSearch">
|
||||
<div class = "row">
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Season data to search:</span>
|
||||
{{ form.season(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
<div class = "col-sm-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon1">Club:</span>
|
||||
{{ form.clubName(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
<div class = "col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon2">Team:</span>
|
||||
{{ form.teamName(class_="form-control") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
{{ form.submitButton(class_="btn btn-success") }}
|
||||
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
|
||||
</p>
|
||||
</form>
|
||||
<div class="col-sm-0">
|
||||
<img src="{{ selectedClubLogo }}" height="120" id="selectedClubLogo"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
</dl>
|
||||
|
||||
<script>
|
||||
var club_select = document.getElementById("clubName");
|
||||
var club_logo = document.getElementById("selectedClubLogo");
|
||||
var team_select = document.getElementById("teamName");
|
||||
|
||||
club_select.onchange = function() {myFunction()};
|
||||
|
||||
function myFunction() {
|
||||
|
||||
club = club_select.value;
|
||||
|
||||
fetch('/hkfc-d/motmAdmin/' + club).then(function(response) {
|
||||
response.json().then(function(data) {
|
||||
var optionHTML = '';
|
||||
for (var team of data) {
|
||||
optionHTML += '<option value="' + team.team + '">' + team.team + '</option>';
|
||||
}
|
||||
team_select.innerHTML = optionHTML;
|
||||
})
|
||||
|
||||
});
|
||||
fetch('/hkfc-d/getLogo/' + club).then(function(response) {
|
||||
response.json().then(function(data) {
|
||||
var HTML = '';
|
||||
for (var logo of data) {
|
||||
HTML += logo.logoURL;
|
||||
}
|
||||
club_logo.src = HTML;
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -12,18 +12,6 @@ Dashboard
|
||||
|
||||
{% block body %}
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn">Men's Hockey
|
||||
<i class="fa fa-caret-down"></i>
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="/search">General Match Search</a>
|
||||
<a href="/playerRecords">Player Record Search</a>
|
||||
<a href="/teamRecords">Team Record Search</a>
|
||||
<a href="/clubPlayingRecords">Club Player Playing Record</a>
|
||||
<a href="/playerCheck">Played for multiple teams</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<button class="dropbtn">HKFC D
|
||||
<i class="fa fa-caret-down"></i>
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TESTING: Search Parameters - Python Flask Hockey Results Search App</title>
|
||||
<link rel="stylesheet" media="screen" href ="static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="static/css/bootstrap-theme.min.css">
|
||||
<meta name="viewport" content = "width=device-width, initial-scale=1.0">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="static/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<h2>Search Parameters</h2>
|
||||
<body>
|
||||
Please select your search parameters - search for both club and team
|
||||
<form method="post" action="/search-results">
|
||||
<dl>
|
||||
<p>
|
||||
<label for="inputClub">Club:</label>
|
||||
<select class="form-control" name="inputClub" required>
|
||||
{% for item in data %}
|
||||
<option value={{ item.hockeyClub }}>{{ item.hockeyClub }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="inputTeam">Team:</label>
|
||||
<select class="form-control" name="inputTeam" required>
|
||||
<option value="A">A</option>
|
||||
<option value="B">B</option>
|
||||
<option value="C">C</option>
|
||||
<option value="D">D</option>
|
||||
<option value="E">E</option>
|
||||
<option value="F">F</option>
|
||||
<option value="G">G</option>
|
||||
<option value="H">H</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="startDate">Start Date:</label>
|
||||
<p/>
|
||||
<input type="date" name="startDate" data-date-format="DD-MM-YYYY"/>
|
||||
<p/>
|
||||
<label for="endDate">End Date:</label>
|
||||
<p/>
|
||||
<input type="date" name="endDate" data-date-format="DD-MM-YYYY"/>
|
||||
</p>
|
||||
</dl>
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success">Submit</button>
|
||||
<a class="btn btn-danger" href="/dashboard" role="button">Cancel</a>
|
||||
</p>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user