Animarr/web/index.php

37 lines
1.4 KiB
PHP
Executable file

<?php
include "common.php";
printHeader("Home");
echo "<h1>Tracked entries</h1>";
echo "<table class=\"table table-striped table-hover\">";
echo "<tr><th>AniDB #</th><th>Show Name</th><th>Info</th><th>Episodes</th></tr>";
$animus = [];
foreach($database->getTracked() as $aid => $data){
$info = $aniDB->getAnime($aid);
$xml = new \SimpleXMLElement($aniDB->getAnimeAPI($aid));
$data["xml"] = $xml;
$data["aid"] = $aid;
$data["anime"] = $info;
$animus[strval($xml->startdate) ."|". $aid] = $data;
}
krsort($animus, SORT_REGULAR);
foreach($animus as $data){
//$imgUrl = "https://img7.anidb.net/pics/anime/" . strval($xml->picture);
//echo "<tr><td><a href=\"https://anidb.net/perl-bin/animedb.pl?show=anime&aid=$aid\" target=\"_blank\"><img src=\"$imgUrl\" width=120/><br/>$aid</a></td><td><a href=\"add.php?aid=$aid\" style=\"font-size: 150%;\">".$info["title"]." [$type ".strval($xml->startdate)."] </a><br/>".strval($xml->description)."</td><td>$lev</td></tr>";
echo "<tr><td>".$data["aid"]."</td><td><a href=\"show.php?aid=".$data["aid"]."\">".$data["anime"]["title"]."</a></td><td>".strval($data["xml"]->type)." (".strval($data["xml"]->startdate).")</td><td>".$data["episode_count"]."/".$data["xml"]->episodecount."</td></tr>";
//echo '<a href="show.php?aid='.$aid.'" title="'.$info["title"].'"><img src="https://img7.anidb.net/pics/anime/'.$aid.'.jpg" width=120 /></a>';
}
echo "</table>";
printFooter();