<?php
/**
 * Enterprise HRM ERP System - Payroll Instructions Tab
 * Excel-like Instructions tab with field indicators and rules
 */

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

$pageTitle = 'Payroll Instructions';
$currentModule = 'payroll';
$currentTab = 'instructions';

include __DIR__ . '/../../includes/header.php';
include __DIR__ . '/_navigation.php';

// Get today's date
$todayDate = date('d/m/Y');
?>

<style>
.payroll-instructions-container {
    padding: 20px;
    background: #f5f5f5;
}

.instructions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 15px;
    border-radius: 5px;
}

.today-date-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.today-date-label {
    background: #800080;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
}

.today-date-value {
    background: #800080;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
    min-width: 120px;
}

.field-legend {
    background: white;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.field-legend h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: bold;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 15px;
}

.legend-label {
    font-weight: bold;
    min-width: 150px;
}

.legend-color-box {
    width: 50px;
    height: 30px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.color-optional {
    background: #90EE90; /* Light Green */
}

.color-mandatory {
    background: #FFFF00; /* Yellow */
}

.instructions-content {
    background: white;
    padding: 20px;
    border-radius: 5px;
}

.instructions-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 16px;
    font-weight: bold;
}

.instruction-notes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instruction-note {
    background: #E6E6FA; /* Light Purple */
    color: #DC143C; /* Crimson Red */
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #DC143C;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.6;
}

.instruction-note strong {
    color: #8B0000;
}
</style>

<div class="payroll-instructions-container">
    <!-- Header with Today's Date -->
    <div class="instructions-header">
        <h2>Payroll Instructions</h2>
        <div class="today-date-box">
            <div class="today-date-label">Today's Date</div>
            <div class="today-date-value"><?php echo htmlspecialchars($todayDate); ?></div>
        </div>
        </div>
        
    <!-- Field Legend -->
    <div class="field-legend">
        <h3>Field Type Indicators</h3>
        <div class="legend-item">
            <span class="legend-label">Optional Fields:</span>
            <div class="legend-color-box color-optional"></div>
        </div>
        <div class="legend-item">
            <span class="legend-label">Mandatory Fields:</span>
            <div class="legend-color-box color-mandatory"></div>
        </div>
        </div>
        
    <!-- Instructions Content -->
    <div class="instructions-content">
        <h3>Important Instructions</h3>
        <ul class="instruction-notes">
            <li class="instruction-note">
                <strong>Note 1:</strong> Avoid Cut options in any of the work Sheets
            </li>
            <li class="instruction-note">
                <strong>Note 2:</strong> To Enter Date Enter in DD/MM/YYYY format (2/Jan/2005) Do no Cut or copy and Paste
            </li>
            <li class="instruction-note">
                <strong>Note 3:</strong> While Pasting data from other excel File, use only Paste Special / Values Option
            </li>
            <li class="instruction-note">
                <strong>Note 4:</strong> Before any operation on excel file make sure you are not in Excel Edit mode
            </li>
            <li class="instruction-note">
                <strong>Note 5:</strong> Avoid using enter character (Alt + Enter) in any cell
            </li>
            </ul>
    </div>
</div>

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