aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/assignments-overview.php4
-rw-r--r--include/clients-overview.php2
-rw-r--r--include/contacts-overview.php4
-rw-r--r--include/discounts-overview.php4
-rw-r--r--include/file-get.php2
-rw-r--r--include/home.php24
-rw-r--r--include/offers-overview.php4
-rw-r--r--include/offers-view.php4
-rw-r--r--include/settings.php2
9 files changed, 25 insertions, 25 deletions
diff --git a/include/assignments-overview.php b/include/assignments-overview.php
index 2c2c115..c8b0de1 100644
--- a/include/assignments-overview.php
+++ b/include/assignments-overview.php
@@ -37,7 +37,7 @@ require_once(__DIR__ . '/../login.php');
</thead>
<tbody>
<?php
- $assignments = BusinessAdmin::getAssignments($_pdo);
+ $assignments = Assignment::search($_pdo);
foreach ($assignments as $assignment) {
echo "<tr class='mix'
data-mixer-order-id='{$assignment->id}'
@@ -85,7 +85,7 @@ require_once(__DIR__ . '/../login.php');
<label>Offer:</label>
<select name="offerId" class="form-control">
<?php
- foreach (BusinessAdmin::getOffers($_pdo) as $offer) {
+ foreach (Offer::search($_pdo) as $offer) {
echo "<option value='{$offer->id}'>#{$offer->id} to {$offer->getContact()->name} ({$offer->getContact()->getClient()->name})</option>";
}
?>
diff --git a/include/clients-overview.php b/include/clients-overview.php
index ce23058..e0160a7 100644
--- a/include/clients-overview.php
+++ b/include/clients-overview.php
@@ -34,7 +34,7 @@ require_once(__DIR__ . '/../login.php');
</thead>
<tbody>
<?php
- $clients = BusinessAdmin::getClients($_pdo);
+ $clients = Client::search($_pdo);
foreach ($clients as $client) {
echo "<tr class='mix'
data-mixer-order-id='{$client->id}'
diff --git a/include/contacts-overview.php b/include/contacts-overview.php
index 73cd5cd..2376f5a 100644
--- a/include/contacts-overview.php
+++ b/include/contacts-overview.php
@@ -36,7 +36,7 @@ require_once(__DIR__ . '/../login.php');
</thead>
<tbody>
<?php
- $contacts = BusinessAdmin::getContacts($_pdo);
+ $contacts = Contact::search($_pdo);
foreach ($contacts as $contact) {
echo "<tr class='mix'
data-mixer-order-id='{$contact->id}'
@@ -84,7 +84,7 @@ require_once(__DIR__ . '/../login.php');
<label>Client:</label>
<select name="clientId" class="form-control">
<?php
- foreach (BusinessAdmin::getClients($_pdo) as $client) {
+ foreach (Client::search($_pdo) as $client) {
echo "<option value='{$client->id}'>{$client->name}</option>";
}
?>
diff --git a/include/discounts-overview.php b/include/discounts-overview.php
index c6c3421..93b24d4 100644
--- a/include/discounts-overview.php
+++ b/include/discounts-overview.php
@@ -36,7 +36,7 @@ require_once(__DIR__ . '/../login.php');
</thead>
<tbody>
<?php
- $discounts = BusinessAdmin::getDiscounts($_pdo);
+ $discounts = Discount::search($_pdo);
foreach ($discounts as $discount) {
echo "<tr class='mix'
data-mixer-order-id='{$discount->id}'
@@ -82,7 +82,7 @@ require_once(__DIR__ . '/../login.php');
<label>Offer:</label>
<select name="offerId" class="form-control">
<?php
- foreach (BusinessAdmin::getOffers($_pdo) as $offer) {
+ foreach (Offer::search($_pdo) as $offer) {
echo "<option value='{$offer->id}'>#{$offer->id} to {$offer->getContact()->name} ({$offer->getContact()->getClient()->name})</option>";
}
?>
diff --git a/include/file-get.php b/include/file-get.php
index c04b378..2aa5de4 100644
--- a/include/file-get.php
+++ b/include/file-get.php
@@ -31,7 +31,7 @@ $filepath = Constants::files_folder . $filename;
$key = $_REQUEST['key'];
-$files = BusinessAdmin::getFiles($_pdo, ['`filename`=?'], [$filename]);
+$files = File::search($_pdo, ['`filename`=?'], [$filename]);
if (count($files) == 0 || !file_exists($filepath) || is_dir($filepath)) {
http_response_code(404);
header('Content-type: text/plain');
diff --git a/include/home.php b/include/home.php
index 2b64290..b42ec8e 100644
--- a/include/home.php
+++ b/include/home.php
@@ -37,7 +37,7 @@ require('./header.php');
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-6">
<?php
- $count = count(BusinessAdmin::getOfferIds($_pdo, array("`accepted` = 0")));
+ $count = Offer::count($_pdo, ["`accepted` = 0"]);
?>
<div class="panel panel-<?=($count==0 ? 'primary' : 'yellow')?>">
<div class="panel-heading">
@@ -62,7 +62,7 @@ require('./header.php');
</div>
<div class="col-lg-3 col-md-3 col-sm-6">
<?php
- $count = count(BusinessAdmin::getOfferIds($_pdo, array("`accepted`=1", "`start_date` <= CURDATE()", "`end_date` >= CURDATE()")));
+ $count = Offer::count($_pdo, ["`accepted`=1", "`start_date` <= CURDATE()", "`end_date` >= CURDATE()"]);
?>
<div class="panel panel-<?=($count==0 ? 'primary' : ($count < 3) ? 'green' : ($count < 5 ? 'yellow' : 'red'))?>">
<div class="panel-heading">
@@ -87,7 +87,7 @@ require('./header.php');
</div>
<div class="col-lg-3 col-md-3 col-sm-6">
<?php
- $count = count(BusinessAdmin::getOfferIds($_pdo, array("`accepted`=1", "`end_date` <= CURDATE()", "`invoice_date` IS NULL OR `invoice_date`='1970-01-01' OR `invoice_date`>CURDATE()")));
+ $count = Offer::count($_pdo, ["`accepted`=1", "`end_date` <= CURDATE()", "`invoice_date` IS NULL OR `invoice_date`='1970-01-01' OR `invoice_date`>CURDATE()"]);
?>
<div class="panel panel-<?=($count==0 ? 'primary' : ($count < 3) ? 'green' : ($count < 5 ? 'yellow' : 'red'))?>">
<div class="panel-heading">
@@ -112,11 +112,11 @@ require('./header.php');
</div>
<div class="col-lg-3 col-md-3 col-sm-6">
<?php
- $count = count(BusinessAdmin::getOffers($_pdo, [
+ $count = Offer::count($_pdo, [
"`invoice_date` > '1970-01-01'",
"`invoice_date`<=CURDATE()",
- "NOT EXISTS (SELECT * FROM `".Constants::db_prefix."payment` WHERE `offerId`=`".Constants::db_prefix."offer`.`id`)"]));
- foreach (BusinessAdmin::getOffers($_pdo, ['EXISTS (SELECT * FROM `'.Constants::db_prefix.'payment` WHERE `offerId`=`'.Constants::db_prefix.'offer`.`id` AND `braintree_id` IS NOT NULL)']) as $offer) {
+ "NOT EXISTS (SELECT * FROM `".Constants::db_prefix."payment` WHERE `offerId`=`".Constants::db_prefix."offer`.`id`)"]);
+ foreach (Offer::search($_pdo, ['EXISTS (SELECT * FROM `'.Constants::db_prefix.'payment` WHERE `offerId`=`'.Constants::db_prefix.'offer`.`id` AND `braintree_id` IS NOT NULL)']) as $offer) {
if (!$offer->getPayment()->isBraintreeFinished()) {
$count++;
}
@@ -154,7 +154,7 @@ require('./header.php');
<!-- /.panel-heading -->
<div class="panel-body">
<?php
- $offers = BusinessAdmin::getOffers($_pdo, array("`accepted`=1", "`start_date` <= CURDATE()", "`end_date` >= CURDATE()"));
+ $offers = Offer::search($_pdo, ["`accepted`=1", "`start_date` <= CURDATE()", "`end_date` >= CURDATE()"]);
$list = array();
foreach ($offers as $offer) {
$start = BusinessAdmin::formatDate($offer->start_date, false);
@@ -209,7 +209,7 @@ require('./header.php');
</thead>
<tbody>
<?php
- $offers = BusinessAdmin::getOffers($_pdo, array("`accepted`=1", "`end_date` <= CURDATE()", "`invoice_date` IS NULL OR `invoice_date`='1970-01-01' OR `invoice_date`>CURDATE()"));
+ $offers = Offer::search($_pdo, ["`accepted`=1", "`end_date` <= CURDATE()", "`invoice_date` IS NULL OR `invoice_date`='1970-01-01' OR `invoice_date`>CURDATE()"]);
foreach ($offers as $offer) {
echo "<tr>
<td><a href='offers?id={$offer->id}'>{$offer->id}</a></td>
@@ -245,11 +245,11 @@ require('./header.php');
</thead>
<tbody>
<?php
- $offers = BusinessAdmin::getOffers($_pdo, array(
+ $offers = Offer::search($_pdo, [
"`invoice_date` > '1970-01-01'",
"`invoice_date`<=CURDATE()",
- "NOT EXISTS (SELECT * FROM `".Constants::db_prefix."payment` WHERE `offerId`=`".Constants::db_prefix."offer`.`id`)"));
- $open_offers = BusinessAdmin::getOffers($_pdo,
+ "NOT EXISTS (SELECT * FROM `".Constants::db_prefix."payment` WHERE `offerId`=`".Constants::db_prefix."offer`.`id`)"]);
+ $open_offers = Offer::search($_pdo,
['EXISTS (SELECT * FROM `'.Constants::db_prefix.'payment` WHERE `offerId`=`'.Constants::db_prefix.'offer`.`id` AND `braintree_id` IS NOT NULL)']);
$count = count($offers);
foreach ($open_offers as $offer) {
@@ -300,7 +300,7 @@ require('./header.php');
<div class="panel-body">
<ul class="timeline">
<?php
- $offers = BusinessAdmin::getOffers($_pdo, array('`accepted`=1'));
+ $offers = Offer::search($_pdo, ['`accepted`=1']);
$list = array();
$sort_list = array();
foreach ($offers as $offer) {
diff --git a/include/offers-overview.php b/include/offers-overview.php
index 090a036..09b8cfd 100644
--- a/include/offers-overview.php
+++ b/include/offers-overview.php
@@ -37,7 +37,7 @@ require_once(__DIR__ . '/../login.php');
</thead>
<tbody>
<?php
- $offers = BusinessAdmin::getOffers($_pdo);
+ $offers = Offer::search($_pdo);
foreach ($offers as $offer) {
$invoiceFile = $offer->getInvoiceFile();
@@ -122,7 +122,7 @@ require_once(__DIR__ . '/../login.php');
<label>Contact:</label>
<select name="contactId" class="form-control">
<?php
- foreach (BusinessAdmin::getContacts($_pdo) as $contact) {
+ foreach (Contact::search($_pdo) as $contact) {
echo "<option value='{$contact->id}'>{$contact->name} ({$contact->getClient()->name})</option>";
}
?>
diff --git a/include/offers-view.php b/include/offers-view.php
index 56359ae..cce5a66 100644
--- a/include/offers-view.php
+++ b/include/offers-view.php
@@ -37,7 +37,7 @@ $_offer = new Offer($_pdo, $_id);
</thead>
<tbody>
<?php
- $assignments = BusinessAdmin::getAssignments($_pdo, array("offerId = {$_offer->id}"));
+ $assignments = $_offer->getAssignments();
foreach ($assignments as $assignment) {
echo "<tr>
<td class='col-min-width'>{$assignment->id}</td>
@@ -80,7 +80,7 @@ $_offer = new Offer($_pdo, $_id);
</thead>
<tbody>
<?php
- $discounts = BusinessAdmin::getDiscounts($_pdo, array("offerId = {$_offer->id}"));
+ $discounts = $_offer->getDiscounts();
foreach ($discounts as $discount) {
echo "<tr>
<td class='col-min-width'>{$discount->id}</td>
diff --git a/include/settings.php b/include/settings.php
index 865229d..7f4c4e8 100644
--- a/include/settings.php
+++ b/include/settings.php
@@ -103,7 +103,7 @@ require('./header.php');
</thead>
<tbody>
<?php
- $users = BusinessAdmin::getUsers($_pdo);
+ $users = User::search($_pdo);
foreach ($users as $user) {
echo "<tr class='mix'
data-mixer-order-id='{$user->id}'