-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
50 lines (48 loc) · 1.33 KB
/
index.php
File metadata and controls
50 lines (48 loc) · 1.33 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Lab01</title>
</head>
<body>
<?php
include('Student.php');
$students = array();
foreach ($students as $student) {
echo $student->toString();
}
$first = new Student();
$first->surname = "Doe";
$first->first_name = "John";
$first->add_email('home', 'john@doe.com');
$first->add_email('work', 'jdoe@mcdonalds.com');
$first->add_grade(65);
$first->add_grade(75);
$first->add_grade(55);
$students['j123'] = $first;
$second = new Student();
$second->surname = "Einstein";
$second->first_name = "Albert";
$second->add_email('home', 'albert@braniacs.com');
$second->add_email('work1', 'a_einstein@bcit.ca');
$second->add_email('work2', 'albert@physics.mit.edu');
$second->add_grade(95);
$second->add_grade(80);
$second->add_grade(50);
$students['a456'] = $second;
$third = new Student();
$third->surname = "Cheng";
$third->first_name = "Stephen";
$third->add_email('home', 'notarealemail@asdf.com');
$third->add_email('work', 'fake.email');
$third->add_grade(70);
$third->add_grade(80);
$third->add_grade(90);
$students['s789'] = $third;
ksort($students);
foreach ($students as $student) {
echo $student->toString();
}
?>
</body>
</html>