aboutsummaryrefslogtreecommitdiff
path: root/include/clients-view.php
diff options
context:
space:
mode:
authorCamil Staps2015-02-05 00:40:47 +0100
committerCamil Staps2015-02-05 00:40:47 +0100
commitc50a323c25a0787ba2051b19721983776a229615 (patch)
tree87e13060ca6633bed3f5de2e25c5eedf866a0073 /include/clients-view.php
parentInitial commit (diff)
Initial commit
Diffstat (limited to 'include/clients-view.php')
-rw-r--r--include/clients-view.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/include/clients-view.php b/include/clients-view.php
new file mode 100644
index 0000000..066ad3e
--- /dev/null
+++ b/include/clients-view.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * BusinessAdmin: administrative software for small companies
+ * Copyright (C) 2015 Camil Staps (ViviSoft)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+$_client = new client($_pdo, $_id);
+?>
+<div class="col-lg-12">
+ <div class="panel panel-default">
+ <div class="panel-heading">Contacts</div>
+ <div class="panel-body table-responsive">
+ <table class="table table-bordered table-striped">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Name</th>
+ <th>Address</th>
+ <th>Tools</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php
+ $contacts = $_client->getContacts();
+ foreach ($contacts as $contact) {
+ echo "<tr>
+ <td class='col-min-width'>{$contact->getId()}</td>
+ <td class='col-min-width'><a href='#' class='editable' id='editable-contact-{$contact->getId()}-name' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getName()}</a></td>
+ <td class='col-max-width'>
+ <a href='#' class='editable' id='editable-contact-{$contact->getId()}-address' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getAddress()}</a><br/>
+ <a href='#' class='editable' id='editable-contact-{$contact->getId()}-postal_code' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getPostalCode()}</a>
+ <a href='#' class='editable' id='editable-contact-{$contact->getId()}-city' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getCity()}</a><br/>
+ <a href='#' class='editable' id='editable-contact-{$contact->getId()}-country' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getCountry()}</a>
+ </td>
+ <td class='col-min-width'>
+ <a title='View' href='?id={$contact->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a>
+ <a title='Delete' href='?delete={$contact->getId()}' class='btn btn-danger btn-circle fa fa-times'></a>
+ </td>
+ </tr>";
+ }
+ if (count($contacts) == 0) {
+ echo "<tr><td colspan='4'>There are no contacts in the database. Why not <a href='".constants::url_external."contacts'>create one</a>?</td></tr>";
+ }
+ ?>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div> \ No newline at end of file