diff options
author | Camil Staps | 2016-07-27 16:28:19 +0200 |
---|---|---|
committer | Camil Staps | 2016-07-27 16:28:19 +0200 |
commit | 9714f3d8cc311f3b75a4727156de2ab33cf3895e (patch) | |
tree | 647d3370ad70827be8c83bfec9e98ae156c4ea9e /include | |
parent | Reorganise to have client use Model (diff) |
Removed redundant whitespace & retab
Diffstat (limited to 'include')
-rw-r--r-- | include/404.php | 36 | ||||
-rw-r--r-- | include/about.php | 112 | ||||
-rw-r--r-- | include/ajax-collapse.php | 4 | ||||
-rw-r--r-- | include/assignments-edit.php | 6 | ||||
-rw-r--r-- | include/assignments-new.php | 6 | ||||
-rw-r--r-- | include/assignments-overview.php | 288 | ||||
-rw-r--r-- | include/assignments-view.php | 10 | ||||
-rw-r--r-- | include/assignments.php | 6 | ||||
-rw-r--r-- | include/clients-edit.php | 6 | ||||
-rw-r--r-- | include/clients-new.php | 6 | ||||
-rw-r--r-- | include/clients-overview.php | 190 | ||||
-rw-r--r-- | include/clients-view.php | 6 | ||||
-rw-r--r-- | include/clients.php | 6 | ||||
-rw-r--r-- | include/contacts-edit.php | 6 | ||||
-rw-r--r-- | include/contacts-new.php | 6 | ||||
-rw-r--r-- | include/contacts.php | 6 | ||||
-rw-r--r-- | include/discounts-edit.php | 6 | ||||
-rw-r--r-- | include/discounts-new.php | 6 | ||||
-rw-r--r-- | include/discounts-overview.php | 28 | ||||
-rw-r--r-- | include/discounts.php | 6 | ||||
-rw-r--r-- | include/home.php | 2 | ||||
-rw-r--r-- | include/offers-edit.php | 6 | ||||
-rw-r--r-- | include/offers-new.php | 6 | ||||
-rw-r--r-- | include/offers-overview.php | 8 | ||||
-rw-r--r-- | include/offers-view.php | 292 | ||||
-rw-r--r-- | include/offers.php | 6 | ||||
-rw-r--r-- | include/users-new.php | 6 |
27 files changed, 536 insertions, 536 deletions
diff --git a/include/404.php b/include/404.php index 335ebf7..dc0cff0 100644 --- a/include/404.php +++ b/include/404.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/>. */ @@ -23,23 +23,23 @@ require('./header.php'); <div id="wrapper"> - <?php require('nav.php'); ?> - - <!-- Page Content --> - <div id="page-wrapper"> - <div class="row"> - <div class="col-lg-12"> - <h1>404</h1> - <p class="lead">The page you requested could not be found.</p> - </div> - <!-- /.col-lg-12 --> - </div> - <!-- /.row --> - </div> - <!-- /#page-wrapper --> + <?php require('nav.php'); ?> + + <!-- Page Content --> + <div id="page-wrapper"> + <div class="row"> + <div class="col-lg-12"> + <h1>404</h1> + <p class="lead">The page you requested could not be found.</p> + </div> + <!-- /.col-lg-12 --> + </div> + <!-- /.row --> + </div> + <!-- /#page-wrapper --> </div> <!-- /#wrapper --> <?php require('./footer.php'); -?>
\ No newline at end of file +?> diff --git a/include/about.php b/include/about.php index 554a80f..e7ab3d4 100644 --- a/include/about.php +++ b/include/about.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/>. */ @@ -24,25 +24,25 @@ require('./header.php'); <div id="wrapper"> - <?php require('nav.php'); ?> - - <!-- Page Content --> - <div id="page-wrapper"> - <div class="row"> - <div class="col-lg-12"> - <h1 class="page-header">About</h1> - </div> - <!-- /.col-lg-12 --> - </div> + <?php require('nav.php'); ?> - <div class="row"> - <div class="col-md-8"> - <div class="panel panel-default"> - <div class="panel-heading">About</div> - <div class="panel-body"> - <p class="lead">BusinessAdmin <?=constants::version?> is open source software under the GPL 3.0 license.</p> - <p>A full version of the license is available <a href="<?=constants::url_external?>LICENSE">here</a>. An excerpt is shown below:</p> - <pre>BusinessAdmin: administrative software for small companies + <!-- Page Content --> + <div id="page-wrapper"> + <div class="row"> + <div class="col-lg-12"> + <h1 class="page-header">About</h1> + </div> + <!-- /.col-lg-12 --> + </div> + + <div class="row"> + <div class="col-md-8"> + <div class="panel panel-default"> + <div class="panel-heading">About</div> + <div class="panel-body"> + <p class="lead">BusinessAdmin <?=constants::version?> is open source software under the GPL 3.0 license.</p> + <p>A full version of the license is available <a href="<?=constants::url_external?>LICENSE">here</a>. An excerpt is shown below:</p> + <pre>BusinessAdmin: administrative software for small companies Copyright (C) 2015 Camil Staps (ViviSoft) This program is free software: you can redistribute it and/or modify @@ -63,43 +63,43 @@ You can contact me, Camil Staps, here: Camil Staps www.camilstaps.nl info@camilstaps.nl</pre> - </div> - </div> - </div> - <!-- /.col-lg-12 --> + </div> + </div> + </div> + <!-- /.col-lg-12 --> - <div class="col-md-4"> - <div class="panel panel-default" id="panel-contact"> - <div class="panel-heading">Contact</div> - <div class="panel-body"> - <img class="gravatar pull-right" src="https://www.gravatar.com/avatar/<?=md5('info@camilstaps.nl')?>?d=mm"/> - <p>For things related to BusinessAdmin, please use GitHub: <a href="https://github.com/camilstaps/BusinessAdmin">camilstaps/BusinessAdmin</a></p> - <p>The BusinessAdmin system was developed by <a href="http://camilstaps.nl/">Camil Staps</a>. See my website for contact details.</p> - </div> - </div> - </div> + <div class="col-md-4"> + <div class="panel panel-default" id="panel-contact"> + <div class="panel-heading">Contact</div> + <div class="panel-body"> + <img class="gravatar pull-right" src="https://www.gravatar.com/avatar/<?=md5('info@camilstaps.nl')?>?d=mm"/> + <p>For things related to BusinessAdmin, please use GitHub: <a href="https://github.com/camilstaps/BusinessAdmin">camilstaps/BusinessAdmin</a></p> + <p>The BusinessAdmin system was developed by <a href="http://camilstaps.nl/">Camil Staps</a>. See my website for contact details.</p> + </div> + </div> + </div> - <div class="col-md-4"> - <div class="panel panel-default" id="panel-contact"> - <div class="panel-heading">Thanks</div> - <div class="panel-body"> - <p>BusinessAdmin was created using:</p> - <ul> - <li><a href="http://startbootstrap.com/template-overviews/sb-admin-2/">SB Admin 2</a></li> - <li><a href="http://getbootstrap.com">Bootstrap 3.2.0</a></li> - <li><a href="http://jquery.org/">jQuery 1.11.0</a></li> - <li><a href="http://fontawesome.io/">Font Awesome 4.3.0</a></li> - <li><a href="http://font.ubuntu.com/">Ubuntu fonts</a></li> - <li>And various jQuery plugins</li> - </ul> - <p>Many thanks go to the creators and developers of these software packages.</p> - </div> - </div> - </div> - </div> - <!-- /.row --> - </div> - <!-- /#page-wrapper --> + <div class="col-md-4"> + <div class="panel panel-default" id="panel-contact"> + <div class="panel-heading">Thanks</div> + <div class="panel-body"> + <p>BusinessAdmin was created using:</p> + <ul> + <li><a href="http://startbootstrap.com/template-overviews/sb-admin-2/">SB Admin 2</a></li> + <li><a href="http://getbootstrap.com">Bootstrap 3.2.0</a></li> + <li><a href="http://jquery.org/">jQuery 1.11.0</a></li> + <li><a href="http://fontawesome.io/">Font Awesome 4.3.0</a></li> + <li><a href="http://font.ubuntu.com/">Ubuntu fonts</a></li> + <li>And various jQuery plugins</li> + </ul> + <p>Many thanks go to the creators and developers of these software packages.</p> + </div> + </div> + </div> + </div> + <!-- /.row --> + </div> + <!-- /#page-wrapper --> </div> <!-- /#wrapper --> diff --git a/include/ajax-collapse.php b/include/ajax-collapse.php index e49c6fd..402d057 100644 --- a/include/ajax-collapse.php +++ b/include/ajax-collapse.php @@ -1,8 +1,8 @@ <?php $collapsed = true; if ($_REQUEST['setting'] !== 'true') - $collapsed = false; + $collapsed = false; $_SESSION['ba-collapse'] = $collapsed; -echo $collapsed;
\ No newline at end of file +echo $collapsed; diff --git a/include/assignments-edit.php b/include/assignments-edit.php index b52311a..7c63680 100644 --- a/include/assignments-edit.php +++ b/include/assignments-edit.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/>. */ diff --git a/include/assignments-new.php b/include/assignments-new.php index 7898a42..405c5fa 100644 --- a/include/assignments-new.php +++ b/include/assignments-new.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/>. */ diff --git a/include/assignments-overview.php b/include/assignments-overview.php index ee46928..0e364d1 100644 --- a/include/assignments-overview.php +++ b/include/assignments-overview.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/>. */ @@ -21,151 +21,151 @@ require_once('./login.php'); ?> <div class="col-lg-12"> - <div class="panel panel-default"> - <div class="panel-heading">Overview</div> - <div class="panel-body table-responsive"> - <table class="table table-bordered table-striped mixitup dataTable" id="overview-assignments"> - <thead> - <tr> - <th class="mixitup-sort sorting" data-sort="mixerOrderId:desc">#</th> - <th class="mixitup-sort sorting" data-sort="mixerOrderOffer:desc">Offer</th> - <th>Briefing</th> - <th class="mixitup-sort sorting" data-sort="mixerOrderTime:desc">Time</th> - <th class="mixitup-sort sorting" data-sort="mixerOrderPrice:desc">Price</th> - <th>Tools</th> - </tr> - </thead> - <tbody> - <?php - $assignments = BusinessAdmin::getAssignments($_pdo); - foreach ($assignments as $assignment) { - echo "<tr class='mix' - data-mixer-order-id='{$assignment->getId()}' - data-mixer-order-offer='{$assignment->getOffer()->getId()}' - data-mixer-order-time='{$assignment->getHours()}' - data-mixer-order-price='{$assignment->getPricePerHour()}'> - <td class='col-min-width'>{$assignment->getId()}</td> - <td class='col-min-width'> - <a href='".constants::url_internal."/offers?id={$assignment->getOffer()->getId()}'>#{$assignment->getOffer()->getId()}</a> to - <a href='".constants::url_internal."/contacts?id={$assignment->getOffer()->getContact()->getId()}'>{$assignment->getOffer()->getContact()->getName()}</a> - (<a href='".constants::url_internal."/clients?id={$assignment->getOffer()->getContact()->getClient()->id}'>{$assignment->getOffer()->getContact()->getClient()->name}</a>) - <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><a href='#' class='editable editable-noshow' id='editable-assignment-{$assignment->getId()}-description' data-type='textarea' data-mode='inline' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getDescription(false)}</a></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='?id={$assignment->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> - <a title='Delete' href='?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">Overview</div> + <div class="panel-body table-responsive"> + <table class="table table-bordered table-striped mixitup dataTable" id="overview-assignments"> + <thead> + <tr> + <th class="mixitup-sort sorting" data-sort="mixerOrderId:desc">#</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderOffer:desc">Offer</th> + <th>Briefing</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderTime:desc">Time</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderPrice:desc">Price</th> + <th>Tools</th> + </tr> + </thead> + <tbody> + <?php + $assignments = BusinessAdmin::getAssignments($_pdo); + foreach ($assignments as $assignment) { + echo "<tr class='mix' + data-mixer-order-id='{$assignment->getId()}' + data-mixer-order-offer='{$assignment->getOffer()->getId()}' + data-mixer-order-time='{$assignment->getHours()}' + data-mixer-order-price='{$assignment->getPricePerHour()}'> + <td class='col-min-width'>{$assignment->getId()}</td> + <td class='col-min-width'> + <a href='".constants::url_internal."/offers?id={$assignment->getOffer()->getId()}'>#{$assignment->getOffer()->getId()}</a> to + <a href='".constants::url_internal."/contacts?id={$assignment->getOffer()->getContact()->getId()}'>{$assignment->getOffer()->getContact()->getName()}</a> + (<a href='".constants::url_internal."/clients?id={$assignment->getOffer()->getContact()->getClient()->id}'>{$assignment->getOffer()->getContact()->getClient()->name}</a>) + <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><a href='#' class='editable editable-noshow' id='editable-assignment-{$assignment->getId()}-description' data-type='textarea' data-mode='inline' data-pk='{$assignment->getId()}' data-url='".constants::url_external."assignments/edit'>{$assignment->getDescription(false)}</a></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='?id={$assignment->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> + <a title='Delete' href='?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-12"> - <div class="panel panel-default"> - <div class="panel-heading">Create new</div> - <div class="panel-body"> - <form role="form" id="newAssignment" action='<?=constants::url_external?>assignments/new' method="post" class="bootstrapValidator ajaxify" - data-ajaxify-options='{"success":"newAssignmentSuccess","error":"newAssignmentError","beforeSubmit":"newAssignmentBeforeSubmit"}'> - <div class="ajaxify-response alert alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><span class="ajaxify-response-text"></span></div> - <div class="col-lg-6"> - <div class="form-group"> - <label>Offer:</label> - <select name="offerId" class="form-control"> - <?php - foreach (BusinessAdmin::getOffers($_pdo) as $offer) { - echo "<option value='{$offer->getId()}'>#{$offer->getId()} to {$offer->getContact()->getName()} ({$offer->getContact()->getClient()->name})</option>"; - } - ?> - </select> - </div> - <div class="form-group"> - <label>Title:</label> - <input - type="text" name="title" class="form-control" placeholder="Title" - data-bv-notempty="true" data-bv-notempty-message="You have to provide a title"/> - </div> - <div class="form-group"> - <label>Description:</label> - <textarea - name="description" class="form-control" placeholder="Description" rows="4" - data-bv-notempty="true" data-bv-notempty-message="You have to provide a description" - data-bv-stringlength="true" data-bv-stringlength-message="The description should at most 1000 characters" data-bv-stringlength-max="1000"></textarea> - </div> - </div> - <div class="col-lg-6"> - <div class="form-group"> - <label>Estimated time (h):</label> - <input - type="text" name="hours" class="form-control" placeholder="Time in hours" - data-bv-notempty="true" data-bv-notempty-message="You have to give an estimation" - data-bv-integer="true" data-bv-integer-message="Please enter an integer" /> - </div> - <div class="form-group"> - <label>Price per hour (<?=constants::invoice_valuta?>):</label> - <input - type="text" name="price_per_hour" class="form-control" placeholder="Price per hour" - data-bv-notempty="true" data-bv-notempty-message="You have to give a rate" - data-bv-numeric="true" data-bv-numeric-message="Please enter a number (with a '.' as decimal separator)" /> - </div> - <div class="form-group"> - <label>VAT (%):</label> - <input - type="text" name="vat" class="form-control" placeholder="VAT" - data-bv-notempty="true" data-bv-notempty-message="You have to provide a VAT percentage" - data-bv-numeric="true" data-bv-numeric-message="Please enter a number (with a '.' as decimal separator)" /> - </div> - </div> - <div class="col-lg-6"> - <button type="submit" class="btn btn-default">Go</button> - </div> - </form> - <script type="text/javascript"> - // Callback for before the form is submitted - function newAssignmentBeforeSubmit() { - $('#newAssignment input').prop('disabled', true); - $('#newAssignment .ajaxify-response').hide().removeClass('alert-success alert-danger').find('.ajaxify-response-text').html(''); - } + <div class="panel panel-default"> + <div class="panel-heading">Create new</div> + <div class="panel-body"> + <form role="form" id="newAssignment" action='<?=constants::url_external?>assignments/new' method="post" class="bootstrapValidator ajaxify" + data-ajaxify-options='{"success":"newAssignmentSuccess","error":"newAssignmentError","beforeSubmit":"newAssignmentBeforeSubmit"}'> + <div class="ajaxify-response alert alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><span class="ajaxify-response-text"></span></div> + <div class="col-lg-6"> + <div class="form-group"> + <label>Offer:</label> + <select name="offerId" class="form-control"> + <?php + foreach (BusinessAdmin::getOffers($_pdo) as $offer) { + echo "<option value='{$offer->getId()}'>#{$offer->getId()} to {$offer->getContact()->getName()} ({$offer->getContact()->getClient()->name})</option>"; + } + ?> + </select> + </div> + <div class="form-group"> + <label>Title:</label> + <input + type="text" name="title" class="form-control" placeholder="Title" + data-bv-notempty="true" data-bv-notempty-message="You have to provide a title"/> + </div> + <div class="form-group"> + <label>Description:</label> + <textarea + name="description" class="form-control" placeholder="Description" rows="4" + data-bv-notempty="true" data-bv-notempty-message="You have to provide a description" + data-bv-stringlength="true" data-bv-stringlength-message="The description should at most 1000 characters" data-bv-stringlength-max="1000"></textarea> + </div> + </div> + <div class="col-lg-6"> + <div class="form-group"> + <label>Estimated time (h):</label> + <input + type="text" name="hours" class="form-control" placeholder="Time in hours" + data-bv-notempty="true" data-bv-notempty-message="You have to give an estimation" + data-bv-integer="true" data-bv-integer-message="Please enter an integer" /> + </div> + <div class="form-group"> + <label>Price per hour (<?=constants::invoice_valuta?>):</label> + <input + type="text" name="price_per_hour" class="form-control" placeholder="Price per hour" + data-bv-notempty="true" data-bv-notempty-message="You have to give a rate" + data-bv-numeric="true" data-bv-numeric-message="Please enter a number (with a '.' as decimal separator)" /> + </div> + <div class="form-group"> + <label>VAT (%):</label> + <input + type="text" name="vat" class="form-control" placeholder="VAT" + data-bv-notempty="true" data-bv-notempty-message="You have to provide a VAT percentage" + data-bv-numeric="true" data-bv-numeric-message="Please enter a number (with a '.' as decimal separator)" /> + </div> + </div> + <div class="col-lg-6"> + <button type="submit" class="btn btn-default">Go</button> + </div> + </form> + <script type="text/javascript"> + // Callback for before the form is submitted + function newAssignmentBeforeSubmit() { + $('#newAssignment input').prop('disabled', true); + $('#newAssignment .ajaxify-response').hide().removeClass('alert-success alert-danger').find('.ajaxify-response-text').html(''); + } - // Callback for when the form is successfully submitted - function newAssignmentSuccess(data) { - $('#newAssignment .ajaxify-response') - .addClass(data.success ? 'alert-success' : 'alert-danger') - .show() - .find('.ajaxify-response-text') - .html(data.message); + // Callback for when the form is successfully submitted + function newAssignmentSuccess(data) { + $('#newAssignment .ajaxify-response') + .addClass(data.success ? 'alert-success' : 'alert-danger') + .show() + .find('.ajaxify-response-text') + .html(data.message); - $('#newAssignment input, #newAssignment button').prop('disabled', false); - $('#newAssignment').data('bootstrapValidator').resetForm(); - if (data.success) { - $('#newAssignment input, #newAssignment textarea').val(''); - } - } + $('#newAssignment input, #newAssignment button').prop('disabled', false); + $('#newAssignment').data('bootstrapValidator').resetForm(); + if (data.success) { + $('#newAssignment input, #newAssignment textarea').val(''); + } + } - // Callback for when form submission encountered an error - function newAssignmentError() { - $('#newAssignment .ajaxify-response') - .addClass('alert-danger') - .show() - .find('.ajaxify-response-text') - .html('An unknown error occurred. Please contact support.'); + // Callback for when form submission encountered an error + function newAssignmentError() { + $('#newAssignment .ajaxify-response') + .addClass('alert-danger') + .show() + .find('.ajaxify-response-text') + .html('An unknown error occurred. Please contact support.'); - $('#newAssignment input, #newAssignment button').prop('disabled', false); - $('#newAssignment').data('bootstrapValidator').resetForm(); - } - </script> - </div> - </div> + $('#newAssignment input, #newAssignment button').prop('disabled', false); + $('#newAssignment').data('bootstrapValidator').resetForm(); + } + </script> + </div> + </div> </div> diff --git a/include/assignments-view.php b/include/assignments-view.php index f2717b0..0bac039 100644 --- a/include/assignments-view.php +++ b/include/assignments-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/>. */ @@ -36,8 +36,8 @@ $_assignment = new assignment($_pdo, $_id); </thead> <tbody> <?php - echo "<tr class='mix' - data-mixer-order-id='{$_assignment->getId()}' + echo "<tr class='mix' + data-mixer-order-id='{$_assignment->getId()}' data-mixer-order-offer='{$_assignment->getOffer()->getId()}' data-mixer-order-time='{$_assignment->getHours()}' data-mixer-order-price='{$_assignment->getPricePerHour()}'> diff --git a/include/assignments.php b/include/assignments.php index eaa7163..14ed8da 100644 --- a/include/assignments.php +++ b/include/assignments.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/>. */ diff --git a/include/clients-edit.php b/include/clients-edit.php index 7d8d6fa..3d92d06 100644 --- a/include/clients-edit.php +++ b/include/clients-edit.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/>. */ diff --git a/include/clients-new.php b/include/clients-new.php index e87557e..fe66026 100644 --- a/include/clients-new.php +++ b/include/clients-new.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/>. */ diff --git a/include/clients-overview.php b/include/clients-overview.php index 58fad49..860e671 100644 --- a/include/clients-overview.php +++ b/include/clients-overview.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/>. */ @@ -21,102 +21,102 @@ require_once('./login.php'); ?> <div class="col-lg-6 col-md-6"> - <div class="panel panel-default"> - <div class="panel-heading">Overview</div> - <div class="panel-body table-responsive"> - <table class="table table-bordered table-striped mixitup dataTable" id="overview-clients"> - <thead> - <tr> - <th class="mixitup-sort sorting" data-sort="mixerOrderId:desc">#</th> - <th class="mixitup-sort sorting" data-sort="mixerOrderName:desc">Name</th> - <th>Tools</th> - </tr> - </thead> - <tbody> - <?php - $clients = BusinessAdmin::getClients($_pdo); - foreach ($clients as $client) { - echo "<tr class='mix' - data-mixer-order-id='{$client->id}' - data-mixer-order-name='{$client->name}'> - <td class='col-min-width'>{$client->id}</td> - <td class='col-max-width'> - <a href='#' class='editable' id='editable-client-{$client->id}-name' data-type='text' data-pk='{$client->id}' data-url='".constants::url_external."clients/edit' data-title='Enter new name'> - {$client->name} - </a> - </td> - <td class='col-min-width'> - <a title='View' href='?id={$client->id}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> - <a title='Delete' href='?delete={$client->id}' class='btn btn-danger btn-circle fa fa-times'></a> - </td> - </tr>"; - } - if (count($clients) == 0) { - echo "<tr><td colspan='3'>There are no clients in the database. Why not start with creating one, on the right?</td></tr>"; - } - ?> - </tbody> - </table> - </div> - </div> + <div class="panel panel-default"> + <div class="panel-heading">Overview</div> + <div class="panel-body table-responsive"> + <table class="table table-bordered table-striped mixitup dataTable" id="overview-clients"> + <thead> + <tr> + <th class="mixitup-sort sorting" data-sort="mixerOrderId:desc">#</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderName:desc">Name</th> + <th>Tools</th> + </tr> + </thead> + <tbody> + <?php + $clients = BusinessAdmin::getClients($_pdo); + foreach ($clients as $client) { + echo "<tr class='mix' + data-mixer-order-id='{$client->id}' + data-mixer-order-name='{$client->name}'> + <td class='col-min-width'>{$client->id}</td> + <td class='col-max-width'> + <a href='#' class='editable' id='editable-client-{$client->id}-name' data-type='text' data-pk='{$client->id}' data-url='".constants::url_external."clients/edit' data-title='Enter new name'> + {$client->name} + </a> + </td> + <td class='col-min-width'> + <a title='View' href='?id={$client->id}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> + <a title='Delete' href='?delete={$client->id}' class='btn btn-danger btn-circle fa fa-times'></a> + </td> + </tr>"; + } + if (count($clients) == 0) { + echo "<tr><td colspan='3'>There are no clients in the database. Why not start with creating one, on the right?</td></tr>"; + } + ?> + </tbody> + </table> + </div> + </div> </div> <div class="col-lg-6 col-md-6"> - <div class="panel panel-default"> - <div class="panel-heading">Create new</div> - <div class="panel-body"> - <form role="form" id="newClient" action='<?=constants::url_external?>clients/new' method="post" class="bootstrapValidator ajaxify" - data-ajaxify-options='{"success":"newClientSuccess","error":"newClientError","beforeSubmit":"newClientBeforeSubmit","clearForm":true}'> - <div class="ajaxify-response alert alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><span class="ajaxify-response-text"></span></div> - <div class="form-group"> - <label>Name:</label> - <input - type="text" name="name" class="form-control" placeholder="Name" - data-bv-notempty="true" data-bv-notempty-message="You have to provide a name"/> - </div> - <button type="submit" class="btn btn-default">Go</button> - </form> - <script type="text/javascript"> - // Callback for before the form is submitted - function newClientBeforeSubmit() { - $('#newClient input').prop('disabled', true); - $('#newClient .ajaxify-response').hide().removeClass('alert-success alert-danger').find('.ajaxify-response-text').html(''); - } + <div class="panel panel-default"> + <div class="panel-heading">Create new</div> + <div class="panel-body"> + <form role="form" id="newClient" action='<?=constants::url_external?>clients/new' method="post" class="bootstrapValidator ajaxify" + data-ajaxify-options='{"success":"newClientSuccess","error":"newClientError","beforeSubmit":"newClientBeforeSubmit","clearForm":true}'> + <div class="ajaxify-response alert alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><span class="ajaxify-response-text"></span></div> + <div class="form-group"> + <label>Name:</label> + <input + type="text" name="name" class="form-control" placeholder="Name" + data-bv-notempty="true" data-bv-notempty-message="You have to provide a name"/> + </div> + <button type="submit" class="btn btn-default">Go</button> + </form> + <script type="text/javascript"> + // Callback for before the form is submitted + function newClientBeforeSubmit() { + $('#newClient input').prop('disabled', true); + $('#newClient .ajaxify-response').hide().removeClass('alert-success alert-danger').find('.ajaxify-response-text').html(''); + } - // Callback for when the form is successfully submitted - function newClientSuccess(data) { - if (data.success == true) { - $('#newClient .ajaxify-response') - .addClass('alert-success') - .show() - .find('.ajaxify-response-text') - .html(data.message); + // Callback for when the form is successfully submitted + function newClientSuccess(data) { + if (data.success == true) { + $('#newClient .ajaxify-response') + .addClass('alert-success') + .show() + .find('.ajaxify-response-text') + .html(data.message); - $('#newClient input, #newClient button').prop('disabled', false); - $('#newClient').data('bootstrapValidator').resetForm(); - } else { - $('#newClient .ajaxify-response') - .addClass('alert-danger') - .show() - .find('.ajaxify-response-text') - .html(data.message); + $('#newClient input, #newClient button').prop('disabled', false); + $('#newClient').data('bootstrapValidator').resetForm(); + } else { + $('#newClient .ajaxify-response') + .addClass('alert-danger') + .show() + .find('.ajaxify-response-text') + .html(data.message); - $('#newClient input, #newClient button').prop('disabled', false); - $('#newClient').data('bootstrapValidator').resetForm(); - } - } + $('#newClient input, #newClient button').prop('disabled', false); + $('#newClient').data('bootstrapValidator').resetForm(); + } + } - // Callback for when form submission encountered an error - function newClientError() { - $('#newClient .ajaxify-response') - .addClass('alert-danger') - .show() - .find('.ajaxify-response-text') - .html('An unknown error occurred. Please contact support.'); - - $('#newClient input, #newClient button').prop('disabled', false); - $('#newClient').data('bootstrapValidator').resetForm(); - } - </script> - </div> - </div> + // Callback for when form submission encountered an error + function newClientError() { + $('#newClient .ajaxify-response') + .addClass('alert-danger') + .show() + .find('.ajaxify-response-text') + .html('An unknown error occurred. Please contact support.'); + + $('#newClient input, #newClient button').prop('disabled', false); + $('#newClient').data('bootstrapValidator').resetForm(); + } + </script> + </div> + </div> </div> diff --git a/include/clients-view.php b/include/clients-view.php index 514e4e4..007d94c 100644 --- a/include/clients-view.php +++ b/include/clients-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/>. */ diff --git a/include/clients.php b/include/clients.php index b07a7c8..f762859 100644 --- a/include/clients.php +++ b/include/clients.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/>. */ diff --git a/include/contacts-edit.php b/include/contacts-edit.php index a5b3bdd..ac924a9 100644 --- a/include/contacts-edit.php +++ b/include/contacts-edit.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/>. */ diff --git a/include/contacts-new.php b/include/contacts-new.php index 0a72afb..440e744 100644 --- a/include/contacts-new.php +++ b/include/contacts-new.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/>. */ diff --git a/include/contacts.php b/include/contacts.php index 4b35603..09a452f 100644 --- a/include/contacts.php +++ b/include/contacts.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/>. */ diff --git a/include/discounts-edit.php b/include/discounts-edit.php index a760e9c..2d64bd9 100644 --- a/include/discounts-edit.php +++ b/include/discounts-edit.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/>. */ diff --git a/include/discounts-new.php b/include/discounts-new.php index 8a5f527..b0cfa07 100644 --- a/include/discounts-new.php +++ b/include/discounts-new.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/>. */ diff --git a/include/discounts-overview.php b/include/discounts-overview.php index d4d8245..1bf55d6 100644 --- a/include/discounts-overview.php +++ b/include/discounts-overview.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/>. */ @@ -39,7 +39,7 @@ require_once('./login.php'); $discounts = BusinessAdmin::getDiscounts($_pdo); foreach ($discounts as $discount) { echo "<tr class='mix' - data-mixer-order-id='{$discount->getId()}' + data-mixer-order-id='{$discount->getId()}' data-mixer-order-offer='{$discount->getOffer()->getId()}' data-mixer-order-value='{$discount->getValue()}'> <td class='col-min-width'>{$discount->getId()}</td> @@ -56,7 +56,7 @@ require_once('./login.php'); <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='?id={$discount->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> + <a title='View' href='?id={$discount->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> <a title='Delete' href='?delete={$discount->getId()}' class='btn btn-danger btn-circle fa fa-times'></a> </td> </tr>"; @@ -74,7 +74,7 @@ require_once('./login.php'); <div class="panel panel-default"> <div class="panel-heading">Create new</div> <div class="panel-body"> - <form role="form" id="newDiscount" action='<?=constants::url_external?>discounts/new' method="post" class="bootstrapValidator ajaxify" + <form role="form" id="newDiscount" action='<?=constants::url_external?>discounts/new' method="post" class="bootstrapValidator ajaxify" data-ajaxify-options='{"success":"newDiscountSuccess","error":"newDiscountError","beforeSubmit":"newDiscountBeforeSubmit"}'> <div class="ajaxify-response alert alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><span class="ajaxify-response-text"></span></div> <div class="col-lg-6"> @@ -90,30 +90,30 @@ require_once('./login.php'); </div> <div class="form-group"> <label>Title:</label> - <input - type="text" name="title" class="form-control" placeholder="Title" + <input + type="text" name="title" class="form-control" placeholder="Title" data-bv-notempty="true" data-bv-notempty-message="You have to provide a title"/> </div> <div class="form-group"> <label>Description:</label> - <textarea + <textarea name="description" class="form-control" placeholder="Description" rows="4" - data-bv-notempty="true" data-bv-notempty-message="You have to provide a description" + data-bv-notempty="true" data-bv-notempty-message="You have to provide a description" data-bv-stringlength="true" data-bv-stringlength-message="The description should have at most 1000 characters" data-bv-stringlength-max="1000"></textarea> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label>Value (<?=constants::invoice_valuta?>):</label> - <input - type="text" name="value" class="form-control" placeholder="Value" + <input + type="text" name="value" class="form-control" placeholder="Value" data-bv-notempty="true" data-bv-notempty-message="You have to give a value" data-bv-numeric="true" data-bv-numeric-message="Please enter a number (with a '.' as decimal separator)" /> </div> <div class="form-group"> <label>VAT (%):</label> - <input - type="text" name="vat" class="form-control" placeholder="VAT" + <input + type="text" name="vat" class="form-control" placeholder="VAT" data-bv-notempty="true" data-bv-notempty-message="You have to provide a VAT percentage" data-bv-numeric="true" data-bv-numeric-message="Please enter a number (with a '.' as decimal separator)" /> </div> diff --git a/include/discounts.php b/include/discounts.php index 8b160ab..ff2a69a 100644 --- a/include/discounts.php +++ b/include/discounts.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/>. */ diff --git a/include/home.php b/include/home.php index a9dca1e..6a25743 100644 --- a/include/home.php +++ b/include/home.php @@ -279,7 +279,7 @@ require('./header.php'); $sort_list = array(); foreach ($offers as $offer) { $temp = array( - 'id' => $offer->getId(), + 'id' => $offer->getId(), 'contact' => $offer->getContact()->getName(), 'assignments' => '', 'assignments_header' => '' diff --git a/include/offers-edit.php b/include/offers-edit.php index 225a18c..7f050c3 100644 --- a/include/offers-edit.php +++ b/include/offers-edit.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/>. */ diff --git a/include/offers-new.php b/include/offers-new.php index 0d86293..9c499a8 100644 --- a/include/offers-new.php +++ b/include/offers-new.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/>. */ diff --git a/include/offers-overview.php b/include/offers-overview.php index a246190..9eaf25d 100644 --- a/include/offers-overview.php +++ b/include/offers-overview.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/>. */ @@ -112,7 +112,7 @@ require_once('./login.php'); <div class="panel panel-default"> <div class="panel-heading">Create new</div> <div class="panel-body"> - <form role="form" id="newOffer" action='<?=constants::url_external?>offers/new' method="post" class="bootstrapValidator ajaxify" + <form role="form" id="newOffer" action='<?=constants::url_external?>offers/new' method="post" class="bootstrapValidator ajaxify" data-ajaxify-options='{"success":"newOfferSuccess","error":"newOfferError","beforeSubmit":"newOfferBeforeSubmit"}'> <div class="ajaxify-response alert alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><span class="ajaxify-response-text"></span></div> <div class="form-group"> 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> diff --git a/include/offers.php b/include/offers.php index 1aa871a..81781ba 100644 --- a/include/offers.php +++ b/include/offers.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/>. */ diff --git a/include/users-new.php b/include/users-new.php index 5d86a83..d32e201 100644 --- a/include/users-new.php +++ b/include/users-new.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/>. */ |