-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
57 lines (49 loc) · 1.87 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
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title>COMP 4711 Class List</title>
</head>
<body>
<h1>COMP 4711 Class List</h1>
<?php
include('student.php');
$students = array(); // creates students array
$first = new Student(); // adds first student
$first->surname = "Doe";
$first->first_name = "John";
$first->add_email('home','[email protected]');
$first->add_email('work','[email protected]');
$first->add_grade(65);
$first->add_grade(75);
$first->add_grade(55);
$students['j123'] = $first;
$second = new Student(); // adds second student
$second->surname = "Einstein";
$second->first_name = "Albert";
$second->add_email('home','[email protected]');
$second->add_email('work1','[email protected]');
$second->add_email('work2','[email protected]');
$second->add_grade(95);
$second->add_grade(80);
$second->add_grade(50);
$students['a456'] = $second;
$third = new Student(); // adds third student
$third->surname = "Tangeman";
$third->first_name = "Kevin";
$third->add_email('home', '[email protected]');
$third->add_email('work', '[email protected]');
$third->add_grade(90);
$third->add_grade(80);
$students['k789'] = $third;
ksort($students); // one of the many sort functions
foreach($students as $student) // displays each student in the array
echo $student->toString();
?>
</body>
</html>