-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
55 lines (48 loc) · 1.59 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
<!DOCTYPE html>
<!-- Student Webapp -->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
include('Student.php');
$students = array();
//creates the first student.
$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;
//creates a second student
$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;
//creates a third student
$third = new Student();
$third->surname = "Langaditis";
$third->first_name = "Speridon";
$third->add_email('home', 'slangaditis94@hotmail.com');
$third->add_grade(100);
$third->add_grade(100);
$students['s789'] = $third;
//sorts the students alphabetically
ksort($students);
//displays all the students
foreach ($students as $student)
echo $student->toString();
?>
</body>
</html>