<?php

declare(strict_types=1);

require \dirname(__DIR__, 1).'/src/warmup.php';

if (\extension_loaded('sqlite3')) {
  $smarty->assign('sqlite3', true);
  $smarty->assign('indexStateSource', $P->getJTlPlugin()->getPaths()->getAdminURL().'indexstats.php');
  $smarty->assign('resetIndexSource', $P->getJTlPlugin()->getPaths()->getAdminURL().'reindex.php');
  $smarty->assign('flushIndexSource', $P->getJTlPlugin()->getPaths()->getAdminURL().'flush.php');
  $stmt = $P->getPDO()->prepare('SELECT COUNT(*) FROM `tartikel`;');
  $stmt->execute();
  $smarty->assign('article_count', $stmt->fetchColumn());
} else {
  $smarty->assign('sqlite3', false);
}
$smarty->display($P->getJTlPlugin()->getPaths()->getAdminPath().'template/index.tpl');
