Consider the campus map of NCNU. Use HTML MAP tag to specify the coordinates of three rectangles on the map, which correspond to the colleges of Science & Technology, Management, and Humanity, respectively. When a user click on an area corresponding to a college, the browser will open the homepage of that college.
Save your HTML file as "final-1.html", and submit the URL to Moodle.
<?php
$theData = file("phonebook.txt");
print "<TABLE BORDER='1'>\n";
foreach ($theData as $line) {
$line = rtrim($line);
list($name, $phone, $email) = split('\t', $line);
print "<TR><TD> $name <TD> $phone <TD> $email \n";
}
?>
</TABLE>
The following script does not display the time correctly.
Please modify the definition of the class so that it can work correctly.
Highlight modified lines with a different color.
<?php
class Time {
private $hour;
private $minute;
function __construct($s) {
list($hour, $minute) = split(":", $s);
}
function getTime() {
return $hour . ':' . $minute;
}
function modify($d) {
$minute = $minute + $d;
}
}
?>
<?php
$departure = new Time("22:54");
$arrival = new Time("23:36");
print "Your train departs at\t\t" . $departure->getTime();
print " and arrives at " . $arrival->getTime() . "<br />\n";
$departure->modify(-39);
$arrival->modify(-39);
print "The previous train departs at\t\t" . $departure->getTime();
print " and arrives at " . $arrival->getTime() . "<br />\n";
$departure->modify(99);
$arrival->modify(99);
print "The next train departs at\t\t" . $departure->getTime();
print " and arrives at " . $arrival->getTime() . "<br />\n";
?>