added display of active series on dashboard
This commit is contained in:
+38
-2
@@ -16,16 +16,31 @@ $conn = new mysqli($env["HOST"], $env["DBUSER"], $env["DBPASS"], $env["TABLE"]);
|
||||
if($conn->connect_error) {
|
||||
die("Database connection failed: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
$user_id = $conn->query("SELECT * FROM users WHERE username = '$username'")->fetch_assoc()["id"];
|
||||
|
||||
$table = $conn->query("SELECT * FROM user" . $user_id . " ORDER BY name;");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dashboard - CineTrack</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<style>
|
||||
.left_container {
|
||||
width: 12rem;
|
||||
float: left;
|
||||
}
|
||||
.right_container {
|
||||
float: right;
|
||||
height: 100%;
|
||||
width: calc(50rem - 12rem);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>CineTrack</h1>
|
||||
<h2>Willkommen, <?php echo $username; ?>!</h2>
|
||||
<h2>Welcome, <?php echo $username; ?>!</h2>
|
||||
<a href="logout.php">Logout</a>
|
||||
<br>
|
||||
<h3>Search Movies, Shows and more...</h3>
|
||||
@@ -34,7 +49,28 @@ if($conn->connect_error) {
|
||||
<input value="Search" type="submit">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
// Output the HTML table
|
||||
if ($table->num_rows > 0) {
|
||||
while($row = $table->fetch_assoc()) {
|
||||
echo "<div style='width:50rem;height:25rem;'>";
|
||||
|
||||
<?php $conn->close(); ?>
|
||||
echo "<div class='left_container'><img src='https://image.tmdb.org/t/p/original" . $row["poster"] . "' style='width:12rem;'></div>";
|
||||
echo "<div class='right_container'>";
|
||||
echo $row["overview"];
|
||||
echo "<br>";
|
||||
|
||||
echo "<div style='text-align:center;'>";
|
||||
echo "<form method='post' action='add.php'>";
|
||||
echo "<input value='" . $row["name"] . "' style='width:0;height:0;border:none;padding:0 !important;' name='title' required>";
|
||||
echo "<input type='number' name='season' value='" . $row["season"] . "' min='1' style='width:5ch' required>";
|
||||
echo "<input type='number' name='episode' value='" . $row["episode"] . "' min='1' style='width:5ch' required>";
|
||||
echo "<input type='submit' value='Update'>";
|
||||
echo "</form>";
|
||||
echo "</div></div></div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $conn->close(); ?>
|
||||
|
||||
Reference in New Issue
Block a user