From 08e6ca70604aff5169dbcbf5b74215628ae4097e Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 27 Jul 2016 16:18:13 +0200 Subject: Reorganise to have client use Model --- include/assignments-overview.php | 4 ++-- include/assignments-view.php | 2 +- include/clients-new.php | 2 +- include/clients-overview.php | 14 +++++++------- include/clients.php | 6 +++--- include/contacts-overview.php | 4 ++-- include/discounts-overview.php | 4 ++-- include/home.php | 6 +++--- include/offers-overview.php | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) (limited to 'include') diff --git a/include/assignments-overview.php b/include/assignments-overview.php index 2de6858..ee46928 100644 --- a/include/assignments-overview.php +++ b/include/assignments-overview.php @@ -48,7 +48,7 @@ require_once('./login.php'); #{$assignment->getOffer()->getId()} to {$assignment->getOffer()->getContact()->getName()} - ({$assignment->getOffer()->getContact()->getClient()->getName()}) + ({$assignment->getOffer()->getContact()->getClient()->name}) {$assignment->getTitle()}

{$assignment->getDescription(false)}

@@ -86,7 +86,7 @@ require_once('./login.php'); diff --git a/include/assignments-view.php b/include/assignments-view.php index 7a2923e..f2717b0 100644 --- a/include/assignments-view.php +++ b/include/assignments-view.php @@ -45,7 +45,7 @@ $_assignment = new assignment($_pdo, $_id); #{$_assignment->getOffer()->getId()} to {$_assignment->getOffer()->getContact()->getName()} - ({$_assignment->getOffer()->getContact()->getClient()->getName()}) + ({$_assignment->getOffer()->getContact()->getClient()->name}) {$_assignment->getHours()}h diff --git a/include/clients-new.php b/include/clients-new.php index b073b8e..e87557e 100644 --- a/include/clients-new.php +++ b/include/clients-new.php @@ -30,7 +30,7 @@ try { $response->message = "The client could not be created due to an error."; } else { $response->success = true; - $response->message = "Client '{$client->getName()}' has been created. Refresh the page."; + $response->message = "Client '{$client->name}' has been created. Refresh the page."; } } catch (PDOException $e) { $response->success = false; diff --git a/include/clients-overview.php b/include/clients-overview.php index fc2c3a0..58fad49 100644 --- a/include/clients-overview.php +++ b/include/clients-overview.php @@ -37,17 +37,17 @@ require_once('./login.php'); $clients = BusinessAdmin::getClients($_pdo); foreach ($clients as $client) { echo " - {$client->getId()} + data-mixer-order-id='{$client->id}' + data-mixer-order-name='{$client->name}'> + {$client->id} - - {$client->getName()} + + {$client->name} - - + + "; } diff --git a/include/clients.php b/include/clients.php index 88608ab..b07a7c8 100644 --- a/include/clients.php +++ b/include/clients.php @@ -46,7 +46,7 @@ require('./header.php'); $id = (int) $_GET['id']; try { $client = new client($_pdo, $id); - $header = "Clients / {$client->getName()}"; + $header = "Clients / {$client->name}"; $show_individual = $id; } catch (PDOException $e) { $alert = "
The client with id $id could not be found.
"; @@ -66,9 +66,9 @@ require('./header.php'); try { $client = new client($_pdo, $id); if ($client->delete()) { - echo "
The client with name {$client->getName()} has been removed.
"; + echo "
The client with name {$client->name} has been removed.
"; } else { - echo "
The client with name {$client->getName()} could not be removed. Perhaps it's already removed?
"; + echo "
The client with name {$client->name} could not be removed. Perhaps it's already removed?
"; } } catch (PDOException $e) { echo "
The client could not be removed due to a PDO error.
"; diff --git a/include/contacts-overview.php b/include/contacts-overview.php index c1f282b..9cd71f3 100644 --- a/include/contacts-overview.php +++ b/include/contacts-overview.php @@ -44,7 +44,7 @@ require_once('./login.php'); {$contact->getId()} {$contact->getName()}
- ({$contact->getClient()->getName()}) + ({$contact->getClient()->name}) {$contact->getEmail()}
@@ -85,7 +85,7 @@ require_once('./login.php'); diff --git a/include/discounts-overview.php b/include/discounts-overview.php index f9a3630..d4d8245 100644 --- a/include/discounts-overview.php +++ b/include/discounts-overview.php @@ -46,7 +46,7 @@ require_once('./login.php'); #{$discount->getOffer()->getId()} to {$discount->getOffer()->getContact()->getName()} - ({$discount->getOffer()->getContact()->getClient()->getName()}) + ({$discount->getOffer()->getContact()->getClient()->name}) {$discount->getTitle()}

{$discount->getDescription(false)}

@@ -83,7 +83,7 @@ require_once('./login.php'); diff --git a/include/home.php b/include/home.php index 51d899b..a9dca1e 100644 --- a/include/home.php +++ b/include/home.php @@ -165,7 +165,7 @@ require('./header.php'); 'start' => $start, 'end' => $end, 'id' => $offer->getId(), - 'contactClientName' => $offer->getContact()->getClient()->getName(), + '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) @@ -208,7 +208,7 @@ require('./header.php'); foreach ($offers as $offer) { echo ""; echo "{$offer->getId()}"; - echo "{$offer->getContact()->getClient()->getName()}"; + echo "{$offer->getContact()->getClient()->name}"; echo "".BusinessAdmin::formatDate($offer->getEndDate(), false).""; echo ""; } @@ -249,7 +249,7 @@ require('./header.php'); foreach ($offers as $offer) { echo ""; echo "{$offer->getId()}"; - echo "{$offer->getContact()->getClient()->getName()}"; + echo "{$offer->getContact()->getClient()->name}"; echo "".BusinessAdmin::formatDate($offer->getInvoiceDate(), false).""; echo ""; } diff --git a/include/offers-overview.php b/include/offers-overview.php index 7fd2de2..a246190 100644 --- a/include/offers-overview.php +++ b/include/offers-overview.php @@ -43,7 +43,7 @@ require_once('./login.php'); echo " {$offer->getId()} - {$offer->getContact()->getName()} + {$offer->getContact()->getName()} "; foreach ($offer->getAssignments() as $assignment) { echo "{$assignment->getTitle()}
(".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)

{$assignment->getDescription()}

"; @@ -120,7 +120,7 @@ require_once('./login.php'); -- cgit v1.2.3