Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerjoss committed Apr 26, 2022
1 parent 92e9e8b commit f715689
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 91 deletions.
78 changes: 37 additions & 41 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
<link rel="stylesheet" href="assets/bootstrap-4.4.1/css/bootstrap.min.css">
<!-- Page CSS -->
<link rel="stylesheet" href="assets/css/styles.css">

</head>

<body>
<div id = "top" class="container">
<ul class="nav">
Expand All @@ -31,45 +29,46 @@
$Nickname = $_GET["nick"];
// Achtung: $Nickname muss in den span id="Nickname" !!! (wird von results.js als hidden input ins Formular eingefügt und somit an savetips.php weitergegeben)
if (isset($Nickname)) {
echo'
<div id="TipForm">
<div class="row">
<div class="col-md-6">
<span id="Nickname" style="display:none">';echo $Nickname;echo '</span>
<h3>Hallo <span id="Vorname"></span></h3>
<h3>Dein Tip für MotoGP Race</h3><h3><span id="Event"></span></h3><h3><span id="Deadline"></span></h3>
<form action="ajax/savetips.php" id="form">
<span id="EidUid" style="display:none"></span>
<div id="TipForm" class="row">
<div class="col-sm-4">
<label for="P1">P1</label>
<input class="form-control" type="text" name="P1">
</div>
<div class="col-sm-4">
<label for="P2">P2</label>
<input class="form-control" type="text" name="P2">
</div>
<div class="col-sm-4">
<label for="P3">P3</label>
<input class="form-control" type="text" name="P3">
</div>
<div class="col-sm-4" style="margin-top: 1em;">
<button type="button" class="btn btn-primary" id="btnSubmit">Absenden</button>
echo'
<div id="TipForm">
<div class="row">
<div class="col-md-6">
<span id="Nickname" style="display:none">';echo $Nickname;echo '</span>
<h3>Hallo <span id="Vorname"></span></h3>
<h3>Dein Tip für MotoGP Race</h3><h3><span id="Event"></span></h3><h3><span id="Deadline"></span></h3>
<form action="ajax/savetips.php" id="form">
<span id="EidUid" style="display:none"></span>
<div id="TipForm" class="row">
<div class="col-sm-4">
<label for="P1">P1</label>
<input class="form-control" type="text" name="P1">
</div>
</div>
</form>
<h3 style="margin-top:1em;">Achtung: in die Eingabefelder dürfen NUR Startnummern eingetragen werden, KEINE Namen !</h3>
<div class="col-sm-4">
<label for="P2">P2</label>
<input class="form-control" type="text" name="P2">
</div>
<div class="col-sm-4">
<label for="P3">P3</label>
<input class="form-control" type="text" name="P3">
</div>
<div class="col-sm-4" style="margin-top: 1em;">
<button type="button" class="btn btn-primary" id="btnSubmit">Absenden</button>
</div>
</div>
</form>
<h3 style="margin-top:1em;">Achtung: in die Eingabefelder dürfen NUR Startnummern eingetragen werden, KEINE Namen !</h3>
</div>
</div>
</div>
<p></p>
</div>
<div id="tooLate">
<div class="row">
<div class="col-md-6">
<h3>Sorry, du bist zu spät dran, Tips können nur bis zur Deadline abgegeben werden !</h3>
<p></p>
</div>';
echo'
<div id="tooLate">
<div class="row">
<div class="col-md-6">
<h3>Sorry, du bist zu spät dran, Tips können nur bis zur Deadline abgegeben werden !</h3>
</div>
</div>
</div>
</div>';
</div>';
} else {
echo '<div class="row">
<div class="col-md-8">
Expand All @@ -92,7 +91,6 @@
<a class="nav-link" href="#ranking-list">-> Punktestand</a>
</li>
</ul>

<div class="row">
<div class="col-md-8">
<h3>Rennergebnisse:</h3>
Expand Down Expand Up @@ -121,7 +119,6 @@
</div>
</div>
<a class="nav-link" href="#top">-> Seitenanfang</a>

</div>
<!-- Must put our javascript files here to fast the page loading -->
<!-- jQuery library local -->
Expand All @@ -136,6 +133,5 @@
<script src="assets/js/getscores.js"></script>
<script src="assets/js/gettotals.js"></script>
<script src="assets/js/savetips.js"></script>

</body>
</html>
26 changes: 7 additions & 19 deletions results.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Ergebnisse MotoGP Tipspiel</title>

<title>Rennergebnisse MotoGP Tipspiel</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">

<!-- Page CSS -->
<link rel="stylesheet" href="assets/css/styles.css">
</head>

<body>
<ul class="nav">
<li class="nav-item">
Expand All @@ -24,32 +21,23 @@
</li>
</ul>
<div class="container">

<br><br>

<h2>Hoernerfranzracing MotoGP Tipspiel - RennErgebnisse</h2>

<br><br>

<div class="row">
<div class="col-md-8">
<div id="results-list"></div>
</div>
</div>
</div>

<!-- Must put our javascript files here to fast the page loading -->

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<!-- jQuery library local -->
<script src="assets/js/jquery-3.6.0.min.js"></script>
<!-- Bootstrap JS local -->
<script src="assets/bootstrap-4.4.1/js/bootstrap.min.js"></script>
<!-- Moment JS local -->
<script src="assets/js/moment.js"></script>
<!-- Page Script -->
<script src="assets/js/results.js"></script>

<script src="assets/js/getresults.js"></script>
</body>

</html>
10 changes: 0 additions & 10 deletions riders.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
<head>
<meta charset="UTF-8">
<title>Fahrer MotoGP Tipspiel</title>

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="assets/bootstrap-4.4.1/css/bootstrap.min.css">

<!-- Page CSS -->
<link rel="stylesheet" href="assets/css/styles.css">
</head>

<body>
<div class="container">
<ul class="nav">
Expand All @@ -24,28 +21,21 @@
<a class="nav-link" href="howto.html">Anleitung</a>
</li>
</ul>

<br><br>

<h2>Hoernerfranzracing MotoGP Tipspiel - Fahrerliste</h2>

<br><br>
<div class="row">
<div class="col-md-8">
<div id="riders-list"></div>
</div>
</div>
</div>

<!-- Must put our javascript files here to fast the page loading -->

<!-- jQuery library local -->
<script src="assets/js/jquery-3.6.0.min.js"></script>
<!-- Bootstrap JS local -->
<script src="assets/bootstrap-4.4.1/js/bootstrap.min.js"></script>
<!-- Page Script -->
<script src="assets/js/riders.js"></script>

</body>

</html>
42 changes: 21 additions & 21 deletions sql/motogpdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@ CREATE TABLE `MGP_events` (
--

INSERT INTO `MGP_events` (`EID`, `Ort`, `Deadline`, `P1`, `P2`, `P3`) VALUES
(1, 'Doha', '2022-03-06 11:00:00', 23, 33, 44),
(2, 'Mandalika', '2022-03-20 11:00:00', 88, 20, 5),
(3, 'Termas', '2022-04-03 11:00:00', 41, 89, 42),
(4, 'Austin', '2022-04-10 11:00:00', 23, 42, 43),
(5, 'Portimao', '2022-04-24 11:00:00', NULL, NULL, NULL),
(6, 'Jerez', '2022-05-01 11:00:00', NULL, NULL, NULL),
(7, 'LeMans', '2022-05-15 11:00:00', NULL, NULL, NULL),
(8, 'Mugello', '2022-05-29 11:00:00', NULL, NULL, NULL),
(9, 'Catalunya', '2022-06-05 11:00:00', NULL, NULL, NULL),
(10, 'Sachsenring', '2022-06-19 11:00:00', NULL, NULL, NULL),
(11, 'Assen', '2022-06-26 11:00:00', NULL, NULL, NULL),
(12, 'Kymiring', '2022-07-10 11:00:00', NULL, NULL, NULL),
(13, 'Silverstone', '2022-08-07 11:00:00', NULL, NULL, NULL),
(14, 'RedBullRing', '2022-08-21 11:00:00', NULL, NULL, NULL),
(15, 'Misano', '2022-09-04 11:00:00', NULL, NULL, NULL),
(16, 'Aragon', '2022-09-18 11:00:00', NULL, NULL, NULL),
(17, 'Motegi', '2022-09-25 11:00:00', NULL, NULL, NULL),
(18, 'Buriram', '2022-10-02 11:00:00', NULL, NULL, NULL),
(19, 'PI', '2022-10-16 11:00:00', NULL, NULL, NULL),
(20, 'Sepang', '2022-10-23 11:00:00', NULL, NULL, NULL),
(21, 'Valencia', '2022-11-06 11:00:00', NULL, NULL, NULL);
(1, 'Doha', '2022-03-06 15:00:00', 23, 33, 44),
(2, 'Mandalika', '2022-03-20 7:00:00', 88, 20, 5),
(3, 'Termas', '2022-04-03 16:00:00', 41, 89, 42),
(4, 'Austin', '2022-04-10 16:00:00', 23, 42, 43),
(5, 'Portimao', '2022-04-24 13:00:00', 20, 5, 41),
(6, 'Jerez', '2022-05-01 13:00:00', NULL, NULL, NULL),
(7, 'LeMans', '2022-05-15 13:00:00', NULL, NULL, NULL),
(8, 'Mugello', '2022-05-29 13:00:00', NULL, NULL, NULL),
(9, 'Catalunya', '2022-06-05 13:00:00', NULL, NULL, NULL),
(10, 'Sachsenring', '2022-06-19 13:00:00', NULL, NULL, NULL),
(11, 'Assen', '2022-06-26 13:00:00', NULL, NULL, NULL),
(12, 'Kymiring', '2022-07-10 13:00:00', NULL, NULL, NULL),
(13, 'Silverstone', '2022-08-07 13:00:00', NULL, NULL, NULL),
(14, 'RedBullRing', '2022-08-21 13:00:00', NULL, NULL, NULL),
(15, 'Misano', '2022-09-04 13:00:00', NULL, NULL, NULL),
(16, 'Aragon', '2022-09-18 13:00:00', NULL, NULL, NULL),
(17, 'Motegi', '2022-09-25 7:00:00', NULL, NULL, NULL),
(18, 'Buriram', '2022-10-02 7:00:00', NULL, NULL, NULL),
(19, 'PI', '2022-10-16 6:00:00', NULL, NULL, NULL),
(20, 'Sepang', '2022-10-23 7:00:00', NULL, NULL, NULL),
(21, 'Valencia', '2022-11-06 13:00:00', NULL, NULL, NULL);

-- --------------------------------------------------------

Expand Down

0 comments on commit f715689

Please sign in to comment.