aboutsummaryrefslogtreecommitdiff
path: root/include/offers-view.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/offers-view.php')
-rw-r--r--include/offers-view.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/offers-view.php b/include/offers-view.php
index c578522..eec7701 100644
--- a/include/offers-view.php
+++ b/include/offers-view.php
@@ -127,3 +127,45 @@ $_offer = new offer($_pdo, $_id);
</div>
</div>
</div>
+<div class="col-lg-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">Discounts</div>
+ <div class="panel-body table-responsive">
+ <table class="table table-bordered table-striped">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Briefing</th>
+ <th>Value</th>
+ <th>Tools</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php
+ $discounts = BusinessAdmin::getDiscounts($_pdo, array("offerId = {$_offer->getId()}"));
+ foreach ($discounts as $discount) {
+ echo "<tr>
+ <td class='col-min-width'>{$discount->getId()}</td>
+ <td class='col-max-width'>
+ <b><a href='#' class='editable' id='editable-discount-{$discount->getId()}-title' data-type='text' data-pk='{$discount->getId()}' data-url='".constants::url_external."discounts/edit'>{$discount->getTitle()}</a></b><br/>
+ <p>{$discount->getDescription()}</p>
+ </td>
+ <td class='col-min-width'>
+ ".constants::invoice_valuta."<a href='#' class='editable' id='editable-discount-{$discount->getId()}-value' data-type='text' data-pk='{$discount->getId()}' data-url='".constants::url_external."discounts/edit'>{$discount->getValue()}</a> / hr<br/>
+ <a href='#' class='editable' id='editable-discount-{$discount->getId()}-vat' data-type='text' data-pk='{$discount->getId()}' data-url='".constants::url_external."discounts/edit'>{$discount->getVAT()}</a>% VAT
+ </td>
+ <td class='col-min-width'>
+ <a title='View' href='".constants::url_internal."/discounts?id={$discount->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a>
+ <a title='Delete' href='".constants::url_internal."/discounts?delete={$discount->getId()}' class='btn btn-danger btn-circle fa fa-times'></a>
+ </td>
+ </tr>";
+ }
+ if (count($discounts) == 0) {
+ echo "<tr><td colspan='6'>There are no discounts in the database. Why not start with creating one, below?</td></tr>";
+ }
+ ?>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>