-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay.php
104 lines (99 loc) · 2.36 KB
/
display.php
1
2
3
4
5
6
7
8
9
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<? include 'build.php' ?>
<?
$start = $_POST["start"];
$end = $_POST["end"];
$type = $_POST["type"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Latin Vocab</title>
</head>
<body>
<table>
<tr>
<td align="center">Chapter</td>
<td align="center">Part of Speech</td>
<td>Latin</td>
<td>English</td>
</tr>
<?
for ($i = 0; $i < sizeof($vocab); $i++):
$types = preg_split("/, /", $vocab[$i]['TYPE']);
if ($start || $end) {
if ($end < $start) $end = $start;
if ($vocab[$i]['CHAPTER'] < $start)
continue;
if ($vocab[$i]['CHAPTER'] > $end)
continue;
}
if ($type) {
$erg = preg_split("/ /", $type);
$found = 0;
foreach ($types as $t) {
if (!strcasecmp($t, $erg[0])) {
$found = 1;
break;
}
}
if (!$found)
continue;
if (sizeof($erg) > 1) {
$found = 0;
foreach ($types as $t) {
if (!strcasecmp($t, "verb")) {
if (($erg[1] == $vocab[$i]['CONJUGATION']) ||
(!$erg[1] && !$vocab[$i]['CONJUGATION'])) {
$found = 1;
break;
}
} else if (!strcasecmp($t, "noun")) {
if (($erg[1] == $vocab[$i]['DECLENSION']) ||
(!$erg[1] && !$vocab[$i]['DECLENSION'])) {
$found = 1;
break;
}
}
}
if (!$found)
continue;
}
}
?>
<tr>
<td align="center"><? echo $vocab[$i]['CHAPTER'] ?></td>
<td align="center"><?
echo $vocab[$i]['TYPE'];
foreach ($types as $t) {
if (!strcasecmp($t, "verb")) {
if (!isset($vocab[$i]['CONJUGATION']))
print " (irregular)";
else
print " (" . $vocab[$i]['CONJUGATION'] . ")";
} else if (!strcasecmp($t, "noun")) {
if (!isset($vocab[$i]['DECLENSION']))
print " (indeclinable)";
else
print " (" . $vocab[$i]['DECLENSION'] . ")";
}
}
?></td>
<td><?
echo $vocab[$i]['LATIN'];
foreach ($types as $t) {
if (!strcasecmp($t, "noun")) {
print ", " . $vocab[$i]['GENDER'] . ".";
}
}
?></td>
<td><?
echo $vocab[$i]['ENGLISH'];
if (isset($vocab[$i]['NOTES']))
print " (" . $vocab[$i]['NOTES'] . ")";
?></td>
</tr>
<? endfor; ?>
</table>
</body>
</html>