<!DOCTYPE html>
<html lang="en">

<!-- Author  Raivis Rampāns
Created 19.02.2024
Editor Raivis
Modified 14.03.2024-->

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Anime List</title>
    <link href="https://fonts.googleapis.com/css2?family=Dancing+Script" rel="stylesheet">
    <link rel="stylesheet" href="../css/style.css">
  
</head>

<header>
  <?php include 'header.php';?>
</header>

<body class="background">
<?php require "conn.php" ?>

<?php
  $sql = "SELECT * FROM anime_list";
  $res = $conn->query($sql);
?>
  <div class="container mb-5">
<?php
  if ($res->num_rows > 0) {
    while ($row = $res->fetch_assoc()) {
      ?>
          <div class="row mb-2">
              <div class="card">
                <div class="card-body-text row">
                  <div class="col-md-4">
                    <img src="https://cdn.myanimelist.net/images/anime/<?php echo $row["poster"] ?>" alt="Anime Title" class="img-fluid" width=300 height=400>
                  </div>
                  <div class="col-md-7">
                    <div class="card-body">
                      <h1 class="card-title text-center font-weight-bold"><strong><?php echo $row['title']; ?></strong></h1>
                      <div class="row">
                        <div class="col">
                          <p class="card-text"><strong>Type: </strong><?php echo $row['type']; ?></p>
                          <p class="card-text"><strong>Genre: </strong><?php echo $row['genres']; ?></p>
                          <p class="card-text "><strong>Studios: </strong><?php echo $row['studio']; ?></p>
                          <p class="card-text "><strong>Episodes: </strong><?php echo $row['episodes']; ?></p>
                          <p class="card-text"><strong>Aired: </strong><?php echo $row['from']; ?> - <?php echo $row['to']; ?></p>
                        </div>
                        <div class="col-4">
                          <p class="card-text "><strong>Premiered: </strong><?php echo $row['season']; ?> <?php echo $row['year']; ?></p>
                          <p class="card-text "><strong>Rating: </strong><?php echo $row['rating']; ?></p>
                          <p class="card-text "><strong>Licensors: </strong><?php echo $row['licensor']; ?></p>
                          <p class="card-text "><strong>Source: </strong><?php echo $row['source']; ?></p>
                        </div>
                      </div>
                      <div class="row mt-4">
                      <p class="card-text"><strong>Description: </strong> </strong><?php echo $row['description']; ?></p>
                    </div>
                  </div>
                </div>
              </div>
          </div>
        </div>
      <?php
    }
  }else{
    echo "結果がありません";
  }
?>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
</body>
<?php include 'footer.php';?>



</html>