-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
124 lines (107 loc) · 2.91 KB
/
index.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
// Write a set of classes that can represent the following sample customer data.
$customer = <<<JSON
{
"firstName": "Jonathon",
"lastName": "Doe",
"email": [
{
"id": "2311",
"type": "work",
"address": "[email protected]",
"default": true
},
{
"id": "7775",
"type": "personal",
"email": "[email protected]"
}
],
"phone": [
{
"id": "7673",
"type": "work",
"number": "2124583322",
"extension": "223",
"default": true
},
{
"id": "24332",
"type": "cell",
"number": "9173348484"
}
],
"address": [
{
"id": "232",
"label": "Home",
"type": "shipping",
"street": [
"4854 Embassy Drive",
"Building 8"
],
"city": "Arlington",
"state": "VA",
"zip": "20184"
},
{
"id": "233",
"label": "Work",
"type": "shipping",
"street": [
"4854 South 4th Street",
"Suite 705"
],
"city": "Newark",
"state": "NJ",
"zip": "10475-4392",
"default": true
},
{
"id": "252",
"label": "Parents",
"type": "billing",
"street": [
"4854 South 4th Street",
"Suite 705
],
"city": "Newark",
"state": "NJ",
"zip": "10475-4392"
}
]
}
JSON;
include_once('customer_lib.php');
$mail_object1 = new customerEmailClass(12383274, 'personal', '[email protected]', TRUE);
$mail_object2 = new customerEmailClass(1238970, 'personal', '[email protected]');
$mail_objects = array($mail_object1, $mail_object2);
$phone_object1 = new customerPhoneClass(4566578, 'cell', 2016153266, '', TRUE);
$phone_object2 = new customerPhoneClass(4561234, 'work', 2125226541, '');
$phone_objects = array($phone_object1, $phone_object2);
$address_object1 = new customerAddressClass(78991324, 'Home', 'shipping', array('25 Van Schaik Ln.'), 'Wyckoff', 'NJ', '07481', TRUE);
$address_object2 = new customerAddressClass(78991324, 'Home', 'shipping', array('100 Any Street.', 'Apt #100'), 'Any Town', 'NJ', '07000');
$address_objects = array($address_object1, $address_object2);
$first_name = 'Kevin';
$last_name = 'Wiechmann';
$customer_object = new customerClass($first_name, $last_name, $mail_objects, $phone_objects, $address_objects);
?>
<html>
<head>
<style>
.header {background-color:pink; padding:10px;}
</style>
</head>
<body>
<pre>
<strong class="header">Complete customer_object:</strong>
<?php print_r($customer_object); ?>
<strong class="header">Complete customer_object->get_email():</strong>
<?php print_r($customer_object->get_email()); ?>
<strong class="header">Complete customer_object->get_phone():</strong>
<?php print_r($customer_object->get_phone()); ?>
<strong class="header">Complete customer_object->get_address():</strong>
<?php print_r($customer_object->get_address()); ?>
</pre>
</body>
</html>