forked from Golenzovskiy/oop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
51 lines (48 loc) · 1.28 KB
/
index.php
File metadata and controls
51 lines (48 loc) · 1.28 KB
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
<?php
define('ROOT', dirname(__FILE__) . '/');
require_once ROOT . 'employees.php';
include_once ROOT . 'classes.php';
?>
<html>
<head>
<meta charset="utf-8">
<title>ООП</title>
</head>
<body>
<table border="1" style="border: ridge;">
<tr>
<th colspan="3">Среднемесячная выплата сотрудникам</th>
</tr>
<tr style="font-style: italic; font-weight: bolder;">
<td>
id
</td>
<td>
Имя сотрудника
</td>
<td>
Выплата
</td>
</tr>
<? if ($collection !== null): ?>
<? foreach ($collection->getEmployees() as $employee): ?>
<tr>
<td>
<?= $employee->getId() ?>
</td>
<td>
<?= $employee->getName() ?>
</td>
<td>
<?= $employee->getPayment() ?>
</td>
</tr>
<? endforeach ?>
<? else: ?>
<tr>
<td colspan="3"><strong>Ошибка!</strong><br/>Файл с данными сотрудников не подключен.</td>
</tr>
<? endif; ?>
</table>
</body>
</html>