summary refs log tree commit diff stats
path: root/pages/archive.php
blob: 114062c3a3efa1f70d4bf3cea5161686353970d3 (plain) (blame)
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
                        <H1>Archives</H1>

			<TABLE ID="seasons">
				<TR>
					<TH>Season</TH>
					<TH>First Comic</TH>
					<TH>Last Comic</TH>
					<TH>Comics</TH>
				</TR>

<?php

$getseasons = $mysql_conn->query("SELECT * FROM seasons ORDER BY season_id ASC");
foreach ($getseasons as $getseasons3)
{
	$getfc = $mysql_conn->query("SELECT * FROM comics WHERE comic_id = " . $getseasons3['first_comic_id']);
	$getfc3 = $getfc->fetch_assoc();

	if (!is_null($getseasons3['last_comic_id']))
	{
		$getlc = $mysql_conn->query("SELECT * FROM comics WHERE comic_id = " . $getseasons3['last_comic_id']);
    $getlc3 = $getlc->fetch_assoc();

		$count = $getseasons3['last_comic_id'] - ($getseasons3['first_comic_id']-1);
	} else {
		$getcnt = $mysql_conn->query("SELECT COUNT(*) FROM comics WHERE comic_id >= " . $getseasons3['first_comic_id']);
    $getcnt3 = $getcnt->fetch_assoc();

		$count = $getcnt3[0];
	}

?>
				<TR>
					<TD><A HREF="/season<?php echo($getseasons3['season_id']); ?>.htm"><?php echo($getseasons3['season_id']); ?></A></TD>
					<TD><A HREF="/comic<?php echo($getfc3['comic_id']); ?>.htm"><?php echo($getfc3['title']); ?></A><BR />(<?php echo(date('F j Y',strtotime(get_meta($getfc3['id'], 'pubDate')))); ?>)</TD>
					<TD><?php if (!is_null($getseasons3['last_comic_id'])) { ?><A HREF="/comic<?php echo($getlc3['comic_id']); ?>.htm"><?php echo($getlc3['title']); ?></A><BR />(<?php echo(date('F j Y',strtotime(get_meta($getlc3['id'], 'pubDate')))); ?>)<?php } else { ?><EM>N/A</EM><?php } ?></TD>
					<TD><?php echo($count); ?></TD>
				</TR>
<?php

}

?>
			</TABLE>