This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
dogstats/web/pages/smart/controller.php

33 lines
679 B
PHP
Raw Normal View History

2023-11-26 10:30:00 +01:00
<?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');
}
}