<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payslip - <?php echo htmlspecialchars($orgName ?? 'Your Company'); ?></title>
<link rel="stylesheet" href="payslip.css">
<link rel="stylesheet" href="assets/font-inter.css">
<link rel="stylesheet" href="assets/font-manrope.css">
<link rel="stylesheet" href="assets/fontawesome/css/all.min.css">
</head>
<body>
<div class="payslip-container">
    <!-- Header Branding -->
    <header class="payslip-header">
        <div class="company-logo">
            <img src="images/b2l_mobitech_pvt_ltd_logo.jpg" alt="B2L Mobitech Pvt Ltd" class="logo">
        </div>
        <div class="company-details">
            <h2><?php echo htmlspecialchars($orgName ?? 'Demo Organisation'); ?></h2>
            <p>Pay Slip for the month of March 2024</p>
        </div>
    </header>

    <!-- Employee Info -->
    <div class="employee-info">
        <div class="info-left">
            <p><strong>Employee Name:</strong> John Doe</p>
            <p><strong>Employee ID:</strong> EMP001</p>
            <p><strong>Department:</strong> Engineering</p>
            <p><strong>Designation:</strong> Software Engineer</p>
        </div>
        <div class="info-right">
            <p><strong>Employee Code:</strong> JD001</p>
            <p><strong>Date of Joining:</strong> 15 Jan 2023</p>
            <p><strong>Pay Period:</strong> 01 Mar 2024 - 31 Mar 2024</p>
        </div>
    </div>

    <!-- Earnings Table -->
    <div class="earnings-section">
        <h3>Earnings</h3>
        <table class="payslip-table">
            <thead>
                <tr>
                    <th>Particulars</th>
                    <th>Amount</th>
                    <th>YTD</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Basic Salary</td>
                    <td>₹30,000</td>
                    <td>₹90,000</td>
                </tr>
                <tr>
                    <td>HRA</td>
                    <td>₹12,000</td>
                    <td>₹36,000</td>
                </tr>
                <tr>
                    <td>Special Allowance</td>
                    <td>₹8,000</td>
                    <td>₹24,000</td>
                </tr>
                <tr class="total-row">
                    <td><strong>Gross Earnings</strong></td>
                    <td><strong>₹50,000</strong></td>
                    <td><strong>₹150,000</strong></td>
                </tr>
            </tbody>
        </table>
    </div>

    <!-- Deductions Table -->
    <div class="deductions-section">
        <h3>Deductions</h3>
        <table class="payslip-table">
            <thead>
                <tr>
                    <th>Particulars</th>
                    <th>Amount</th>
                    <th>YTD</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Provident Fund</td>
                    <td>₹1,800</td>
                    <td>₹5,400</td>
                </tr>
                <tr>
                    <td>Professional Tax</td>
                    <td>₹200</td>
                    <td>₹600</td>
                </tr>
                <tr>
                    <td>Income Tax (TDS)</td>
                    <td>₹2,500</td>
                    <td>₹7,500</td>
                </tr>
                <tr class="total-row">
                    <td><strong>Total Deductions</strong></td>
                    <td><strong>₹4,500</strong></td>
                    <td><strong>₹13,500</strong></td>
                </tr>
            </tbody>
        </table>
    </div>

    <!-- Net Pay Summary -->
    <div class="net-pay-section">
        <table class="summary-table">
            <tr>
                <td>Gross Earnings</td>
                <td>₹50,000</td>
            </tr>
            <tr>
                <td>Total Deductions</td>
                <td>₹4,500</td>
            </tr>
            <tr class="net-row">
                <td><strong>Net Pay</strong></td>
                <td><strong>₹45,500</strong></td>
            </tr>
        </table>
    </div>

    <!-- Footer -->
    <footer class="payslip-footer">
        <div class="left-footer">
            <p><strong>This is a computer generated payslip and does not require signature.</strong></p>
            <p>Payroll processed on 05 Apr 2024 | Payroll ID: PAY-2024-001</p>
        </div>
        <div class="right-footer">
            <div class="signature">
                <p>Authorized Signatory</p>
                <div class="signature-line"></div>
            </div>
        </div>
    </footer>

    <!-- Print Button -->
    <div class="print-actions">
        <button onclick="window.print()" class="print-btn">
            <i class="fa-solid fa-print"></i> Print Payslip
        </button>
        <button onclick="window.close()" class="close-btn">
            Close
        </button>
    </div>
</div>

<?php if (isset($conn)) $conn->close(); ?>
</body>
</html>
