aboutsummaryrefslogtreecommitdiff
path: root/include/offers-view.php
diff options
context:
space:
mode:
authorCamil Staps2016-07-27 16:28:19 +0200
committerCamil Staps2016-07-27 16:28:19 +0200
commit9714f3d8cc311f3b75a4727156de2ab33cf3895e (patch)
tree647d3370ad70827be8c83bfec9e98ae156c4ea9e /include/offers-view.php
parentReorganise to have client use Model (diff)
Removed redundant whitespace & retab
Diffstat (limited to 'include/offers-view.php')
-rw-r--r--include/offers-view.php292
1 files changed, 146 insertions, 146 deletions
diff --git a/include/offers-view.php b/include/offers-view.php
index 082af35..8f741c2 100644
--- a/include/offers-view.php
+++ b/include/offers-view.php
@@ -2,17 +2,17 @@
/**
* 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/>.
*/
@@ -22,152 +22,152 @@ require_once('./login.php');
$_offer = new offer($_pdo, $_id);
?>
<div class="col-lg-6">
- <div class="panel panel-default" id="panel-timeline">
- <div class="panel-heading">
- <i class="fa fa-clock-o fa-fw"></i> Timeline
- </div>
- <!-- /.panel-heading -->
- <div class="panel-body">
- <ul class="timeline">
- <?php
- $list = array();
- $sort_list = array();
-
- $temp = array(
- 'id' => $_offer->getId(),
- 'contact' => $_offer->getContact()->getName(),
- 'assignments' => '',
- 'assignments_header' => ''
- );
- foreach ($_offer->getAssignments() as $assignment) {
- $temp['assignments'] .= "<b>{$assignment->getTitle()}</b><br/><span class='smaller'>(".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)</span><br/><p>{$assignment->getDescription()}</p>";
- $temp['assignments_header'] .= "<b>{$assignment->getTitle()}</b><br/><span class='smaller'>(".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)</span><br/>";
- }
- $list[] = array_merge($temp, array('type' => 'start', 'time' => $_offer->getStartDate(), 'description' => 'Offer started'));
- $sort_list[] = $_offer->getStartDate() . $_offer->getId() . 0;
- $list[] = array_merge($temp, array('type' => 'end', 'time' => $_offer->getEndDate(), 'description' => 'Offer ended'));
- $sort_list[] = $_offer->getEndDate() . $_offer->getId() . 1;
- if ($_offer->getInvoiceDate() > 0) {
- $list[] = array_merge($temp, array('type' => 'invoice', 'time' => $_offer->getInvoiceDate(), 'description' => 'Invoice sent'));
- $sort_list[] = $_offer->getInvoiceDate() . $_offer->getId() . 2;
- if ($_offer->getPaymentReceived() > 0) {
- $list[] = array_merge($temp, array('type' => 'payment_received', 'time' => $_offer->getPaymentReceived(), 'description' => 'Payment received'));
- $sort_list[] = $_offer->getPaymentReceived() . $_offer->getId() . 3;
- }
- }
+ <div class="panel panel-default" id="panel-timeline">
+ <div class="panel-heading">
+ <i class="fa fa-clock-o fa-fw"></i> Timeline
+ </div>
+ <!-- /.panel-heading -->
+ <div class="panel-body">
+ <ul class="timeline">
+ <?php
+ $list = array();
+ $sort_list = array();
- array_multisort($sort_list, SORT_DESC, $list);
- $i = 0;
- foreach ($list as $item) {
- if ($item['time'] > time()) {
- continue;
- }
- echo "<li" . ($i++ % 2 == 0 ? ' class="timeline-inverted"' : '') . ">";
- switch ($item['type']) {
- case 'start': echo "<div class='timeline-badge info' title='{$item['description']}'><i class='fa fa-circle-o-notch'></i></div>"; break;
- case 'end': echo "<div class='timeline-badge primary' title='{$item['description']}'><i class='fa fa-circle-o'></i></div>"; break;
- case 'invoice': echo "<div class='timeline-badge warning' title='{$item['description']}'><i class='fa fa-check-circle-o'></i></div>"; break;
- case 'payment_received': echo "<div class='timeline-badge success' title='{$item['description']}'><i class='fa fa-eur'></i></div>"; break;
- }
- echo "<div class='timeline-panel'>";
- echo "<div class='timeline-heading'><h4 class='timeline-title'>#{$item['id']} to {$item['contact']}: {$item['description']}</h4><p><small class='text-muted'><i class='fa fa-clock-o fa-fw'></i> ".BusinessAdmin::formatDate($item['time'],false,true,true)."</small></p></div>";
- switch ($item['type']) {
- case 'start': echo "<div class='timeline-body'>{$item['assignments']}</div>"; break;
- default: echo "<div class='timeline-body'>{$item['assignments_header']}</div>";
- }
- echo "</div>";
- echo "</li>";
- }
- ?>
- </ul>
- </div>
- <!-- /.panel-body -->
- </div>
- <!-- /.panel -->
+ $temp = array(
+ 'id' => $_offer->getId(),
+ 'contact' => $_offer->getContact()->getName(),
+ 'assignments' => '',
+ 'assignments_header' => ''
+ );
+ foreach ($_offer->getAssignments() as $assignment) {
+ $temp['assignments'] .= "<b>{$assignment->getTitle()}</b><br/><span class='smaller'>(".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)</span><br/><p>{$assignment->getDescription()}</p>";
+ $temp['assignments_header'] .= "<b>{$assignment->getTitle()}</b><br/><span class='smaller'>(".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)</span><br/>";
+ }
+ $list[] = array_merge($temp, array('type' => 'start', 'time' => $_offer->getStartDate(), 'description' => 'Offer started'));
+ $sort_list[] = $_offer->getStartDate() . $_offer->getId() . 0;
+ $list[] = array_merge($temp, array('type' => 'end', 'time' => $_offer->getEndDate(), 'description' => 'Offer ended'));
+ $sort_list[] = $_offer->getEndDate() . $_offer->getId() . 1;
+ if ($_offer->getInvoiceDate() > 0) {
+ $list[] = array_merge($temp, array('type' => 'invoice', 'time' => $_offer->getInvoiceDate(), 'description' => 'Invoice sent'));
+ $sort_list[] = $_offer->getInvoiceDate() . $_offer->getId() . 2;
+ if ($_offer->getPaymentReceived() > 0) {
+ $list[] = array_merge($temp, array('type' => 'payment_received', 'time' => $_offer->getPaymentReceived(), 'description' => 'Payment received'));
+ $sort_list[] = $_offer->getPaymentReceived() . $_offer->getId() . 3;
+ }
+ }
+
+ array_multisort($sort_list, SORT_DESC, $list);
+ $i = 0;
+ foreach ($list as $item) {
+ if ($item['time'] > time()) {
+ continue;
+ }
+ echo "<li" . ($i++ % 2 == 0 ? ' class="timeline-inverted"' : '') . ">";
+ switch ($item['type']) {
+ case 'start': echo "<div class='timeline-badge info' title='{$item['description']}'><i class='fa fa-circle-o-notch'></i></div>"; break;
+ case 'end': echo "<div class='timeline-badge primary' title='{$item['description']}'><i class='fa fa-circle-o'></i></div>"; break;
+ case 'invoice': echo "<div class='timeline-badge warning' title='{$item['description']}'><i class='fa fa-check-circle-o'></i></div>"; break;
+ case 'payment_received': echo "<div class='timeline-badge success' title='{$item['description']}'><i class='fa fa-eur'></i></div>"; break;
+ }
+ echo "<div class='timeline-panel'>";
+ echo "<div class='timeline-heading'><h4 class='timeline-title'>#{$item['id']} to {$item['contact']}: {$item['description']}</h4><p><small class='text-muted'><i class='fa fa-clock-o fa-fw'></i> ".BusinessAdmin::formatDate($item['time'],false,true,true)."</small></p></div>";
+ switch ($item['type']) {
+ case 'start': echo "<div class='timeline-body'>{$item['assignments']}</div>"; break;
+ default: echo "<div class='timeline-body'>{$item['assignments_header']}</div>";
+ }
+ echo "</div>";
+ echo "</li>";
+ }
+ ?>
+ </ul>
+ </div>
+ <!-- /.panel-body -->
+ </div>
+ <!-- /.panel -->
</div>
<div class="col-lg-6">
- <div class="panel panel-default">
- <div class="panel-heading">Assignments</div>
- <div class="panel-body table-responsive">
- <table class="table table-bordered table-striped">
- <thead>
- <tr>
- <th>#</th>
- <th>Briefing</th>
- <th>Time</th>
- <th>Price</th>
- <th>Tools</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $assignments = BusinessAdmin::getAssignments($_pdo, array("offerId = {$_offer->getId()}"));
- foreach ($assignments as $assignment) {
- echo "<tr>
- <td class='col-min-width'>{$assignment->getId()}</td>
- <td class='col-max-width'>
- <b><a href='#' class='editable' id='editable-assignment-{$assignment->getId()}-title' data-type='text' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getTitle()}</a></b><br/>
- <p>{$assignment->getDescription()}</p>
- </td>
- <td class='col-min-width'><a href='#' class='editable' id='editable-assignment-{$assignment->getId()}-hours' data-type='text' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getHours()}</a>h</td>
- <td class='col-min-width'>
- ".constants::invoice_valuta."<a href='#' class='editable' id='editable-assignment-{$assignment->getId()}-price_per_hour' data-type='text' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getPricePerHour()}</a> / hr<br/>
- <a href='#' class='editable' id='editable-assignment-{$assignment->getId()}-vat' data-type='text' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getVAT()}</a>% VAT
- </td>
- <td class='col-min-width'>
- <a title='View' href='".constants::url_internal."/assignments?id={$assignment->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a>
- <a title='Delete' href='".constants::url_internal."/assignments?delete={$assignment->getId()}' class='btn btn-danger btn-circle fa fa-times'></a>
- </td>
- </tr>";
- }
- if (count($assignments) == 0) {
- echo "<tr><td colspan='6'>There are no assignments in the database. Why not start with creating one, below?</td></tr>";
- }
- ?>
- </tbody>
- </table>
- </div>
- </div>
+ <div class="panel panel-default">
+ <div class="panel-heading">Assignments</div>
+ <div class="panel-body table-responsive">
+ <table class="table table-bordered table-striped">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Briefing</th>
+ <th>Time</th>
+ <th>Price</th>
+ <th>Tools</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php
+ $assignments = BusinessAdmin::getAssignments($_pdo, array("offerId = {$_offer->getId()}"));
+ foreach ($assignments as $assignment) {
+ echo "<tr>
+ <td class='col-min-width'>{$assignment->getId()}</td>
+ <td class='col-max-width'>
+ <b><a href='#' class='editable' id='editable-assignment-{$assignment->getId()}-title' data-type='text' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getTitle()}</a></b><br/>
+ <p>{$assignment->getDescription()}</p>
+ </td>
+ <td class='col-min-width'><a href='#' class='editable' id='editable-assignment-{$assignment->getId()}-hours' data-type='text' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getHours()}</a>h</td>
+ <td class='col-min-width'>
+ ".constants::invoice_valuta."<a href='#' class='editable' id='editable-assignment-{$assignment->getId()}-price_per_hour' data-type='text' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getPricePerHour()}</a> / hr<br/>
+ <a href='#' class='editable' id='editable-assignment-{$assignment->getId()}-vat' data-type='text' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getVAT()}</a>% VAT
+ </td>
+ <td class='col-min-width'>
+ <a title='View' href='".constants::url_internal."/assignments?id={$assignment->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a>
+ <a title='Delete' href='".constants::url_internal."/assignments?delete={$assignment->getId()}' class='btn btn-danger btn-circle fa fa-times'></a>
+ </td>
+ </tr>";
+ }
+ if (count($assignments) == 0) {
+ echo "<tr><td colspan='6'>There are no assignments in the database. Why not start with creating one, below?</td></tr>";
+ }
+ ?>
+ </tbody>
+ </table>
+ </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 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>