-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperson.php
54 lines (48 loc) · 1.28 KB
/
person.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
<?php
require_once('web.inc');
require_once('imslp_util.inc');
require_once('imslp_db.inc');
require_once('imslp_web.inc');
function show_works($person) {
$works = DB_work::enum("composer_id=$person->id", 'order by year_of_composition');
if (!$works) return;
echo "<h2>Works</h2>\n";
start_table('table-striped');
work_table_header();
foreach ($works as $w) {
work_table_row($w);
}
end_table();
}
function show_recordings($person) {
$prs = DB_performer_role::enum("person_id=$person->id");
if (!$prs) return;
echo "<h2>Performances</h2>\n";
foreach ($prs as $pr) {
echo "<h2>$pr->role</h2>\n";
start_table();
recording_table_header();
// TODO: use a join to get work?
$afss = DB_audio_file_set::enum(
"$pr->id member of (performer_role_ids->'$')"
);
foreach ($afss as $afs) {
recording_table_row($afs);
}
end_table();
}
}
function show_person($person) {
page_head("$person->first_name $person->last_name");
show_person_detail($person);
show_works($person);
show_recordings($person);
page_tail();
}
$id = get_int('id');
$person = DB_person::lookup_id($id);
if (!$person) {
error_page('no such person');
}
show_person($person);
?>