diff options
author | Camil Staps | 2016-07-27 16:48:53 +0200 |
---|---|---|
committer | Camil Staps | 2016-07-27 17:08:12 +0200 |
commit | 21455bfd1004c4a3153050ac5995b8dc680c2042 (patch) | |
tree | b448f9d94cd9b6addb6d6b391001c418243cc13d /include | |
parent | Removed error reporting (diff) |
Class names start with a capital
Diffstat (limited to 'include')
-rw-r--r-- | include/about.php | 4 | ||||
-rw-r--r-- | include/assignments-edit.php | 4 | ||||
-rw-r--r-- | include/assignments-new.php | 4 | ||||
-rw-r--r-- | include/assignments-overview.php | 20 | ||||
-rw-r--r-- | include/assignments-view.php | 14 | ||||
-rw-r--r-- | include/assignments.php | 6 | ||||
-rw-r--r-- | include/clients-edit.php | 4 | ||||
-rw-r--r-- | include/clients-new.php | 2 | ||||
-rw-r--r-- | include/clients-overview.php | 4 | ||||
-rw-r--r-- | include/clients-view.php | 20 | ||||
-rw-r--r-- | include/clients.php | 6 | ||||
-rw-r--r-- | include/contacts-edit.php | 4 | ||||
-rw-r--r-- | include/contacts-new.php | 4 | ||||
-rw-r--r-- | include/contacts-overview.php | 18 | ||||
-rw-r--r-- | include/contacts.php | 6 | ||||
-rw-r--r-- | include/discounts-edit.php | 4 | ||||
-rw-r--r-- | include/discounts-new.php | 4 | ||||
-rw-r--r-- | include/discounts-overview.php | 18 | ||||
-rw-r--r-- | include/discounts.php | 6 | ||||
-rw-r--r-- | include/home.php | 16 | ||||
-rw-r--r-- | include/offers-edit.php | 4 | ||||
-rw-r--r-- | include/offers-new.php | 4 | ||||
-rw-r--r-- | include/offers-overview.php | 20 | ||||
-rw-r--r-- | include/offers-view.php | 28 | ||||
-rw-r--r-- | include/offers.php | 12 | ||||
-rw-r--r-- | include/settings.php | 4 | ||||
-rw-r--r-- | include/users-new.php | 2 |
27 files changed, 121 insertions, 121 deletions
diff --git a/include/about.php b/include/about.php index e7ab3d4..c2eb179 100644 --- a/include/about.php +++ b/include/about.php @@ -40,8 +40,8 @@ require('./header.php'); <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> + <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) diff --git a/include/assignments-edit.php b/include/assignments-edit.php index 7c63680..d2f5a6c 100644 --- a/include/assignments-edit.php +++ b/include/assignments-edit.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $assignment = new assignment($_pdo, $_REQUEST['pk']); + $assignment = new Assignment($_pdo, $_REQUEST['pk']); $name = explode('-', $_REQUEST['name']); $what_to_edit = $name[count($name) - 1]; diff --git a/include/assignments-new.php b/include/assignments-new.php index 405c5fa..bcc545a 100644 --- a/include/assignments-new.php +++ b/include/assignments-new.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $offer = new offer($_pdo, $_REQUEST['offerId']); + $offer = new Offer($_pdo, $_REQUEST['offerId']); $assignment = $offer->createAssignment( $_REQUEST['title'], diff --git a/include/assignments-overview.php b/include/assignments-overview.php index 0e364d1..d4b350e 100644 --- a/include/assignments-overview.php +++ b/include/assignments-overview.php @@ -46,17 +46,17 @@ require_once('./login.php'); 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>) + <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> + <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'><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 + ".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> @@ -77,7 +77,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="newAssignment" action='<?=constants::url_external?>assignments/new' method="post" class="bootstrapValidator ajaxify" + <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"> @@ -114,7 +114,7 @@ require_once('./login.php'); 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> + <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" diff --git a/include/assignments-view.php b/include/assignments-view.php index 0bac039..d0a4ff3 100644 --- a/include/assignments-view.php +++ b/include/assignments-view.php @@ -19,7 +19,7 @@ require_once('./login.php'); -$_assignment = new assignment($_pdo, $_id); +$_assignment = new Assignment($_pdo, $_id); ?> <div class="col-lg-6"> <div class="panel panel-default"> @@ -43,14 +43,14 @@ $_assignment = new assignment($_pdo, $_id); 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>) + <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> - <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'><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 + ".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> </tr>"; ?> diff --git a/include/assignments.php b/include/assignments.php index 14ed8da..7c3c79d 100644 --- a/include/assignments.php +++ b/include/assignments.php @@ -45,8 +45,8 @@ require('./header.php'); if (isset($_GET['id'])) { $id = (int) $_GET['id']; try { - $assignment = new assignment($_pdo, $id); - $header = "<a href='".constants::url_external."assignments'>Assignments</a> / {$assignment->getTitle()}"; + $assignment = new Assignment($_pdo, $id); + $header = "<a href='".Constants::url_external."assignments'>Assignments</a> / {$assignment->getTitle()}"; $show_individual = $id; } catch (PDOException $e) { $alert = "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The assignment with id $id</i> could not be found.</div>"; @@ -64,7 +64,7 @@ require('./header.php'); echo "<div class='col-lg-12'>"; $id = (int) $_GET['delete']; try { - $assignment = new assignment($_pdo, $id); + $assignment = new Assignment($_pdo, $id); if ($assignment->delete()) { echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The assignment with title <i>{$assignment->getTitle()}</i> has been removed.</div>"; } else { diff --git a/include/clients-edit.php b/include/clients-edit.php index 3d92d06..00961aa 100644 --- a/include/clients-edit.php +++ b/include/clients-edit.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $client = new client($_pdo, $_REQUEST['pk']); + $client = new Client($_pdo, $_REQUEST['pk']); if ($client->setName($_REQUEST['value'])) { $response->success = true; } else { diff --git a/include/clients-new.php b/include/clients-new.php index fe66026..d1cf503 100644 --- a/include/clients-new.php +++ b/include/clients-new.php @@ -20,7 +20,7 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { $client = BusinessAdmin::createClient($_pdo, $_REQUEST['name']); diff --git a/include/clients-overview.php b/include/clients-overview.php index 860e671..cdced81 100644 --- a/include/clients-overview.php +++ b/include/clients-overview.php @@ -41,7 +41,7 @@ require_once('./login.php'); 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'> + <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> @@ -64,7 +64,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="newClient" action='<?=constants::url_external?>clients/new' method="post" class="bootstrapValidator ajaxify" + <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"> diff --git a/include/clients-view.php b/include/clients-view.php index 007d94c..2472a80 100644 --- a/include/clients-view.php +++ b/include/clients-view.php @@ -19,7 +19,7 @@ require_once('./login.php'); -$_client = new client($_pdo, $_id); +$_client = new Client($_pdo, $_id); ?> <div class="col-lg-12"> <div class="panel panel-default"> @@ -41,22 +41,22 @@ $_client = new client($_pdo, $_id); 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-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> + <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 href='#' class='editable' id='editable-contact-{$contact->getId()}-language' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getLanguage()}</a></td> + <td class='col-min-width'><a href='#' class='editable' id='editable-contact-{$contact->getId()}-language' data-type='text' data-pk='{$contact->getId()}' data-url='".Constants::url_external."contacts/edit'>{$contact->getLanguage()}</a></td> <td class='col-min-width'> - <a title='View' href='".constants::url_internal."/contacts?id={$contact->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> - <a title='Delete' href='".constants::url_internal."/contacts?delete={$contact->getId()}' class='btn btn-danger btn-circle fa fa-times'></a> + <a title='View' href='".Constants::url_internal."/contacts?id={$contact->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> + <a title='Delete' href='".Constants::url_internal."/contacts?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>"; + 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> diff --git a/include/clients.php b/include/clients.php index f762859..1e7110b 100644 --- a/include/clients.php +++ b/include/clients.php @@ -45,8 +45,8 @@ require('./header.php'); if (isset($_GET['id'])) { $id = (int) $_GET['id']; try { - $client = new client($_pdo, $id); - $header = "<a href='".constants::url_external."clients'>Clients</a> / {$client->name}"; + $client = new Client($_pdo, $id); + $header = "<a href='".Constants::url_external."clients'>Clients</a> / {$client->name}"; $show_individual = $id; } catch (PDOException $e) { $alert = "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The client with id $id</i> could not be found.</div>"; @@ -64,7 +64,7 @@ require('./header.php'); echo "<div class='col-lg-12'>"; $id = (int) $_GET['delete']; try { - $client = new client($_pdo, $id); + $client = new Client($_pdo, $id); if ($client->delete()) { echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The client with name <i>{$client->name}</i> has been removed.</div>"; } else { diff --git a/include/contacts-edit.php b/include/contacts-edit.php index ac924a9..ead27d9 100644 --- a/include/contacts-edit.php +++ b/include/contacts-edit.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $contact = new contact($_pdo, $_REQUEST['pk']); + $contact = new Contact($_pdo, $_REQUEST['pk']); $name = explode('-', $_REQUEST['name']); $what_to_edit = $name[count($name) - 1]; diff --git a/include/contacts-new.php b/include/contacts-new.php index 440e744..c75298c 100644 --- a/include/contacts-new.php +++ b/include/contacts-new.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $client = new client($_pdo, $_REQUEST['clientId']); + $client = new Client($_pdo, $_REQUEST['clientId']); $contact = $client->createContact( $_REQUEST['name'], diff --git a/include/contacts-overview.php b/include/contacts-overview.php index 9cd71f3..4f2e6cf 100644 --- a/include/contacts-overview.php +++ b/include/contacts-overview.php @@ -43,20 +43,20 @@ require_once('./login.php'); data-mixer-order-name='{$contact->getName()}'> <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><br/> + <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><br/> ({$contact->getClient()->name}) </td> <td class='col-max-width'> - <a href='#' class='editable' id='editable-contact-{$contact->getId()}-email' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getEmail()}</a><br/> + <a href='#' class='editable' id='editable-contact-{$contact->getId()}-email' data-type='text' data-pk='{$contact->getId()}' data-url='".Constants::url_external."contacts/edit'>{$contact->getEmail()}</a><br/> <br/> - <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/> - " . ($contact->getAddress_2() != '' ? "<a href='#' class='editable' id='editable-contact-{$contact->getId()}-address_2' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getAddress_2()}</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> + <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/> + " . ($contact->getAddress_2() != '' ? "<a href='#' class='editable' id='editable-contact-{$contact->getId()}-address_2' data-type='text' data-pk='{$contact->getId()}' data-url='".Constants::url_external."contacts/edit'>{$contact->getAddress_2()}</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 href='#' class='editable' id='editable-contact-{$contact->getId()}-language' data-type='text' data-pk='{$contact->getId()}' data-url='".constants::url_external."contacts/edit'>{$contact->getLanguage()}</a> + <a href='#' class='editable' id='editable-contact-{$contact->getId()}-language' data-type='text' data-pk='{$contact->getId()}' data-url='".Constants::url_external."contacts/edit'>{$contact->getLanguage()}</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> @@ -77,7 +77,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="newContact" action='<?=constants::url_external?>contacts/new' method="post" class="bootstrapValidator ajaxify" + <form role="form" id="newContact" action='<?=Constants::url_external?>contacts/new' method="post" class="bootstrapValidator ajaxify" data-ajaxify-options='{"success":"newContactSuccess","error":"newContactError","beforeSubmit":"newContactBeforeSubmit"}'> <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/contacts.php b/include/contacts.php index 09a452f..1231e24 100644 --- a/include/contacts.php +++ b/include/contacts.php @@ -45,8 +45,8 @@ require('./header.php'); if (isset($_GET['id'])) { $id = (int) $_GET['id']; try { - $contact = new contact($_pdo, $id); - $header = "<a href='".constants::url_external."contacts'>Contacts</a> / {$contact->getName()}"; + $contact = new Contact($_pdo, $id); + $header = "<a href='".Constants::url_external."contacts'>Contacts</a> / {$contact->getName()}"; $show_individual = $id; } catch (PDOException $e) { $alert = "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The contact with id $id</i> could not be found.</div>"; @@ -64,7 +64,7 @@ require('./header.php'); echo "<div class='col-lg-12'>"; $id = (int) $_GET['delete']; try { - $contact = new contact($_pdo, $id); + $contact = new Contact($_pdo, $id); if ($contact->delete()) { echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The contact with name <i>{$contact->getName()}</i> has been removed.</div>"; } else { diff --git a/include/discounts-edit.php b/include/discounts-edit.php index 2d64bd9..797a95b 100644 --- a/include/discounts-edit.php +++ b/include/discounts-edit.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $discount = new discount($_pdo, $_REQUEST['pk']); + $discount = new Discount($_pdo, $_REQUEST['pk']); $name = explode('-', $_REQUEST['name']); $what_to_edit = $name[count($name) - 1]; diff --git a/include/discounts-new.php b/include/discounts-new.php index b0cfa07..26452aa 100644 --- a/include/discounts-new.php +++ b/include/discounts-new.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $offer = new offer($_pdo, $_REQUEST['offerId']); + $offer = new Offer($_pdo, $_REQUEST['offerId']); $discount = $offer->createDiscount( $_REQUEST['title'], diff --git a/include/discounts-overview.php b/include/discounts-overview.php index 1bf55d6..60ddf13 100644 --- a/include/discounts-overview.php +++ b/include/discounts-overview.php @@ -44,16 +44,16 @@ require_once('./login.php'); data-mixer-order-value='{$discount->getValue()}'> <td class='col-min-width'>{$discount->getId()}</td> <td class='col-min-width'> - <a href='".constants::url_internal."/offers?id={$discount->getOffer()->getId()}'>#{$discount->getOffer()->getId()}</a> to - <a href='".constants::url_internal."/contacts?id={$discount->getOffer()->getContact()->getId()}'>{$discount->getOffer()->getContact()->getName()}</a> - (<a href='".constants::url_internal."/clients?id={$discount->getOffer()->getContact()->getClient()->id}'>{$discount->getOffer()->getContact()->getClient()->name}</a>) + <a href='".Constants::url_internal."/offers?id={$discount->getOffer()->getId()}'>#{$discount->getOffer()->getId()}</a> to + <a href='".Constants::url_internal."/contacts?id={$discount->getOffer()->getContact()->getId()}'>{$discount->getOffer()->getContact()->getName()}</a> + (<a href='".Constants::url_internal."/clients?id={$discount->getOffer()->getContact()->getClient()->id}'>{$discount->getOffer()->getContact()->getClient()->name}</a>) <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><a href='#' class='editable editable-noshow' id='editable-discount-{$discount->getId()}-description' data-type='textarea' data-mode='inline' data-pk='{$discount->getId()}' data-url='".constants::url_external."discounts/edit'>{$discount->getDescription(false)}</a></p> + <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><a href='#' class='editable editable-noshow' id='editable-discount-{$discount->getId()}-description' data-type='textarea' data-mode='inline' data-pk='{$discount->getId()}' data-url='".Constants::url_external."discounts/edit'>{$discount->getDescription(false)}</a></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><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 + ".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><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='?id={$discount->getId()}' class='btn btn-primary btn-circle fa fa-arrow-right'></a> @@ -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"> @@ -104,7 +104,7 @@ require_once('./login.php'); </div> <div class="col-lg-6"> <div class="form-group"> - <label>Value (<?=constants::invoice_valuta?>):</label> + <label>Value (<?=Constants::invoice_valuta?>):</label> <input type="text" name="value" class="form-control" placeholder="Value" data-bv-notempty="true" data-bv-notempty-message="You have to give a value" diff --git a/include/discounts.php b/include/discounts.php index ff2a69a..a4d9df6 100644 --- a/include/discounts.php +++ b/include/discounts.php @@ -45,8 +45,8 @@ require('./header.php'); if (isset($_GET['id'])) { $id = (int) $_GET['id']; try { - $discount = new discount($_pdo, $id); - $header = "<a href='".constants::url_external."discounts'>Discounts</a> / {$discount->getTitle()}"; + $discount = new Discount($_pdo, $id); + $header = "<a href='".Constants::url_external."discounts'>Discounts</a> / {$discount->getTitle()}"; $show_individual = $id; } catch (PDOException $e) { $alert = "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The discount with id $id</i> could not be found.</div>"; @@ -64,7 +64,7 @@ require('./header.php'); echo "<div class='col-lg-12'>"; $id = (int) $_GET['delete']; try { - $discount = new discount($_pdo, $id); + $discount = new Discount($_pdo, $id); if ($discount->delete()) { echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The discount with title <i>{$discount->getTitle()}</i> has been removed.</div>"; } else { diff --git a/include/home.php b/include/home.php index 6a25743..a15d2c4 100644 --- a/include/home.php +++ b/include/home.php @@ -51,7 +51,7 @@ require('./header.php'); </div> </div> </div> - <a href="<?=constants::url_external?>offers"> + <a href="<?=Constants::url_external?>offers"> <div class="panel-footer"> <span class="pull-left">Unaccepted offers</span> <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span> @@ -115,7 +115,7 @@ require('./header.php'); $count = count(BusinessAdmin::getOfferIds($_pdo, array( "`invoice_date` > '1970-01-01'", "`invoice_date`<=CURDATE()", - "NOT EXISTS (SELECT * FROM `".constants::db_prefix."payment` WHERE `offerId`=`".constants::db_prefix."offer`.`id`)"))); + "NOT EXISTS (SELECT * FROM `".Constants::db_prefix."payment` WHERE `offerId`=`".Constants::db_prefix."offer`.`id`)"))); ?> <div class="panel panel-<?=($count==0 ? 'primary' : 'yellow')?>"> <div class="panel-heading"> @@ -167,8 +167,8 @@ require('./header.php'); 'id' => $offer->getId(), 'contactClientName' => $offer->getContact()->getClient()->name, 'percentage' => $percentage, - 'price_excl' => constants::invoice_valuta . $offer->calculate(offer::SUBTOTAL), - 'price_incl' => constants::invoice_valuta . $offer->calculate(offer::TOTAL) + 'price_excl' => Constants::invoice_valuta . $offer->calculate(offer::SUBTOTAL), + 'price_incl' => Constants::invoice_valuta . $offer->calculate(offer::TOTAL) ); } krsort($list, SORT_STRING); @@ -242,7 +242,7 @@ require('./header.php'); $offers = BusinessAdmin::getOffers($_pdo, array( "`invoice_date` > '1970-01-01'", "`invoice_date`<=CURDATE()", - "NOT EXISTS (SELECT * FROM `".constants::db_prefix."payment` WHERE `offerId`=`".constants::db_prefix."offer`.`id`)")); + "NOT EXISTS (SELECT * FROM `".Constants::db_prefix."payment` WHERE `offerId`=`".Constants::db_prefix."offer`.`id`)")); if (count($offers) == 0) { echo "<tr><td colspan='3'>There are no currently open invoices.</td></tr>"; } else { @@ -285,8 +285,8 @@ require('./header.php'); '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/>"; + $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; @@ -311,7 +311,7 @@ require('./header.php'); 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-".constants::fa_valuta."'></i></div>"; break; + case 'payment_received': echo "<div class='timeline-badge success' title='{$item['description']}'><i class='fa fa-".Constants::fa_valuta."'></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>"; diff --git a/include/offers-edit.php b/include/offers-edit.php index 7f050c3..3954098 100644 --- a/include/offers-edit.php +++ b/include/offers-edit.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $offer = new offer($_pdo, $_REQUEST['pk']); + $offer = new Offer($_pdo, $_REQUEST['pk']); $name = explode('-', $_REQUEST['name']); $what_to_edit = $name[count($name) - 1]; diff --git a/include/offers-new.php b/include/offers-new.php index 9c499a8..ecd5674 100644 --- a/include/offers-new.php +++ b/include/offers-new.php @@ -20,10 +20,10 @@ require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { - $contact = new contact($_pdo, $_REQUEST['contactId']); + $contact = new Contact($_pdo, $_REQUEST['contactId']); $offer = $contact->createOffer(); $response->success = true; diff --git a/include/offers-overview.php b/include/offers-overview.php index 9eaf25d..9c0a706 100644 --- a/include/offers-overview.php +++ b/include/offers-overview.php @@ -46,29 +46,29 @@ require_once('./login.php'); <td class='col-min-width'><span title='{$offer->getContact()->getClient()->name}'>{$offer->getContact()->getName()}</span></td> <td class='col-max-width'>"; foreach ($offer->getAssignments() as $assignment) { - echo "<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>"; + echo "<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>"; } foreach ($offer->getDiscounts() as $discount) { - echo "<b>{$discount->getTitle()}</b><br/><span class='smaller'>(".constants::invoice_valuta."{$discount->calculate(discount::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$discount->calculate(discount::TOTAL)} incl. VAT)</span><br/><p>{$discount->getDescription()}</p>"; + echo "<b>{$discount->getTitle()}</b><br/><span class='smaller'>(".Constants::invoice_valuta."{$discount->calculate(discount::SUBTOTAL)} excl. VAT, ".Constants::invoice_valuta."{$discount->calculate(discount::TOTAL)} incl. VAT)</span><br/><p>{$discount->getDescription()}</p>"; } echo "</td> <td class='col-min-width'> <table> <tr> <th style='padding-right:1em;'>From:</th> - <td><a href='#' class='editable' id='editable-offer-{$offer->getId()}-start_date' data-type='text' data-pk='{$offer->getId()}' data-url='".constants::url_external."offers/edit'>".BusinessAdmin::formatDate($offer->getStartDate(),false,true)."</a></td> + <td><a href='#' class='editable' id='editable-offer-{$offer->getId()}-start_date' data-type='text' data-pk='{$offer->getId()}' data-url='".Constants::url_external."offers/edit'>".BusinessAdmin::formatDate($offer->getStartDate(),false,true)."</a></td> </tr> <tr> <th style='padding-right:1em;'>To:</th> - <td><a href='#' class='editable' id='editable-offer-{$offer->getId()}-end_date' data-type='text' data-pk='{$offer->getId()}' data-url='".constants::url_external."offers/edit'>".BusinessAdmin::formatDate($offer->getEndDate(),false,true)."</a></td> + <td><a href='#' class='editable' id='editable-offer-{$offer->getId()}-end_date' data-type='text' data-pk='{$offer->getId()}' data-url='".Constants::url_external."offers/edit'>".BusinessAdmin::formatDate($offer->getEndDate(),false,true)."</a></td> </tr> <tr> <th style='padding-right:1em;'>Invoice:</th> - <td><a href='#' class='editable' id='editable-offer-{$offer->getId()}-invoice_date' data-type='text' data-pk='{$offer->getId()}' data-url='".constants::url_external."offers/edit'>".BusinessAdmin::formatDate($offer->getInvoiceDate(),false,true)."</a></td> + <td><a href='#' class='editable' id='editable-offer-{$offer->getId()}-invoice_date' data-type='text' data-pk='{$offer->getId()}' data-url='".Constants::url_external."offers/edit'>".BusinessAdmin::formatDate($offer->getInvoiceDate(),false,true)."</a></td> </tr> <tr> <th style='padding-right:1em;'>Payment received:</th> - <td><a href='#' class='editable' id='editable-offer-{$offer->getId()}-payment_received' data-type='text' data-pk='{$offer->getId()}' data-url='".constants::url_external."offers/edit'>".BusinessAdmin::formatDate($offer->getPaymentReceived(),false,true)."</a></td> + <td><a href='#' class='editable' id='editable-offer-{$offer->getId()}-payment_received' data-type='text' data-pk='{$offer->getId()}' data-url='".Constants::url_external."offers/edit'>".BusinessAdmin::formatDate($offer->getPaymentReceived(),false,true)."</a></td> </tr> </table> </td> @@ -82,15 +82,15 @@ require_once('./login.php'); <table> <tr> <th style='padding-right:1em;'>Subtotal:</th> - <td>".constants::invoice_valuta."{$offer->calculate(offer::SUBTOTAL)}</td> + <td>".Constants::invoice_valuta."{$offer->calculate(offer::SUBTOTAL)}</td> </tr> <tr> <th style='padding-right:1em;'>VAT:</th> - <td>".constants::invoice_valuta."{$offer->calculate(offer::VAT)}</td> + <td>".Constants::invoice_valuta."{$offer->calculate(offer::VAT)}</td> <tr> </tr> <th style='padding-right:1em;'>Total:</th> - <td>".constants::invoice_valuta."{$offer->calculate(offer::TOTAL)}</td> + <td>".Constants::invoice_valuta."{$offer->calculate(offer::TOTAL)}</td> </tr> </table> </td> @@ -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 8f741c2..9b69dce 100644 --- a/include/offers-view.php +++ b/include/offers-view.php @@ -19,7 +19,7 @@ require_once('./login.php'); -$_offer = new offer($_pdo, $_id); +$_offer = new Offer($_pdo, $_id); ?> <div class="col-lg-6"> <div class="panel panel-default" id="panel-timeline"> @@ -40,8 +40,8 @@ $_offer = new offer($_pdo, $_id); '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/>"; + $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; @@ -106,17 +106,17 @@ $_offer = new offer($_pdo, $_id); 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/> + <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'><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 + ".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> + <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>"; } @@ -149,16 +149,16 @@ $_offer = new offer($_pdo, $_id); 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/> + <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 + ".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> + <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>"; } diff --git a/include/offers.php b/include/offers.php index 81781ba..7208ee6 100644 --- a/include/offers.php +++ b/include/offers.php @@ -48,8 +48,8 @@ require('./header.php'); if (isset($_GET['id'])) { $id = (int) $_GET['id']; try { - $offer = new offer($_pdo, $id); - $header = "<a href='".constants::url_external."offers'>Offers</a> / #{$offer->getId()}"; + $offer = new Offer($_pdo, $id); + $header = "<a href='".Constants::url_external."offers'>Offers</a> / #{$offer->getId()}"; $show_individual = $id; } catch (PDOException $e) { $alert = "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The offer with id $id</i> could not be found.</div>"; @@ -67,7 +67,7 @@ require('./header.php'); echo "<div class='col-lg-12'>"; $id = (int) $_GET['toggle_accept']; try { - $offer = new offer($_pdo, $id); + $offer = new Offer($_pdo, $id); if ($offer->toggleAccepted()) { echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The status offer #{$offer->getId()} has been set to <i>".($offer->isAccepted() ? "accepted" : "unaccepted")."</i>.</div>"; } else { @@ -87,7 +87,7 @@ require('./header.php'); echo "<div class='col-lg-12'>"; $id = (int) $_GET['generate_invoice']; try { - $offer = new offer($_pdo, $id); + $offer = new Offer($_pdo, $id); $file = $offer->generateInvoice(); echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The invoice for offer #{$offer->getId()} is generated: <a class='alert-link' href='{$file->getFilenameURI()}' target='_blank'>{$file->getFilename()}</a></div>"; } catch (PDOException $e) { @@ -103,7 +103,7 @@ require('./header.php'); echo "<div class='col-lg-12'>"; $id = (int) $_GET['trash_invoice']; try { - $offer = new offer($_pdo, $id); + $offer = new Offer($_pdo, $id); $file = $offer->getInvoiceFile(); if ($file instanceof file && $file->delete()) { echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The invoice for offer #{$offer->getId()} is trashed.</div>"; @@ -123,7 +123,7 @@ require('./header.php'); echo "<div class='col-lg-12'>"; $id = (int) $_GET['delete']; try { - $offer = new offer($_pdo, $id); + $offer = new Offer($_pdo, $id); if ($offer->delete()) { echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The offer #{$offer->getId()} has been removed.</div>"; } else { diff --git a/include/settings.php b/include/settings.php index 896152c..bd4c0d0 100644 --- a/include/settings.php +++ b/include/settings.php @@ -38,7 +38,7 @@ require('./header.php'); <?php if (isset($_GET['delete_user']) && $_user->isAdmin()) { try { - $user = new user($_pdo, $_GET['delete_user']); + $user = new User($_pdo, $_GET['delete_user']); if ($user->delete()) { echo "<div class='alert alert-success alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The user with username <i>{$user->getUsername()}</i> has been removed.</div>"; } else { @@ -135,7 +135,7 @@ require('./header.php'); <div class="panel panel-default"> <div class="panel-heading">Create new</div> <div class="panel-body"> - <form role="form" id="newUser" action='<?=constants::url_external?>users/new' method="post" class="bootstrapValidator ajaxify" + <form role="form" id="newUser" action='<?=Constants::url_external?>users/new' method="post" class="bootstrapValidator ajaxify" data-ajaxify-options='{"success":"newUserSuccess","error":"newUserError","beforeSubmit":"newUserBeforeSubmit","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"> diff --git a/include/users-new.php b/include/users-new.php index d32e201..5b4bd7f 100644 --- a/include/users-new.php +++ b/include/users-new.php @@ -22,7 +22,7 @@ define('REQUIRE_ADMIN', true); require_once('./conf.php'); require_once('./login-ajax.php'); -$response = new response(); +$response = new Response(); try { $pass = user::generateRandomPassword(); |