NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard | E-Commerce</title>
<style>
* {
margin: 0; padding: 0; box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}

body {
background: #f1f3f6;
}

/* Sidebar */
.sidebar {
position: fixed;
left: 0;
top: 0;
width: 220px;
height: 100%;
background: #2874f0;
color: white;
padding-top: 20px;
}

.sidebar h2 {
text-align: center;
margin-bottom: 30px;
font-size: 22px;
}

.sidebar ul {
list-style: none;
}

.sidebar ul li {
padding: 15px 20px;
cursor: pointer;
border-bottom: 1px solid rgba(255,255,255,0.1);
transition: 0.3s;
}

.sidebar ul li:hover {
background: rgba(255,255,255,0.1);
}

/* Main content */
.main {
margin-left: 220px;
padding: 20px;
}

.navbar {
height: 60px;
background: white;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
border-radius: 8px;
margin-bottom: 20px;
}

.navbar h3 {
color: #2874f0;
}

.stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
}

.card {
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
text-align: center;
transition: 0.3s;
}

.card:hover {
transform: translateY(-5px);
}

.card h4 {
color: #555;
margin-bottom: 10px;
}

.card p {
font-size: 24px;
font-weight: bold;
color: #2874f0;
}

.logout-btn {
background: #fb641b;
border: none;
color: white;
padding: 8px 14px;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
}

.logout-btn:hover {
background: #e55b12;
}

@media(max-width:768px){
.sidebar{
width: 100%;
height: auto;
position: relative;
}
.main{
margin-left: 0;
}
.stats{
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>

<!-- Sidebar -->
<div class="sidebar">
<h2>Admin Panel</h2>
<ul>
<li>Dashboard</li>
<li>Users</li>
<li>Orders</li>
<li>Products</li>
<li>Settings</li>
</ul>
</div>

<!-- Main Content -->
<div class="main">
<!-- Navbar -->
<div class="navbar">
<h3>Welcome, {{ request.session.admin_user }}</h3>
<a href="{% url 'logout' %}"><button class="logout-btn">Logout</button></a>
</div>

<!-- Stats Cards -->
<div class="stats">
<div class="card">
<h4>Total Users</h4>
<p>{{ total_users }}</p>
</div>
<div class="card">
<h4>Total Orders</h4>
<p>{{ total_orders }}</p>
</div>
<div class="card">
<h4>Total Products</h4>
<p>{{ total_products }}</p>
</div>
<div class="card">
<h4>New Signups</h4>
<p>{{ new_signups }}</p>
</div>
</div>
</div>

</body>
</html>



from .models import Customer

# For demonstration, placeholders for orders/products
def admin_dashboard_view(request):
if not request.session.get('admin_user'):
return redirect('admin_login')

total_users = Customer.objects.count()
total_orders = 50 # Replace with your Order model count
total_products = 20 # Replace with your Product model count
new_signups = Customer.objects.filter(created_at__gte='2025-10-01').count() # Example filter

context = {
'total_users': total_users,
'total_orders': total_orders,
'total_products': total_products,
'new_signups': new_signups
}
return render(request, 'admin_dashboard.html', context)
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.