-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdministratorController.php
More file actions
77 lines (64 loc) · 1.85 KB
/
AdministratorController.php
File metadata and controls
77 lines (64 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Controller class
* @author Undergraduate Group One
*/
//associated with AdministratorInterface,
//and OrderStore
include 'AdministratorInterface.php';
include 'OrderStore.php';
include 'WeightStore.php';
class AdministratorController
{
var $adminInterface;
var $orderStore;
var $weightStore;
public function __construct()
{
$this->orderStore = new OrderStore();
$this->adminInterface = new AdministratorInterface();
$this->weightStore = new WeightStore();
}
public function displayAdministratorInterface()
{
$this->adminInterface->displayAdministratorInterface();
}
public function searchByDate($lower,$upper)
{
return $this->orderStore->searchByDate($lower,$upper);
}
public function searchByStatus($status)
{
return $this->orderStore->searchByStatus($status);
}
public function searchByPrice($lower,$upper)
{
return $this->orderStore->searchByPrice($lower,$upper);
}
public function displayOrders($rows)
{
$this->adminInterface->displayOrders($rows);
}
public function displayWeightBrackets()
{
$query = "SELECT * FROM WeightBrackets;";
$this->adminInterface->displayWeightBrackets($this->weightStore->accessWeightBrackets($query));
}
public function addNewWeightBracket($price,$lowerbound,$upperbound)
{
$this->weightStore->newWeightBracket($price,$lowerbound,$upperbound);
}
public function deleteWeightBracket($id)
{
$this->weightStore->deleteWeightBracket($id);
}
public function accessWeightBrackets($query)
{
return $this->weightStore->accessWeightBrackets($query);
}
public function editWeightBracket($price,$lowerbound,$upperbound,$id)
{
$this->weightStore->editWeightBracket($price,$lowerbound,$upperbound,$id);
}
}
?>