summary refs log tree commit diff stats
path: root/pages/season.php
blob: f47ab137cfac37025cbfaa51d1b4d578ee0c7deb (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
<?php

if (is_numeric($_GET['season']))
{
  $getseason = $mysql_conn->prepare("SELECT * FROM seasons WHERE season_id = ?");
  $getseason->bind_param("i", $_GET['season']);
  $getseason->execute();
	$getseason2 = $getseason->get_result();
	$getseason3 = $getseason2->fetch_assoc();
}

if (isset($getseason3) && ($getseason3['season_id'] == $_GET['season']))
{

?>
			<H1>Archive for Season <?php echo($_GET['season']); ?></H1>

			<UL ID="archive">
<?php

if (!is_null($getseason3['last_comic_id']))
{
  $getcomics = $mysql_conn->prepare("SELECT * FROM comics WHERE status = \"publish\" AND comic_id >= ? AND comic_id <= ? ORDER BY comic_id ASC");
  $getcomics->bind_param("ii", $getseason3["first_comic_id"], $getseason3["last_comic_id"]);
} else {
  $getcomics = $mysql_conn->prepare("SELECT * FROM comics WHERE status = \"publish\" AND comic_id >= ? ORDER BY comic_id ASC");
  $getcomics->bind_param("i", $getseason3["first_comic_id"]);
}

$getcomics->execute();
$getcomics2 = $getcomics->get_result();
foreach ($getcomics2 as $getcomics3)
{
?>				<LI><A HREF="/comic<?php echo($getcomics3['comic_id']); ?>.htm"><?php echo($getcomics3['title']); ?></A></LI>
<?php
}

?>			</UL>
<?php

} else {
	include('pages/comic.php');
}

?>