bpm/admin/rangliste2.php
2022-11-28 10:24:23 +01:00

66 lines
1.9 KiB
PHP
Executable File

<?php
if (!isset($_SESSION))
{
session_start();
}
include_once '../classes/TestProjektSmarty.class_subdir.php';
require_once ("../config.inc.php");
$templatename = substr(basename($_SERVER['PHP_SELF']) , 0, -3) . "html";
$smarty = new SmartyAdmin();
require_once "../language/german.inc.php";
if (isset($_GET['action']))
{
$action = $_GET['action'];
}
else
{
$action = '';
}
if ($action == '')
{
# Wann wurden die Ranglisten berechnet
$query_tab_created = $db->query("SELECT date_format(create_time, '%d.%m.%Y - %H:%i:%s') create_time
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = 'bpm'
AND table_name = 'bpm_tmp_jahrgang_kandidat'
");
$row_tab_created = $query_tab_created->fetch_array();
$smarty->assign('create_time', $row_tab_created['create_time']);
# Gespeicherte Werte
$query1 = "SELECT ka_id
, vorname
, nachname
, date_format(tm_datum, '%d.%m.%Y um %H:%i Uhr') tm_datum
, CASE tm_standort
WHEN 'L' THEN 'Ludwigsburg'
WHEN 'K' THEN 'Kehl'
ELSE ''
END as tm_standort
, testergebnis
, id
, mail
, rang2
FROM bpm_tmp_jahrgang_kandidat
ORDER BY rang2 ASC
";
$result1 = $db->query($query1) or die("Cannot execute query1");
$row_cnt = $result1->num_rows;
$smarty->assign('dokverw_anzdb', $row_cnt);
while ($row1 = $result1->fetch_array())
{
$row1['rangliste'] = $row1['rang2'];
$table_data1[] = $row1;
}
$smarty->assign('table_data1', $table_data1);
}
$smarty->assign('action', "$action");
$smarty->display("$template/admin/$templatename");
?>