tried to implement import
This commit is contained in:
parent
bd49027ad6
commit
53a614c5fd
@ -34,6 +34,7 @@
|
||||
<th>msek</th>
|
||||
<th>bew</th>
|
||||
<th>punkte</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
<?php foreach ($results as $res) :
|
||||
// graph data preparation
|
||||
@ -67,7 +68,7 @@
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $res['event'] ?></td>
|
||||
<td><?= $res['ago'] ?></td>
|
||||
<td><?= date("d.m.Y", strtotime($res['date'])) ?></td>
|
||||
<td><?= $res['run'] ?></td>
|
||||
<td><?= $res['rang'] ?></td>
|
||||
<td><?= $res['stnr'] ?></td>
|
||||
@ -82,7 +83,24 @@
|
||||
<td><?= $res['msek'] ?></td>
|
||||
<td><?= $res['bew'] ?></td>
|
||||
<td><?= $res['punkte'] ?></td>
|
||||
|
||||
<td>
|
||||
<form id="tournament_import" hx-post="/tournaments/add" hx-encoding="multipart/form-data">
|
||||
<input type="hidden" name="tournament_name" value="<?= $res['event'] ?>">
|
||||
<input type="hidden" name="tournament_date" value="<?= date("d.m.Y", strtotime($res['date'])) ?>">
|
||||
<input type="hidden" name="tournament_run" value="<?= $res['run'] ?>">
|
||||
<input type="hidden" name="tournament_ranking" value="<?= $res['rang'] ?>">
|
||||
<input type="hidden" name="tournament_number" value="<?= $res['stnr'] ?>">
|
||||
<input type="hidden" name="tournament_participant" value="<?= $res['teilnehmer'] ?>">
|
||||
<input type="hidden" name="tournament_dog" value="<?= $res['hund'] ?>">
|
||||
<input type="hidden" name="tournament_club" value="<?= $res['verein'] ?>">
|
||||
<input type="hidden" name="tournament_faults" value="<?= $res['f'] ?>">
|
||||
<input type="hidden" name="tournament_refusals" value="<?= $res['vw'] ?>">
|
||||
<input type="hidden" name="tournament_time" value="<?= $res['zeit'] ?>">
|
||||
<input type="hidden" name="tournament_speed" value="<?= $res['msek'] ?>">
|
||||
<input type="hidden" name="tournament_points" value="<?= $res['punkte'] ?>">
|
||||
<button type="submit">Importieren</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
@ -32,9 +32,34 @@ class Tournaments extends Page {
|
||||
|
||||
function add()
|
||||
{
|
||||
|
||||
$t = new Tournament();
|
||||
$t->name = $_REQUEST['tournament_name'];
|
||||
$t->date = date("d.m.Y", strtotime($_REQUEST['tournament_date']));
|
||||
$t->duration = intval($_REQUEST['tournament_duration']);
|
||||
$t->referee = $_REQUEST['tournament_referee'];
|
||||
$t->text = $_REQUEST['tournament_text'];
|
||||
$t->url = $_REQUEST['tournament_url'];
|
||||
$t->logo = $_REQUEST['tournament_logo'];
|
||||
$t->run = $_REQUEST['tournament_run'];
|
||||
$t->run = $_REQUEST['tournament_run'];
|
||||
$t->ranking = $_REQUEST['tournament_ranking'];
|
||||
$t->number = $_REQUEST['tournament_number'];
|
||||
$t->participant = $_REQUEST['tournament_participant'];
|
||||
$t->dog = $_REQUEST['tournament_dog'];
|
||||
$t->club = $_REQUEST['tournament_club'];
|
||||
$t->faults = $_REQUEST['tournament_faults'];
|
||||
$t->refusals = $_REQUEST['tournament_refusals'];
|
||||
$t->time = $_REQUEST['tournament_time'];
|
||||
$t->points = $_REQUEST['tournament_points'];
|
||||
$t->speed = $_REQUEST['tournament_speed'];
|
||||
$this->set('tournamentdata',$t->data);
|
||||
$this->set('template','edit_tournament.html');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function index() {
|
||||
$events = $_SESSION['user']->data['tournaments'];
|
||||
$tournaments = [];
|
||||
@ -126,6 +151,7 @@ class Tournaments extends Page {
|
||||
{
|
||||
if($_REQUEST['submit'])
|
||||
{
|
||||
var_dump($_REQUEST);
|
||||
$id = $_REQUEST['tournament_id'];
|
||||
$name = $_REQUEST['tournament_name'];
|
||||
$date = $_REQUEST['tournament_date'];
|
||||
|
Reference in New Issue
Block a user