first commit
This commit is contained in:
45
func_sperre_erm.php
Executable file
45
func_sperre_erm.php
Executable file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
## Funktion, die prüft, ob an einem Datum eine Sperre vorliegt
|
||||
## Sperren sind derzeit der Ruhestand eines Dozierenden sowie Praxissemester. In diesem Zeitraum gibt es bereits die maximale Ermäßigung. Doppelte Erm. gibt es nicht
|
||||
|
||||
function erm_sperre($imtuid, $datum){
|
||||
require("config.inc.php");
|
||||
$db = dbconnect();
|
||||
|
||||
# Fall 1: Ruhestand des Dozierenden
|
||||
$query_ruhestand = $db->query("SELECT count(*) Anz
|
||||
FROM dep_deputat_ermaessigung
|
||||
WHERE art like '%Ruhestand%'
|
||||
AND imtuid=$imtuid
|
||||
AND date_format(beginn, '%Y-%m') < '$datum'
|
||||
");
|
||||
$row_ruhestand = $query_ruhestand->fetch_array();
|
||||
|
||||
|
||||
if($row_ruhestand['Anz'] > 0){
|
||||
# Monat ist durch Ruhestand gesperrt
|
||||
return true;
|
||||
}else{
|
||||
# Fall 2: Praxissemester
|
||||
$query_praxis = $db->query("SELECT count(*) Anz
|
||||
FROM dep_deputat_ermaessigung
|
||||
WHERE art like '%Forschungssemester/Praxissemester/Abordnungen%'
|
||||
AND imtuid=$imtuid
|
||||
AND date_format(beginn, '%Y-%m') <= '$datum'
|
||||
AND date_format(ende, '%Y-%m') >= '$datum'
|
||||
");
|
||||
$row_praxis = $query_praxis->fetch_array();
|
||||
if($row_praxis['Anz'] > 0){
|
||||
# Monat gesperrt
|
||||
return true;
|
||||
}else{
|
||||
# Monat nicht gesperrt
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#echo erm_sperre(1,'2020-04');
|
||||
?>
|
Reference in New Issue
Block a user