Files
bildirchin/views/admin/layout_header.php
T

115 lines
6.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= isset($pageTitle) ? htmlspecialchars($pageTitle) . ' | ' : '' ?>پنل مدیریت مزرعه بلدرچین زرین</title>
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
amber: {
500: '#f59e0b',
600: '#d97706',
700: '#b45309',
800: '#92400e'
}
},
fontFamily: {
sans: ['Vazirmatn', 'Tahoma', 'sans-serif']
}
}
}
}
</script>
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
body { font-family: 'Vazirmatn', Tahoma, sans-serif; }
</style>
</head>
<body class="bg-stone-100 text-stone-800 flex h-screen overflow-hidden">
<!-- Sidebar -->
<aside class="w-64 bg-stone-900 text-stone-300 flex flex-col justify-between hidden md:flex border-l border-stone-800">
<div>
<!-- Brand -->
<div class="h-20 flex items-center gap-3 px-6 border-b border-stone-800">
<div class="w-10 h-10 rounded-xl bg-amber-600 text-white flex items-center justify-center font-bold">
<i class="fas fa-feather-alt text-lg"></i>
</div>
<div>
<span class="font-extrabold text-white text-sm block">مدیریت مزرعه</span>
<span class="text-[11px] text-stone-400">بلدرچین زرین</span>
</div>
</div>
<!-- Menu Links -->
<nav class="p-4 space-y-1.5 text-xs font-semibold">
<a href="/admin/dashboard" class="flex items-center gap-3 px-4 py-3 rounded-xl hover:bg-stone-800 hover:text-white transition <?= ($requestUri === '/admin' || $requestUri === '/admin/dashboard') ? 'bg-amber-600 text-white' : '' ?>">
<i class="fas fa-chart-pie w-5 text-center"></i> داشبورد و آمار
</a>
<a href="/admin/orders" class="flex items-center gap-3 px-4 py-3 rounded-xl hover:bg-stone-800 hover:text-white transition <?= (strpos($requestUri, '/admin/order') === 0) ? 'bg-amber-600 text-white' : '' ?>">
<i class="fas fa-shopping-basket w-5 text-center"></i> مدیریت سفارش‌ها
</a>
<a href="/admin/products" class="flex items-center gap-3 px-4 py-3 rounded-xl hover:bg-stone-800 hover:text-white transition <?= (strpos($requestUri, '/admin/product') === 0) ? 'bg-amber-600 text-white' : '' ?>">
<i class="fas fa-box-open w-5 text-center"></i> مدیریت محصولات و نرخ عمده
</a>
<a href="/admin/wholesale-inquiries" class="flex items-center gap-3 px-4 py-3 rounded-xl hover:bg-stone-800 hover:text-white transition <?= (strpos($requestUri, '/admin/wholesale') === 0) ? 'bg-amber-600 text-white' : '' ?>">
<i class="fas fa-handshake w-5 text-center"></i> استعلام‌های عمده‌فروشی
</a>
<a href="/admin/settings" class="flex items-center gap-3 px-4 py-3 rounded-xl hover:bg-stone-800 hover:text-white transition <?= (strpos($requestUri, '/admin/settings') === 0) ? 'bg-amber-600 text-white' : '' ?>">
<i class="fas fa-sliders w-5 text-center"></i> تنظیمات فروشگاه و حساب
</a>
<a href="/" target="_blank" class="flex items-center gap-3 px-4 py-3 rounded-xl hover:bg-stone-800 hover:text-white transition text-stone-400">
<i class="fas fa-arrow-up-right-from-square w-5 text-center"></i> مشاهده وب‌سایت
</a>
</nav>
</div>
<!-- Admin Footer -->
<div class="p-4 border-t border-stone-800">
<a href="/admin/logout" class="flex items-center gap-3 px-4 py-2.5 rounded-xl bg-rose-600/20 hover:bg-rose-600 text-rose-300 hover:text-white transition text-xs font-bold">
<i class="fas fa-power-off"></i> خروج از حساب
</a>
</div>
</aside>
<!-- Main Wrapper -->
<div class="flex-1 flex flex-col overflow-y-auto">
<!-- Top Bar -->
<header class="h-20 bg-white border-b border-stone-200 px-6 flex items-center justify-between sticky top-0 z-30 shadow-sm">
<div class="flex items-center gap-4">
<h2 class="text-base font-extrabold text-stone-900"><?= $pageTitle ?? 'داشبورد' ?></h2>
</div>
<div class="flex items-center gap-4">
<span class="text-xs text-stone-500 font-medium">کاربر مدیر: <?= htmlspecialchars($_SESSION['admin_user']['display_name'] ?? 'مدیر سیستم') ?></span>
<a href="/admin/logout" class="text-xs text-rose-600 hover:underline">خروج</a>
</div>
</header>
<!-- Flash Messages -->
<?php
$successMsg = \Bildirchin\Helpers::flash('success');
$errorMsg = \Bildirchin\Helpers::flash('error');
?>
<?php if ($successMsg): ?>
<div class="mx-6 mt-4 bg-emerald-50 border border-emerald-300 text-emerald-800 px-4 py-3 rounded-xl text-xs font-bold flex justify-between">
<span><i class="fas fa-check-circle ml-1"></i> <?= htmlspecialchars($successMsg) ?></span>
<button onclick="this.parentElement.remove()">×</button>
</div>
<?php endif; ?>
<?php if ($errorMsg): ?>
<div class="mx-6 mt-4 bg-rose-50 border border-rose-300 text-rose-800 px-4 py-3 rounded-xl text-xs font-bold flex justify-between">
<span><i class="fas fa-triangle-exclamation ml-1"></i> <?= htmlspecialchars($errorMsg) ?></span>
<button onclick="this.parentElement.remove()">×</button>
</div>
<?php endif; ?>
<!-- Main Content -->
<main class="p-6 flex-1">