ideenmanagement/gutachten_erledigt.php
2023-03-09 11:22:13 +01:00

73 lines
2.2 KiB
PHP
Executable File

<?php
include_once 'classes/TestProjektSmarty.class.php';
require_once("config.inc.php");
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
$smarty = new Smarty();
require_once "language/german.inc.php";
#require_once("func_gutachter_status.php");
$action = $_GET['action'];
if(isset($_GET['id'])){
$_SESSION["status_id"] = $_GET['id'];
}
if($action == ''){
$db = dbconnect();
$query = "SELECT gid, a.vid, betreff, date_format(a.erfass_dat, '%d.%m.%Y %H:%i:%s') erfass_dat_form, vorname, nachname, date_format(b.frist_datum_abgabe, '%d.%m.%Y') frist_dat_form
FROM imt_vorschlag a, imt_gutachter b, imt_user c
WHERE a.vid = b.vid
AND a.imtuid=c.imtuid
AND 1 = (SELECT CASE 1 WHEN (SELECT count(*)
FROM imt_verlauf d
WHERE d.vid=a.vid
AND d.status IN ('7', '8')
GROUP BY vid
)>0
THEN '0'
ELSE '1'
END
# Man darf den Fall solange sehen, bis er abgeschlossen ist, also entweder mit Status 7 oder 8
)
AND b.imtuid = '$uid'
AND frist_datum_abgabe != '0000-00-00'
GROUP BY a.vid
ORDER BY frist_datum ASC";
$result = $db->query ($query)
or die ("Cannot execute query");
$table_data1 = array();
while ($row = $result->fetch_array()){
# frist_datum_abgabe kann nur gesetzt sein, wenn Ausschuss zugestimmt hat.
# Erst dann wird im Adminbereich das Briefsymbol sichtbar, wo das Datum gesetzt werden kann.
array_push($table_data1, array(
'vid' => $row[vid],
'betreff' => $row[betreff],
'erfass_dat_form' => $row[erfass_dat_form],
'frist_dat_form' => $row[frist_dat_form],
'vorname' => $row[vorname],
'nachname' => $row[nachname]
)
);
}
$smarty->assign('table_data1', $table_data1);
}
$smarty->assign('action', "$action");
$smarty->display("$template/$templatename");
?>