-
Notifications
You must be signed in to change notification settings - Fork 0
/
shipwire.php
47 lines (43 loc) · 1.33 KB
/
shipwire.php
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
<?php
require_once 'lib/Shipwire/Bootstrap.php';
use Shipwire\Prompts;
$done = false;
do {
echo "\n";
echo "Welcome to the Shipwire Ordering System!\nPlease choose one of the following options:\n\n";
echo "\t1) Add a warehouse\n";
echo "\t2) Add a product\n";
echo "\t3) Add product stock to a warehouse\n";
echo "\t4) Create an order\n";
echo "\t5) Add product to order\n";
echo "\t6) Assign a warehouse to an order\n";
echo "\tQ) Quit\n";
echo "\nPlease enter your choice (1-6): ";
$result = strtoupper(trim(fgets(STDIN)));
switch ($result) {
case 1:
Prompts\AddWarehouse::getInstance()->display();
break;
case 2:
Prompts\AddProduct::getInstance()->display();
break;
case 3:
Prompts\AddProductStock::getInstance()->display();
break;
case 4:
Prompts\AddOrder::getInstance()->display();
break;
case 5:
Prompts\AddOrderProduct::getInstance()->display();
break;
case 6:
Prompts\AssignWarehouse::getInstance()->display();
break;
case 'Q':
$done = true;
break;
default:
echo "Invalid option. Press Enter to continue.";
fgets(STDIN);
}
} while (!$done);