Matching of type in SQL-Like improved

This commit is contained in:
L_DA 2020-11-06 10:19:55 +01:00
parent 204695172f
commit 6cff7d762d
28 changed files with 1 additions and 1 deletions

View file

@ -126,7 +126,7 @@ class timetable {
$day = new \DateTime($this->monday->format('Y-m-d\TH:i:sP'));
for ($i=0; $i<$this->numdayweek; $i++) {
$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 RLIKE '(^|~){$this->name}($|~)' OR {$this->type}b RLIKE '(^|~){$this->name}($|~)')";
if ($result = $DB->get_records_select('timetable_substitution',$sql)) {
foreach ($result as $substitution) {
$this->data[$i+1][$substitution->period]['substitution'][] = $substitution;