smart test
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
This commit is contained in:
33
web/pages/smart/controller.php
Normal file
33
web/pages/smart/controller.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Smart extends Page {
|
||||
function setMenu()
|
||||
{
|
||||
$this->menu_text = 'Smart';
|
||||
$this->menu_image = 'fas fa-robot';
|
||||
$this->menu_priority = 1;
|
||||
}
|
||||
|
||||
function index()
|
||||
{
|
||||
$this->set('template', "smart.html.php");
|
||||
}
|
||||
|
||||
function search()
|
||||
{
|
||||
$db = new SQLite3(ROOT.DS.'../crawler/data.db');
|
||||
$q = $_REQUEST['q'];
|
||||
$res = $db->query("SELECT * FROM results WHERE teilnehmer LIKE '$q'");
|
||||
$results = [];
|
||||
while($row = $res->fetchArray())
|
||||
{
|
||||
$results[] = $row;
|
||||
}
|
||||
|
||||
$this->set('results', $results);
|
||||
$this->set('template', 'search.html.php');
|
||||
|
||||
}
|
||||
|
||||
}
|
40
web/pages/smart/search.html.php
Normal file
40
web/pages/smart/search.html.php
Normal file
@ -0,0 +1,40 @@
|
||||
<table class="table">
|
||||
<tr>
|
||||
|
||||
<th>event</th>
|
||||
<th>run</th>
|
||||
<th>rang</th>
|
||||
<th>stnr</th>
|
||||
<th>teilnehmer</th>
|
||||
<th>hund</th>
|
||||
<th>verein</th>
|
||||
<th>f</th>
|
||||
<th>vw</th>
|
||||
<th>zf</th>
|
||||
<th>zeit</th>
|
||||
<th>gf</th>
|
||||
<th>msek</th>
|
||||
<th>bew</th>
|
||||
<th>punkte</th>
|
||||
</tr>
|
||||
<?php foreach($results as $res): ?>
|
||||
<tr>
|
||||
<td><?= $res['event'] ?></td>
|
||||
<td><?= $res['run'] ?></td>
|
||||
<td><?= $res['rang'] ?></td>
|
||||
<td><?= $res['stnr'] ?></td>
|
||||
<td><?= $res['teilnehmer'] ?></td>
|
||||
<td><?= $res['hund'] ?></td>
|
||||
<td><?= $res['verein'] ?></td>
|
||||
<td><?= $res['f'] ?></td>
|
||||
<td><?= $res['vw'] ?></td>
|
||||
<td><?= $res['zf'] ?></td>
|
||||
<td><?= $res['zeit'] ?></td>
|
||||
<td><?= $res['gf'] ?></td>
|
||||
<td><?= $res['msek'] ?></td>
|
||||
<td><?= $res['bew'] ?></td>
|
||||
<td><?= $res['punkte'] ?></td>
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
11
web/pages/smart/smart.html.php
Normal file
11
web/pages/smart/smart.html.php
Normal file
@ -0,0 +1,11 @@
|
||||
<h2>Dein Name wie der auf Teilnahmelisten zu finden ist</h2>
|
||||
<input type="text" name="q"
|
||||
hx-get="/smart/search"
|
||||
hx-trigger="keyup changed delay:500ms"
|
||||
hx-target="#search-results"
|
||||
placeholder="Suchen..."
|
||||
hx-indicator="#indicator"
|
||||
>
|
||||
<div id="search-results"></div>
|
||||
|
||||
<i id="indicator" class="fad fa-spinner-third fa-spin htmx-indicator"></i>
|
Reference in New Issue
Block a user