This commit is contained in:
L_DA 2020-09-23 22:02:26 +02:00
parent a75f0af2f6
commit 0b67abeab9

View file

@ -87,14 +87,8 @@ class timetable {
}
}
$day = new \DateTime($this->monday->format('Y-m-d\TH:i:sP'));
// TODO CHANGE DATABASE: table substitution: classesa -> classa, classesb -> classb !!!
for ($i=0; $i<$this->numdayweek; $i++) {
if ($this->type == 'class') {
$sql = "date = '".$day->format('Ymd')."' AND ({$this->type}esa LIKE '%{$this->name}%' OR {$this->type}esb LIKE '%{$this->name}%')";
} else {
$sql = "date = '".$day->format('Ymd')."' AND ({$this->type}a LIKE '%{$this->name}%' OR {$this->type}b LIKE '%{$this->name}%')";
}
$sql = "date = '".$day->format('Ymd')."' AND ({$this->type}a LIKE '%{$this->name}%' OR {$this->type}b LIKE '%{$this->name}%')";
if ($result = $DB->get_records_select('timetable_substitution',$sql)) {
foreach ($result as $substitution) {