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) {
|
foreach ($result as $substitution) {
|
||||||
$this->data[$i+1][$substitution->period]['substitution'][] = $substitution;
|
$this->data[$i+1][$substitution->period]['substitution'][] = $substitution;
|
||||||
if ($this->periodmax < $lesson->period) $this->periodmax = $lesson->period;
|
if ($this->periodmax < $lesson->period) $this->periodmax = $lesson->period;
|
||||||
|
//echo var_dump($substitution);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$day->add(new \DateInterval("P1D"));
|
$day->add(new \DateInterval("P1D"));
|
||||||
|
@ -251,8 +252,8 @@ class timetable {
|
||||||
$days = array();
|
$days = array();
|
||||||
for ($day=0; $day<$numdayweek; $day++) {
|
for ($day=0; $day<$numdayweek; $day++) {
|
||||||
$days[$day] = array();
|
$days[$day] = array();
|
||||||
$days[$day]['substitution'] = "";
|
$days[$day]['substitution'] = "";
|
||||||
$days[$day]['lessons'] = array();
|
$days[$day]['lessons'] = array();
|
||||||
if (array_key_exists($period+1,$this->data[$day+1])
|
if (array_key_exists($period+1,$this->data[$day+1])
|
||||||
&& array_key_exists('lesson',$this->data[$day+1][$period+1])) {
|
&& array_key_exists('lesson',$this->data[$day+1][$period+1])) {
|
||||||
foreach ($this->data[$day+1][$period+1]['lesson'] as $lesson) {
|
foreach ($this->data[$day+1][$period+1]['lesson'] as $lesson) {
|
||||||
|
@ -261,43 +262,82 @@ class timetable {
|
||||||
$mylesson['teacher'] = $lesson->teacher;
|
$mylesson['teacher'] = $lesson->teacher;
|
||||||
$mylesson['room'] = $lesson->room;
|
$mylesson['room'] = $lesson->room;
|
||||||
$mylesson['subject'] = $lesson->subject;
|
$mylesson['subject'] = $lesson->subject;
|
||||||
$mylesson['status'] = "";
|
$mylesson['status'] = "";
|
||||||
if ($lesson->week[$this->week-1] == 'x') $mylesson['status'] = 1;
|
if ($lesson->week[$this->week-1] == 'x') {
|
||||||
$mylesson['flag'] = "";
|
$mylesson['status'] = 1;
|
||||||
if ($lesson->flag) $mylesson['flag'] = $lesson->flag;
|
/*
|
||||||
|
if (array_key_exists('substitution', $this->data[$day+1][$period+1])) {
|
||||||
/*
|
foreach ($this->data[$day+1][$period+1]['substitution'] as $substitution) {
|
||||||
if ($this->type == 'class') $mylesson['class'] = "";
|
if ($lesson->class == $substitution->classa &&
|
||||||
if ($this->type == 'teacher') $mylesson['teacher'] = "";
|
$lesson->teacher == $substitution->teachera &&
|
||||||
if ($this->type == 'room') $mylesson['room'] = "";
|
$lesson->subject == $substitution->subjecta &&
|
||||||
*/
|
$lesson->room == $substitution->rooma) {
|
||||||
if ($lesson->week[$this->week-1] != '0') $days[$day]['lessons'][] = $mylesson;
|
$mylesson['class'] = $substitution->classb;
|
||||||
/*
|
$mylesson['teacher'] = $substitution->teacherb;
|
||||||
- für diese Woche wurden keine Daten ausgegeben
|
$mylesson['room'] = $substitution->roomb;
|
||||||
0 in dieser Woche findet der Unterricht nicht statt
|
$mylesson['subject'] = $substitution->subjectb;
|
||||||
1 in dieser Woche findet der Unterricht statt
|
$mylesson['status'] = '';
|
||||||
x in dieser Woche entfällt der Unterricht
|
|
||||||
|
|
||||||
if ($lesson->week[$this->week-1] == 'x')
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (array_key_exists($period+1,$this->data[$day+1])
|
*/
|
||||||
&& array_key_exists('substitution', $this->data[$day+1][$period+1])) {
|
}
|
||||||
foreach ($this->data[$day+1][$period+1]['substitution'] as $substitution) {
|
$mylesson['flag'] = "";
|
||||||
//echo "In substitution loop".$substitution->text;
|
if ($lesson->flag) $mylesson['flag'] = $lesson->flag;
|
||||||
$days[$day]['substitution'] .= $substitution->text;
|
|
||||||
}
|
/*
|
||||||
}
|
if ($this->type == 'class') $mylesson['class'] = "";
|
||||||
|
if ($this->type == 'teacher') $mylesson['teacher'] = "";
|
||||||
|
if ($this->type == 'room') $mylesson['room'] = "";
|
||||||
|
*/
|
||||||
|
if ($lesson->week[$this->week-1] != '0') $days[$day]['lessons'][] = $mylesson;
|
||||||
|
/*
|
||||||
|
- für diese Woche wurden keine Daten ausgegeben
|
||||||
|
0 in dieser Woche findet der Unterricht nicht statt
|
||||||
|
1 in dieser Woche findet der Unterricht statt
|
||||||
|
x in dieser Woche entfällt der Unterricht
|
||||||
|
|
||||||
|
if ($lesson->week[$this->week-1] == 'x')
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (array_key_exists($period+1,$this->data[$day+1])
|
||||||
|
&& array_key_exists('substitution', $this->data[$day+1][$period+1])) {
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
$periods[$period] = array();
|
$periods[$period] = array();
|
||||||
$periods[$period]['days'] = $days;
|
$periods[$period]['days'] = $days;
|
||||||
$periods[$period]['number'] = $period+1;
|
$periods[$period]['number'] = $period+1;
|
||||||
}
|
}
|
||||||
$resultdata['periods'] = $periods;
|
$resultdata['periods'] = $periods;
|
||||||
//echo var_dump($data);
|
//echo var_dump($data);
|
||||||
return $resultdata;
|
return $resultdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue