changes
This commit is contained in:
parent
6f02d3c301
commit
83ea052cc7
1 changed files with 71 additions and 31 deletions
|
@ -95,6 +95,7 @@ class timetable {
|
|||
foreach ($result as $substitution) {
|
||||
$this->data[$i+1][$substitution->period]['substitution'][] = $substitution;
|
||||
if ($this->periodmax < $lesson->period) $this->periodmax = $lesson->period;
|
||||
//echo var_dump($substitution);
|
||||
}
|
||||
}
|
||||
$day->add(new \DateInterval("P1D"));
|
||||
|
@ -262,7 +263,25 @@ class timetable {
|
|||
$mylesson['room'] = $lesson->room;
|
||||
$mylesson['subject'] = $lesson->subject;
|
||||
$mylesson['status'] = "";
|
||||
if ($lesson->week[$this->week-1] == 'x') $mylesson['status'] = 1;
|
||||
if ($lesson->week[$this->week-1] == 'x') {
|
||||
$mylesson['status'] = 1;
|
||||
/*
|
||||
if (array_key_exists('substitution', $this->data[$day+1][$period+1])) {
|
||||
foreach ($this->data[$day+1][$period+1]['substitution'] as $substitution) {
|
||||
if ($lesson->class == $substitution->classa &&
|
||||
$lesson->teacher == $substitution->teachera &&
|
||||
$lesson->subject == $substitution->subjecta &&
|
||||
$lesson->room == $substitution->rooma) {
|
||||
$mylesson['class'] = $substitution->classb;
|
||||
$mylesson['teacher'] = $substitution->teacherb;
|
||||
$mylesson['room'] = $substitution->roomb;
|
||||
$mylesson['subject'] = $substitution->subjectb;
|
||||
$mylesson['status'] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
$mylesson['flag'] = "";
|
||||
if ($lesson->flag) $mylesson['flag'] = $lesson->flag;
|
||||
|
||||
|
@ -287,6 +306,27 @@ class timetable {
|
|||
foreach ($this->data[$day+1][$period+1]['substitution'] as $substitution) {
|
||||
//echo "In substitution loop".$substitution->text;
|
||||
$days[$day]['substitution'] .= $substitution->text;
|
||||
|
||||
if ($substitution->subjectb &&
|
||||
(($this->type == 'teacher' && $this->name == $substitution->teacherb) ||
|
||||
($this->type == 'class' && $this->name == $substitution->classb) ||
|
||||
($this->type == 'room' && $this->name == $substitution->roomb))
|
||||
) {
|
||||
|
||||
$mylesson = array();
|
||||
$mylesson['class'] = $substitution->classb;
|
||||
$mylesson['teacher'] = $substitution->teacherb;
|
||||
$mylesson['room'] = $substitution->roomb;
|
||||
$mylesson['subject'] = $substitution->subjectb;
|
||||
$mylesson['status'] = "";
|
||||
$mylesson['flag'] = 1;
|
||||
|
||||
$days[$day]['lessons'][] = $mylesson;
|
||||
//if ($lesson->week[$this->week-1] != '0') $days[$day]['lessons'][] = $mylesson;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue