- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
for ($j=1; $j<8; $j++) {
$up = "";
$down = "";
for ($i=1; $i<7; $i++) {
if (($i==4)&&($j==4)) {
$up = $up.'<td class="simp" colspan="2" rowspan="4">Военная<br>Подготовка</td>';
continue;
}
if (($i==4)&&($j>3)&&($j<6)) {
continue;
}
$x = $i*2-1;
$y = $j*2-1;
if (($table[$x][$y]==$table[$x][$y+1])&&($table[$x+1][$y+1]==$table[$x+1][$y])&&($table[$x+1][$y+1]==$table[$x][$y])) {
$up = $up.str_replace("<br><br>","","<td title='".$table[$x][$y]['description']."' class='simp' colspan='2' rowspan='2'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>");
}
else {
$cnt = 0;
if ($table[$x][$y]==$s) $cnt++;
if ($table[$x][$y+1]==$s) $cnt++;
if ($table[$x+1][$y]==$s) $cnt++;
if ($table[$x+1][$y+1]==$s) $cnt++;
if ($cnt==3) {
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
$down = $down."<td title='".$table[$x+1][$y+1]['description']."' class='insm'>".$table[$x+1][$y+1]['subject']."<br>".$table[$x+1][$y+1]['auditory']."<br>".$table[$x+1][$y+1]['lecturer']."</td>";
}
else {
if ($table[$x][$y]==$table[$x][$y+1]) { // Левые совпадают
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm' rowspan='2'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
if ($table[$x+1][$y]==$table[$x+1][$y+1]) {
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm' rowspan='2'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
}
else {
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
$down = $down."<td title='".$table[$x+1][$y+1]['description']."' class='insm'>".$table[$x+1][$y+1]['subject']."<br>".$table[$x+1][$y+1]['auditory']."<br>".$table[$x+1][$y+1]['lecturer']."</td>";
}
} else {
if ($table[$x+1][$y]==$table[$x+1][$y+1]) { // Правые совпадают
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm' rowspan='2'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
}
else {
if ($table[$x][$y]==$table[$x+1][$y]) { // Верхние совпадают
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm' colspan='2'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
if ($table[$x][$y+1]==$table[$x+1][$y+1]) {
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm' colspan='2'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
}
else {
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
$down = $down."<td title='".$table[$x+1][$y+1]['description']."' class='insm'>".$table[$x+1][$y+1]['subject']."<br>".$table[$x+1][$y+1]['auditory']."<br>".$table[$x+1][$y+1]['lecturer']."</td>";
}
}
else {
if ($table[$x][$y+1]==$table[$x+1][$y+1]) { // Нижние совпадают
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
$up = $up."<td title='".$table[$x+1][$y]['description']."' class='insm'>".$table[$x+1][$y]['subject']."<br>".$table[$x+1][$y]['auditory']."<br>".$table[$x+1][$y]['lecturer']."</td>";
$down = $down."<td title='".$table[$x][$y+1]['description']."' class='insm' colspan='2'>".$table[$x][$y+1]['subject']."<br>".$table[$x][$y+1]['auditory']."<br>".$table[$x][$y+1]['lecturer']."</td>";
}
else {
$up = $up."<td title='".$table[$x][$y]['description']."' class='insm'>".$table[$x][$y]['subject']."<br>".$table[$x][$y]['auditory']."<br>".$table[$x][$y]['lecturer']."</td>";
...
Рендер расписания занятий из базы данных в табличку на HTML