import of substitutions in MoodleDB (rd)

This commit is contained in:
L_DA 2020-06-30 19:26:24 +00:00
parent 85f5a13f9f
commit a6334e6c86
15 changed files with 154 additions and 32 deletions

View file

@ -46,8 +46,8 @@ class timetable {
global $USER, $DB, $CFG;
$this->week = $week;
//$sql = "$this->type = '$this->name' and not (mid(week, $this->week, 1) = '0')";
$sql = "$this->type = '$this->name' and (mid(week, $this->week, 1) = '1')";
$sql = "$this->type = '$this->name' and not (mid(week, $this->week, 1) = '0')";
//$sql = "$this->type = '$this->name' and (mid(week, $this->week, 1) = '1')";
if ($result = $DB->get_records_select('timetable_lesson',$sql)) {
foreach ($result as $lesson) {
$this->data[$lesson->day][$lesson->period][] = $lesson;
@ -84,7 +84,9 @@ class timetable {
foreach ($this->data[$k][$i] as $lesson) {
if ($content) $content .= "<br>";
if ($lesson->flag) $content .= "<span style='color:red;'>";
$content .= $lesson->{$view};
//if (substr($lesson->week,$this->week,1) == '1') $content .= $lesson->{$view};
if ($lesson->week[$this->week-1] == '1') $content .= $lesson->{$view};
if ($lesson->week[$this->week-1] == 'x') $content .= "---";
if ($lesson->flag) $content .= "</span>";
$flag += $lesson->flag;
}