summaryrefslogtreecommitdiffstats
path: root/web/clients/index.php
blob: 4725b17c8dec2fae899ae02110fb28e4db890e82 (plain) (blame)
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
<?php
/**
 * Clients index view
 *
 * @package volse.faktura.web
 */

namespace Faktura;

require_once __DIR__ . '/../faktura.php';

$result = API\call('GET', 'clients');
$clients = json_decode($result);
?>
<!DOCTYPE html>
<head>
  <title>faktura: clients</title>
</head>
<body>
  <h1>Clients</h1>
  <table>
    <tr>
      <th>#</th>
      <th>Name</th>
      <th>Contact</th>
      <th>Email</th>
      <th>Phone</th>
      <th>VAT</th>
    </tr>
    <?php foreach ($clients as $client) { ?>
      <tr>
        <td><?php echo esc_html($client->id); ?></td>
		<td>
			<a href="/client/?id=<?php echo esc_attr($client->id); ?>">
				<?php echo esc_html($client->name); ?>
			</a>
		</td>
        <td><?php echo esc_html($client->contact); ?></td>
        <td><?php echo esc_html($client->email); ?></td>
        <td><?php echo esc_html($client->phone); ?></td>
        <td><?php echo esc_html($client->vat ? 'X' : ''); ?></td>
      </tr>
    <?php } ?>
  </table>
</body>