'templates', 'debug' => true )); $app->config('debug', true); require 'include/functions.php'; /* $app->get('/', function() use($app) { checkLogin($app); $data = array('page_title' => 'Home', 'header_title' => 'Dashboard', 'header_active' => 'Dashboard', 'page' => '/'); $app->render('index.html', $data ); })->name("home"); */ $app->get('/', function() use($app) { checkLogin($app); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $db = getDB(); $qv = array(); if(!isAdmin()) { if($stmt = $db->prepare("SELECT distinct qv from user_qv where user_id = :usrid order by qv asc")){ $stmt->bindValue(":usrid", $_SESSION['user_id'], PDO::PARAM_INT); $stmt->execute(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $qv[] = $row['qv']; } } } else { if($stmt = $db->prepare("SELECT distinct QV from lista_paraprake_2022 order by QV asc")){ $stmt->execute(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $qv[] = $row['QV']; } } } $data = array('page_title' => 'Statistika', 'header_title' => 'Statistika', 'header_active' => 'Statistika', 'page' => '/', 'qv_st' => $qv, 'teDhena' => array(), 'string' => '[[]]', 'str2' => '[[]]'); $app->render('index.html', $data) ; })->name("home"); $app->get('/hello/:name', function($name) use($app) { echo "data: $name"; }); $app->run(); ?>