summaryrefslogtreecommitdiffstats
path: root/web/clients/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/clients/index.php')
-rw-r--r--web/clients/index.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/web/clients/index.php b/web/clients/index.php
new file mode 100644
index 0000000..4725b17
--- /dev/null
+++ b/web/clients/index.php
@@ -0,0 +1,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>