undefined / admin.html
pradipp's picture
Help me with all articles posted here. The article will be posted here based on the date. Its should be approved from admin page so that we can connect and managed from there
fd019a4 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard | AI Byte</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
.font-space { font-family: 'Space Grotesk', sans-serif; }
.gradient-text {
background: linear-gradient(90deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<!-- Navigation -->
<nav class="bg-white/80 backdrop-blur-md border-b border-gray-200 fixed w-full z-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<a href="index.html" class="text-2xl font-bold gradient-text font-space">AI Byte</a>
</div>
</div>
<div class="hidden md:ml-6 md:flex md:items-center md:space-x-8">
<a href="index.html" class="text-gray-500 hover:text-purple-600 px-3 py-2 rounded-md text-sm font-medium">Home</a>
<a href="articles.html" class="text-gray-500 hover:text-purple-600 px-3 py-2 rounded-md text-sm font-medium">Articles</a>
<a href="tutorials.html" class="text-gray-500 hover:text-purple-600 px-3 py-2 rounded-md text-sm font-medium">Tutorials</a>
<a href="research.html" class="text-gray-500 hover:text-purple-600 px-3 py-2 rounded-md text-sm font-medium">Research Papers</a>
<a href="about.html" class="text-gray-500 hover:text-purple-600 px-3 py-2 rounded-md text-sm font-medium">About</a>
<a href="admin.html" class="text-gray-900 hover:text-purple-600 px-3 py-2 rounded-md text-sm font-medium">Admin</a>
<button class="bg-gradient-to-r from-purple-600 to-indigo-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:opacity-90 transition">Logout</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<section class="pt-32 pb-20 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto">
<h1 class="text-3xl font-bold text-gray-900 font-space mb-8">Admin Dashboard</h1>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white p-6 rounded-xl shadow-sm">
<h3 class="text-lg font-medium text-gray-900 mb-4">Article Management</h3>
<div class="space-y-4">
<a href="#article-section" class="block w-full bg-purple-600 hover:bg-purple-700 text-white py-2 px-4 rounded-md text-center transition">Manage Articles</a>
<a href="#new-article" class="block w-full border border-purple-600 text-purple-600 hover:bg-purple-50 py-2 px-4 rounded-md text-center transition">Create New Article</a>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-sm">
<h3 class="text-lg font-medium text-gray-900 mb-4">Content Statistics</h3>
<div class="space-y-3">
<div class="flex justify-between">
<span class="text-gray-600">Total Articles</span>
<span class="font-medium">42</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Pending Approval</span>
<span class="font-medium text-yellow-600">3</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Published Today</span>
<span class="font-medium">2</span>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-sm">
<h3 class="text-lg font-medium text-gray-900 mb-4">Quick Actions</h3>
<div class="space-y-4">
<a href="#" class="block w-full border border-gray-300 hover:bg-gray-50 py-2 px-4 rounded-md text-center transition">View Subscribers</a>
<a href="#" class="block w-full border border-gray-300 hover:bg-gray-50 py-2 px-4 rounded-md text-center transition">Site Analytics</a>
</div>
</div>
</div>
<!-- Article Management Section -->
<div id="article-section" class="bg-white rounded-xl shadow-sm p-6 mb-8">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-900">Article Management</h2>
<div class="flex space-x-4">
<div class="relative">
<select class="appearance-none bg-white border border-gray-300 rounded-md py-2 pl-3 pr-8 text-sm focus:outline-none focus:ring-purple-600 focus:border-purple-600">
<option>Filter by Status</option>
<option>Published</option>
<option>Pending</option>
<option>Draft</option>
</select>
<i data-feather="chevron-down" class="absolute right-3 top-2.5 text-gray-400 w-4 h-4"></i>
</div>
<div class="relative">
<select class="appearance-none bg-white border border-gray-300 rounded-md py-2 pl-3 pr-8 text-sm focus:outline-none focus:ring-purple-600 focus:border-purple-600">
<option>Sort by Date</option>
<option>Newest First</option>
<option>Oldest First</option>
</select>
<i data-feather="chevron-down" class="absolute right-3 top-2.5 text-gray-400 w-4 h-4"></i>
</div>
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Title</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Author</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Category</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<!-- Article 1 -->
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="font-medium text-gray-900">Transformers in NLP</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-gray-900">Dr. Sarah Chen</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-purple-100 text-purple-800">Machine Learning</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Published</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">May 15, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<a href="#" class="text-purple-600 hover:text-purple-900 mr-3">Edit</a>
<a href="#" class="text-red-600 hover:text-red-900">Delete</a>
</td>
</tr>
<!-- Article 2 -->
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="font-medium text-gray-900">Diffusion Models</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-gray-900">Alex Rodriguez</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">Computer Vision</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Published</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Apr 28, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<a href="#" class="text-purple-600 hover:text-purple-900 mr-3">Edit</a>
<a href="#" class="text-red-600 hover:text-red-900">Delete</a>
</td>
</tr>
<!-- Article 3 (Pending) -->
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="font-medium text-gray-900">Ethics of Generative AI</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-gray-900">Prof. James Wilson</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-indigo-100 text-indigo-800">AI Ethics</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">Pending</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Jun 2, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<a href="#" class="text-purple-600 hover:text-purple-900 mr-3">Review</a>
<a href="#" class="text-red-600 hover:text-red-900">Delete</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- New Article Form -->
<div id="new-article" class="bg-white rounded-xl shadow-sm p-6">
<h2 class="text-xl font-bold text-gray-900 mb-6">Create New Article</h2>
<form>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="col-span-2">
<label for="title" class="block text-sm font-medium text-gray-700 mb-1">Article Title</label>
<input type="text" id="title" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-purple-600 focus:border-purple-600">
</div>
<div>
<label for="category" class="block text-sm font-medium text-gray-700 mb-1">Category</label>
<select id="category" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-purple-600 focus:border-purple-600">
<option>Select Category</option>
<option>Machine Learning</option>
<option>Computer Vision</option>
<option>Natural Language Processing</option>
<option>AI Ethics</option>
<option>Research</option>
</select>
</div>
<div>
<label for="author" class="block text-sm font-medium text-gray-700 mb-1">Author</label>
<select id="author" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-purple-600 focus:border-purple-600">
<option>Select Author</option>
<option>Dr. Sarah Chen</option>
<option>Alex Rodriguez</option>
<option>Prof. James Wilson</option>
</select>
</div>
<div class="col-span-2">
<label for="featured-image" class="block text-sm font-medium text-gray-700 mb-1">Featured Image</label>
<input type="file" id="featured-image" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-purple-600 focus:border-purple-600">
</div>
<div class="col-span-2">
<label for="content" class="block text-sm font-medium text-gray-700 mb-1">Content</label>
<textarea id="content" rows="10" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-purple-600 focus:border-purple-600"></textarea>
</div>
<div class="col-span-2">
<label for="excerpt" class="block text-sm font-medium text-gray-700 mb-1">Excerpt</label>
<textarea id="excerpt" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-purple-600 focus:border-purple-600"></textarea>
</div>
<div>
<label for="status" class="block text-sm font-medium text-gray-700 mb-1">Status</label>
<select id="status" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-purple-600 focus:border-purple-600">
<option value="draft">Draft</option>
<option value="pending">Pending Review</option>
<option value="published">Publish Immediately</option>
</select>
</div>
<div>
<label for="publish-date" class="block text-sm font-medium text-gray-700 mb-1">Publish Date</label>
<input type="date" id="publish-date" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-purple-600 focus:border-purple-600">
</div>
</div>
<div class="mt-8 flex justify-end space-x-4">
<button type="button" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-600">Save Draft</button>
<button type="submit" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-600">Publish Article</button>
</div>
</form>
</div>
</section>
<script>
feather.replace();
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel | AI Byte</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
.font-space { font-family: 'Space Grotesk', sans-serif; }
.gradient-text {
background: linear-gradient(90deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<!-- Navigation -->
<nav class="bg-white/80 backdrop-blur-md border-b border-gray-200 fixed w-full z-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<a href="index.html" class="text-2xl font-bold gradient-text font-space">AI Byte</a>
</div>
</div>
<div class="hidden md:ml-6 md:flex md:items-center md:space-x-8">
<a href="index.html" class="text-gray-500 hover:text-purple-600 px-3 py-2 rounded-md text-sm font-medium">Home</a>
<a href="admin.html" class="text-gray-900 hover:text-purple-600 px-3 py-2 rounded-md text-sm font-medium">Admin</a>
</div>
</div>
</div>
</nav>
<!-- Admin Content -->
<section class="pt-32 pb-20 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto">
<h1 class="text-3xl font-bold text-gray-900 mb-8 font-space">Admin Panel</h1>
<!-- Article Management -->
<div class="bg-white p-6 rounded-xl shadow-md mb-8">
<h2 class="text-xl font-bold text-gray-900 mb-4">Manage Articles</h2>
<!--
Database Form Example:
This form would submit to a PHP handler to insert into MySQL:
<form action="/api/create_article.php" method="POST" enctype="multipart/form-data">
<div class="mb-4">
<label class="block text-gray-700 mb-2">Title</label>
<input type="text" name="title" class="w-full px-3 py-2 border rounded">
</div>
<div class="mb-4">
<label class="block text-gray-700 mb-2">Content</label>
<textarea name="content" class="w-full px-3 py-2 border rounded" rows="6"></textarea>
</div>
<div class="mb-4">
<label class="block text-gray-700 mb-2">Category</label>
<select name="category" class="w-full px-3 py-2 border rounded">
<option value="machine-learning">Machine Learning</option>
<option value="computer-vision">Computer Vision</option>
</select>
</div>
<div class="mb-4">
<label class="block text-gray-700 mb-2">Featured Image</label>
<input type="file" name="image" class="w-full">
</div>
<button type="submit" class="bg-purple-600 text-white px-4 py-2 rounded">Create Article</button>
</form>
The PHP handler (create_article.php) would:
1. Connect to MySQL
2. Sanitize inputs
3. Handle file upload
4. Insert into articles table
5. Return success/error response
-->
<div class="mt-4">
<h3 class="font-medium mb-2">Existing Articles</h3>
<!--
Database Table Example:
This would show paginated articles from database:
<?php
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT id, title, category, created_at FROM articles ORDER BY created_at DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo '<table class="w-full">';
echo '<tr><th class="text-left">Title</th><th class="text-left">Category</th><th class="text-left">Date</th><th>Actions</th></tr>';
while($row = $result->fetch_assoc()) {
echo '<tr>';
echo '<td>'.$row['title'].'</td>';
echo '<td>'.$row['category'].'</td>';
echo '<td>'.date('M j, Y', strtotime($row['created_at'])).'</td>';
echo '<td class="text-center">
<a href="/api/edit_article.php?id='.$row['id'].'" class="text-blue-600">Edit</a> |
<a href="/api/delete_article.php?id='.$row['id'].'" class="text-red-600">Delete</a>
</td>';
echo '</tr>';
}
echo '</table>';
}
$conn->close();
?>
-->
</div>
</div>
</section>
<script>
feather.replace();
</script>
</body>
</html>