File tree Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 13
13
14
14
$ query = <<<EOF
15
15
16
- DROP TABLE IF EXISTS php_santa_letters ;
16
+ DROP TABLE IF EXISTS php_camp ;
17
17
18
- CREATE TABLE php_santa_letters (
18
+ CREATE TABLE php_camp (
19
19
id INTEGER PRIMARY KEY,
20
- content TEXT,
21
- received_at TIMESTAMP
20
+ attendee TEXT,
21
+ avatar_url TEXT
22
22
);
23
23
24
- INSERT INTO php_santa_letters VALUES(1,'A unified Request Response interface','2011-12-01');
25
- INSERT INTO php_santa_letters VALUES(2,'A package manager that''s fun to use!','2011-12-01');
24
+ INSERT INTO php_camp VALUES(1,'weierophinney', 'http://i.vimeocdn.com/portrait/4175704_300x300.jpg');
25
+ INSERT INTO php_camp VALUES(2,'fabpot','https://pbs.twimg.com/profile_images/443336758403424256/U5bzXI5l_400x400.jpeg');
26
+ INSERT INTO php_camp VALUES(3, 'pmjones', 'https://pbs.twimg.com/profile_images/482556486824910848/Bb4fyXhn_400x400.jpeg');
27
+ INSERT INTO php_camp VALUES(4, 'jmikola', '/images/wurstcon.jpg');
28
+
26
29
EOF
27
30
;
28
31
Original file line number Diff line number Diff line change 14
14
15
15
if ($ uri == '/ ' || $ uri == '' ) {
16
16
17
- echo '<h1>Welcome to PHP Santa </h1> ' ;
18
- echo '<a href="/letters">Read the letters </a> ' ;
17
+ echo '<h1>PHP Camp! </h1> ' ;
18
+ echo '<a href="/attendees">See the attendees </a> ' ;
19
19
if (isset ($ _GET ['name ' ])) {
20
20
echo sprintf ('<p>Oh, and hello %s!</p> ' , $ _GET ['name ' ]);
21
21
}
22
22
23
- } elseif ($ uri == '/letters ' ) {
23
+ } elseif ($ uri == '/attendees ' ) {
24
24
25
- $ sql = 'SELECT * FROM php_santa_letters ' ;
26
- echo '<h1>Read the letters to PHP Santa</h1> ' ;
27
- echo '<ul> ' ;
25
+ $ sql = 'SELECT * FROM php_camp ' ;
26
+ echo '<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" /> ' ;
27
+ echo '<h1>PHP Camp Attendees</h1> ' ;
28
+ echo '<table class="table" style="width: 300px;"> ' ;
28
29
foreach ($ dbh ->query ($ sql ) as $ row ) {
29
- echo sprintf ('<li>%s - dated %s</li> ' , $ row ['content ' ], $ row ['received_at ' ]);
30
+ echo sprintf (
31
+ '<tr><td style="font-size: 24px;">%s</td><td><img src="%s" height="120" /></td></tr> ' ,
32
+ $ row ['attendee ' ],
33
+ $ row ['avatar_url ' ]
34
+ );
30
35
}
31
- echo '</ul > ' ;
36
+ echo '</table > ' ;
32
37
33
38
} else {
34
39
header ("HTTP/1.1 404 Not Found " );
35
40
echo '<h1>404 Page not Found</h1> ' ;
36
- echo '<p>This is most certainly *not* an xmas miracle </p> ' ;
37
- }
41
+ echo '<p>Find a boy (or girl) scout - they can fix this! </p> ' ;
42
+ }
You can’t perform that action at this time.
0 commit comments