<?php
/**
 * Enterprise HRM ERP System - Settings
 */

require_once __DIR__ . '/../../includes/init.php';
requireLogin();

$pageTitle = 'Settings';
$currentModule = 'settings';

include __DIR__ . '/../../includes/header.php';
?>

<div class="card">
    <div class="card-header">
        <h2 class="card-title">System Settings</h2>
    </div>
    
    <div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px;">
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/settings.php'">
            <h3 style="margin-bottom: 10px;">⚙️ General Settings</h3>
            <p style="color: var(--text-secondary);">Configure system-wide settings and preferences</p>
        </div>
        
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s; background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/role_management_dashboard.php'">
            <h3 style="margin-bottom: 10px;">🔐 Role & Permission Management</h3>
            <p style="color: rgba(255,255,255,0.9);">Create custom roles, assign permissions, and manage user access</p>
            <div style="display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap;">
                <a href="<?php echo BASE_URL; ?>/admin/role_management_dashboard.php" class="btn" style="background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); text-decoration: none; padding: 8px 16px; border-radius: 4px;">Dashboard</a>
                <a href="<?php echo BASE_URL; ?>/admin/roles.php" class="btn" style="background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); text-decoration: none; padding: 8px 16px; border-radius: 4px;">Roles</a>
                <a href="<?php echo BASE_URL; ?>/admin/users.php" class="btn" style="background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); text-decoration: none; padding: 8px 16px; border-radius: 4px;">Users</a>
            </div>
        </div>
        
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/users.php'">
            <h3 style="margin-bottom: 10px;">👤 User Management</h3>
            <p style="color: var(--text-secondary);">Manage user accounts and assignments</p>
        </div>
        
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; grid-column: 1 / -1;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/sites.php'">
            <h3 style="margin-bottom: 10px;">🏢 Branch Management</h3>
            <p style="opacity: 0.9; margin-bottom: 15px;">Create and manage multiple branches, assign users to branches</p>
            <div style="display: flex; gap: 10px; margin-top: 15px;">
                <a href="<?php echo BASE_URL; ?>/admin/sites.php" class="btn" style="background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); text-decoration: none; padding: 8px 16px; border-radius: 4px;">View All Branches</a>
                <a href="<?php echo BASE_URL; ?>/admin/sites_create.php" class="btn" style="background: rgba(255,255,255,0.3); color: white; border: 1px solid rgba(255,255,255,0.4); text-decoration: none; padding: 8px 16px; border-radius: 4px;">➕ Create New Branch</a>
            </div>
        </div>
        
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/departments.php'">
            <h3 style="margin-bottom: 10px;">🏛️ Departments & Designations</h3>
            <p style="color: var(--text-secondary);">Manage organizational structure</p>
        </div>
        
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/leave_types.php'">
            <h3 style="margin-bottom: 10px;">📋 Leave Types</h3>
            <p style="color: var(--text-secondary);">Configure leave types and policies</p>
        </div>
        
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/salary_components.php'">
            <h3 style="margin-bottom: 10px;">💵 Salary Components</h3>
            <p style="color: var(--text-secondary);">Manage earnings and deductions</p>
        </div>
        
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/inventory_items.php'">
            <h3 style="margin-bottom: 10px;">📦 Inventory Items</h3>
            <p style="color: var(--text-secondary);">Manage inventory items</p>
        </div>
        
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/expense_heads.php'">
            <h3 style="margin-bottom: 10px;">💵 Expense Heads</h3>
            <p style="color: var(--text-secondary);">Manage expense heads for Petty Cash</p>
        </div>
        
        <?php if (canManageHRAdmin()): ?>
        <div class="card" style="padding: 20px; cursor: pointer; transition: transform 0.2s; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white;" 
             onmouseover="this.style.transform='scale(1.02)'" 
             onmouseout="this.style.transform='scale(1)'"
             onclick="window.location.href='<?php echo BASE_URL; ?>/admin/hr_admins.php'">
            <h3 style="margin-bottom: 10px;">👥 HR Admin Management</h3>
            <p style="opacity: 0.9;">Create and manage HR Admins (Super Admin Only)</p>
        </div>
        <?php endif; ?>
    </div>
</div>

<?php include __DIR__ . '/../../includes/footer.php'; ?>

