-
Notifications
You must be signed in to change notification settings - Fork 0
/
listaa.php
106 lines (73 loc) · 2.73 KB
/
listaa.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
105
106
<?php
require_once("artikkeli.php");
$pageName = "Näytä sivut / Uutiset";
?>
<?php require("top.php"); ?>
<?php
try {
require_once("artikkeliPDO.php");
$dbactions = new artikkeliPDO();
$artikkelit = $dbactions->kaikkiArtikkelit();
} catch (Exception $error) {
print($error->getMessage());
}
?>
<br>
<h3>Sivut</h3>
<br>
<table>
<thead>
<tr>
<td>Id</td>
<td>Otsikko</td>
<td>Alaotsikko</td>
<td>Teksti</td>
<td>Kirjoittaja</td>
<td>Pvm</td>
</tr>
</thead>
<?php
foreach($artikkelit as $artikkeli) {
if($artikkeli[0]->getTyyppi() == "sivu" || $artikkeli[0]->getTyyppi() == "Sivu") {
print("<tr>");
print("<td>" . $artikkeli[1] . "</td>"); // Artikkelin id
print("<td>" . $artikkeli[0]->getOtsikko() . "</td>");
print("<td>" . $artikkeli[0]->getAlaotsikko() . "</td>");
print("<td>" . $artikkeli[0]->getTeksti() . "</td>");
print("<td>" . $artikkeli[0]->getKirjoittaja() . "</td>");
print("<td>" . $artikkeli[0]->getPvm() . "</td>");
print("</tr>");
}
}
?>
</table>
<br>
<br>
<h3>Uutiset</h3>
<table>
<thead>
<tr>
<td>Id</td>
<td>Otsikko</td>
<td>Alaotsikko</td>
<td>Teksti</td>
<td>Kirjoittaja</td>
<td>Pvm</td>
</tr>
</thead>
<?php
foreach($artikkelit as $artikkeli) {
if($artikkeli[0]->getTyyppi() == "uutinen" || $artikkeli[0]->getTyyppi() == "Uutinen") {
print("<tr>");
print("<td>" . $artikkeli[1] . "</td>"); // Artikkelin id
print("<td>" . $artikkeli[0]->getOtsikko() . "</td>");
print("<td>" . $artikkeli[0]->getAlaotsikko() . "</td>");
print("<td>" . $artikkeli[0]->getTeksti() . "</td>");
print("<td>" . $artikkeli[0]->getKirjoittaja() . "</td>");
print("<td>" . $artikkeli[0]->getPvm() . "</td>");
print("</tr>");
}
}
?>
</table>
<?php require("bot.php"); ?>