Skip to content

Commit

Permalink
started creating user dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
kuldp18 committed Mar 27, 2024
1 parent 4a935d4 commit 12653fa
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 1 deletion.
54 changes: 54 additions & 0 deletions css/user_dashboard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.user_dashboard {
border: 1px solid red;
min-height: calc(100vh - 70px);
display: flex;
flex-direction: column;
padding: 1rem 1.5rem;
align-items: center;
}

.upload {
width: 90%;
}

.upload__videos {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
border: 1px solid yellow;
width: 100%;
}

.video {
border: 1px solid red;
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 1rem;
}

.btn__form {
display: flex;
gap: 1rem;
}

.video__btn {
width: 30px;
height: 30px;
padding: 0.5rem;
background-color: rgb(27, 144, 148);
color: whitesmoke;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}

.video__btn:hover {
opacity: 0.8;
}

.video__views,
.video__ratings {
font-size: 1.25rem;
}
107 changes: 107 additions & 0 deletions pages/user_dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php
require_once "../includes/config_session.inc.php";
?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Quirx - User Dashboard</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="../css/global.css" />
<link rel="stylesheet" href="../css/navbar.css" />
<link rel="stylesheet" href="../css/user_dashboard.css" />
</head>

<body>
<?php include_once('../includes/components/navbar.inc.php') ?>
<?php
// check is user is not logged in
if (!isset($_SESSION['user_id']) || !isset($_SESSION['user_role'])) {
// if not, redirect to home page
header('Location: ../index.php');
exit();
}
$user_name = $_SESSION['user_username'];
?>

<main class="user_dashboard">
<h1 class="heading">Your Dashboard</h1>
<section class="upload">
<h2 class="subheading">Uploaded Videos</h2>
<section class="upload__videos">
<article class="video">
<div class="video__left">
<div class="video__thumbnail">
<img src="../uploads/thumbnails/65f56ebd4a58e6.94540096.png" alt="video_thumbnail">
</div>
<div class="video__views">
Views: 5
</div>
<div class="video__ratings">
Ratings: 10
</div>
</div>

<div class="video__right">
<form action="">
<button type="submit" name="edit">Edit</button>
<button type="submit" name="delete">Delete</button>
</form>
</div>

</article>


<article class="video">
<div class="video__left">
<div class="video__thumbnail">
<img src="../uploads/thumbnails/65f56ebd4a58e6.94540096.png" alt="video_thumbnail">
</div>
<div class="video__views">
Views: 5
</div>
<div class="video__ratings">
Ratings: 10
</div>
</div>

<div class="video__right">
<form action="">
<button type="submit" name="edit">Edit</button>
<button type="submit" name="delete">Delete</button>
</form>
</div>

</article>


<article class="video">
<div class="video__thumbnail">
<img src="../uploads/thumbnails/65f56ebd4a58e6.94540096.png" alt="video_thumbnail">
</div>
<div>
<div class="video__views">
Views: 5
</div>
<div class="video__ratings">
Ratings: 10
</div>
</div>
<form action="" class="btn__form">
<button type="submit" name="edit" class="video__btn video__btn--edit">
<i class="fa-solid fa-pen"></i>
</button>
<button type="submit" name="delete" class="video__btn video__btn--delete">
<i class="fa-solid fa-trash"></i>
</button>
</form>
</article>
</section>
</section>
</main>

</body>

</html>
2 changes: 1 addition & 1 deletion pages/user_profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<?php } ?>
</section>
<a href="./edit_profile.php" class="profile__btn">Edit Profile</a>
<a href="#" class="profile__btn">Dashboard</a>
<a href="./user_dashboard.php" class="profile__btn">Dashboard</a>
</main>
</body>

Expand Down

0 comments on commit 12653fa

Please sign in to comment.