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

82 lines
2.6 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 == '')
{
# Fehlerhafte Speicherung der HZB als Punkte (1-15), stattt als Note (1-6)
$query_punkte = "SELECT vorname, nachname, id, mail, a.hzb, a.hzb_punkte
FROM `bpm_note` a, bpm_tmp_jahrgang_kandidat b
WHERE a.ka_id = b.ka_id
AND a.hzb != '0.00' AND a.hzb_punkte!='0.00'
ORDER BY a.hzb_punkte DESC;
";
$result_punkte = $db->query($query_punkte) or die("Cannot execute punkte");
$row_cnt_punkte = $result_punkte->num_rows;
$smarty->assign('anz_punkte', $row_cnt_punkte);
while ($row_punkte = $result_punkte->fetch_array())
{
$row_punkte['hzb_form'] = number_format($row_punkte['hzb'], 2, ',', '.');
$row_punkte['hzb_punkte_form'] = number_format($row_punkte['hzb_punkte'], 2, ',', '.');
$table_punkte[] = $row_punkte;
}
$smarty->assign('table_punkte', $table_punkte);
# 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
, hzb
, id
, mail
, rang1
FROM bpm_tmp_jahrgang_kandidat
ORDER BY rang1 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['hzb_form'] = number_format($row1['hzb'], 2, ',', '.');
$row1['rangliste'] = $row1['rang1'];
$table_data1[] = $row1;
}
$smarty->assign('table_data1', $table_data1);
}
$smarty->assign('action', "$action");
$smarty->display("$template/admin/$templatename");
?>