summary refs log tree commit diff stats
path: root/pages/archive.php
blob: 85a73d5f4405fb7b73f091bd5266caef8f27072f (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
45
46
47
48
                        <H1>Archives</H1>

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

<?php

$getseasons = "SELECT * FROM seasons ORDER BY season_id ASC";
$getseasons2 = mysql_query($getseasons);
while ($getseasons3 = mysql_fetch_array($getseasons2))
{
	$getfc = "SELECT * FROM comics WHERE comic_id = " . $getseasons3['first_comic_id'];
	$getfc2 = mysql_query($getfc);
	$getfc3 = mysql_fetch_array($getfc2);

	if (!is_null($getseasons3['last_comic_id']))
	{
		$getlc = "SELECT * FROM comics WHERE comic_id = " . $getseasons3['last_comic_id'];
		$getlc2 = mysql_query($getlc);
		$getlc3 = mysql_fetch_array($getlc2);

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

		$count = $getcnt3[0];
	}

?>
				<TR>
					<TD><A HREF="/season<?php echo($getseasons3['season_id']); ?>.htm">1</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>