pmelo working version
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php require_once("pmelo.inc.php");?>
|
||||
<?php require_once "pmelo.inc.php"; ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<!-- shared imports (common css, MaterializeCss) -->
|
||||
<?php readfile('shared/imports.php'); ?>
|
||||
<?php readfile("shared/imports.php"); ?>
|
||||
|
||||
<!-- inits for the materializeCss -->
|
||||
<script src="index.js"></script>
|
||||
@@ -32,7 +32,7 @@
|
||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
</a>
|
||||
</li>
|
||||
<?php require_once 'sidenav/loginStatus.php'; ?><!-- brings its own li -->
|
||||
<?php require_once "sidenav/loginStatus.php"; ?><!-- brings its own li -->
|
||||
</ul>
|
||||
</header>
|
||||
|
||||
@@ -43,11 +43,16 @@
|
||||
<div class="input-field col s12">
|
||||
<select name ="pmelo[fighterIds][]" id="pmelo-form-fighters-select" multiple>
|
||||
<option value="" disabled selected>Kämpfer auswählen</option>
|
||||
<?php
|
||||
foreach($pmelo->trainees as $trainee){
|
||||
echo("<option value=\"".$trainee->getId()."\">".$trainee->getFirstname()." ".$trainee->getName()."</option>".PHP_EOL);
|
||||
}
|
||||
?>
|
||||
<?php foreach ($pmelo->trainees as $trainee) {
|
||||
echo "<option value=\"" .
|
||||
$trainee->getId() .
|
||||
"\">" .
|
||||
$trainee->getFirstname() .
|
||||
" " .
|
||||
$trainee->getName() .
|
||||
"</option>" .
|
||||
PHP_EOL;
|
||||
} ?>
|
||||
</select>
|
||||
<label for="form-select-2">Kämpfer auswählen</label>
|
||||
<input type="submit" value="Liste erstellen">
|
||||
@@ -59,46 +64,57 @@
|
||||
<tr><th>Platz</th><th>Name</th><th>Aufstieg</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(!empty($pmelo->fighters)){
|
||||
foreach($pmelo->rankings as $rank=>$id){
|
||||
if(array_key_exists($id, $pmelo->fighters)){
|
||||
$fighter = $pmelo->fighters[$id];
|
||||
// echo("<tr><td>".$rank."</td><td>".$fighter->getFirstName()."</td></tr>".PHP_EOL);
|
||||
echo("<tr><td>".$rank."</td><td>".$fighter->getFirstName()." ".$fighter->getName()."</td><td>^</td></tr>".PHP_EOL);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if (!empty($pmelo->fighters)) {
|
||||
// remember the predecessor for the promoting form
|
||||
$lastOne = null;
|
||||
foreach ($pmelo->rankings as $rank => $id) {
|
||||
if (array_key_exists($id, $pmelo->fighters)) {
|
||||
$fighter = $pmelo->fighters[$id];
|
||||
echo "<tr>" .
|
||||
"<td>" .
|
||||
$rank .
|
||||
"</td>" .
|
||||
"<td>" .
|
||||
$fighter->getFirstName() .
|
||||
" " .
|
||||
$fighter->getName() .
|
||||
"</td>" .
|
||||
"<td>" .
|
||||
(!is_null($lastOne)
|
||||
? $pmelo->htmlPromoteButton(
|
||||
$fighter->getId(),
|
||||
$rank,
|
||||
$lastOne["id"],
|
||||
$lastOne["rank"]
|
||||
)
|
||||
: "") .
|
||||
"</td>" .
|
||||
"</tr>" .
|
||||
PHP_EOL;
|
||||
$lastOne = ["id" => $fighter->getId(), "rank" => $rank];
|
||||
}
|
||||
}
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul class="collection with-header">
|
||||
<li class="collection-header"><h3>Logs</h3></li>
|
||||
<?php
|
||||
foreach($pmelo->log as $logLevel=>$messages){
|
||||
if(!empty($messages)){
|
||||
?>
|
||||
<?php foreach ($pmelo->log as $logLevel => $messages) {
|
||||
if (!empty($messages)) { ?>
|
||||
<li class="collection-item">
|
||||
<ul class="collection with-header">
|
||||
<li class="collection-header"><?php echo($logLevel);?></li>
|
||||
<?php
|
||||
foreach($messages as $message){
|
||||
?>
|
||||
<li class="collection-header"><?php echo $logLevel; ?></li>
|
||||
<?php foreach ($messages as $message) { ?>
|
||||
<li>
|
||||
<?php echo($message); ?>
|
||||
<?php echo $message; ?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} ?>
|
||||
</ul>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user