

<?php $__env->startSection('title', 'Maaş Hesaplama'); ?>

<?php $__env->startSection('content'); ?>
<div class="container mx-auto px-4 py-12">
    <div class="max-w-2xl mx-auto">
        <div style="margin-bottom: 24px;">
            <a href="<?php echo e(route('calculators.index')); ?>" style="color: #3b82f6; text-decoration: none; font-weight: 500;">← Hesaplayıcılara Dön</a>
        </div>

        <h1 style="font-size: 32px; font-weight: 700; margin-bottom: 8px; color: #111827;">Askeri Maaş Hesaplama</h1>
        <p style="font-size: 15px; color: #6b7280; margin-bottom: 32px;">Rütbenize ve hizmet yılınıza göre maaş hesaplayın</p>

        <div style="background: white; border-radius: 12px; padding: 28px; border: 1px solid #e5e7eb;">
            <form id="salaryForm" style="display: flex; flex-direction: column; gap: 20px;">
                <div>
                    <label style="display: block; font-weight: 600; font-size: 14px; color: #374151; margin-bottom: 6px;">Rütbe *</label>
                    <select id="rank" required style="width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;">
                        <option value="">Seçiniz</option>
                        <option value="er">Er</option>
                        <option value="astsubay">Astsubay</option>
                        <option value="teğmen">Teğmen</option>
                        <option value="üsteğmen">Üsteğmen</option>
                        <option value="yüzbaşı">Yüzbaşı</option>
                        <option value="binbaşı">Binbaşı</option>
                        <option value="yarbay">Yarbay</option>
                        <option value="albay">Albay</option>
                        <option value="tuğgeneral">Tuğgeneral</option>
                        <option value="orgeneral">Orgeneral</option>
                    </select>
                </div>

                <div>
                    <label style="display: block; font-weight: 600; font-size: 14px; color: #374151; margin-bottom: 6px;">Hizmet Yılı *</label>
                    <input type="number" id="serviceYears" placeholder="5" min="0" max="50" required
                        style="width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;">
                </div>

                <button type="submit" style="background: #3b82f6; color: white; padding: 12px 24px; border-radius: 8px; border: none; font-weight: 600; font-size: 14px; cursor: pointer; margin-top: 12px;">
                    Hesapla
                </button>
            </form>

            <div id="result" style="margin-top: 28px; padding: 20px; background: #f0f9ff; border-radius: 8px; display: none;">
                <h3 style="font-size: 16px; font-weight: 600; color: #111827; margin-bottom: 16px;">Sonucunuz</h3>
                <div style="display: grid; gap: 12px;">
                    <div style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #e5e7eb;">
                        <span style="color: #6b7280;">Taban Maaş:</span>
                        <span id="baseSalaryValue" style="font-weight: 600; color: #111827;">₺0</span>
                    </div>
                    <div style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #e5e7eb;">
                        <span style="color: #6b7280;">Hizmet Yılı Eklentisi:</span>
                        <span id="yearsBonusValue" style="font-weight: 600; color: #111827;">₺0</span>
                    </div>
                    <div style="display: flex; justify-content: space-between; padding: 12px 0; background: #dbeafe; padding: 12px; border-radius: 6px;">
                        <span style="font-weight: 600; color: #111827;">Toplam Maaş:</span>
                        <span id="totalSalaryValue" style="font-weight: 700; color: #3b82f6; font-size: 18px;">₺0</span>
                    </div>
                </div>
            </div>
        </div>

        <div style="margin-top: 32px; padding: 24px; background: #f3f4f6; border-radius: 12px;">
            <p style="font-size: 13px; color: #6b7280; margin: 0;"><strong>Not:</strong> Hesaplanan değerler yaklaşık rakamlardır. Tam maaş bilgisi için resmî kaynaklara başvurunuz.</p>
        </div>
    </div>
</div>

<script>
document.getElementById('salaryForm').addEventListener('submit', function(e) {
    e.preventDefault();
    const rank = document.getElementById('rank').value;
    const serviceYears = parseInt(document.getElementById('serviceYears').value);
    
    const baseSalaries = {
        'er': 8000,
        'astsubay': 12000,
        'teğmen': 15000,
        'üsteğmen': 17000,
        'yüzbaşı': 19000,
        'binbaşı': 21000,
        'yarbay': 23000,
        'albay': 25000,
        'tuğgeneral': 28000,
        'orgeneral': 32000,
    };
    
    const baseSalary = baseSalaries[rank] || 8000;
    const yearsBonus = serviceYears * 100;
    const totalSalary = baseSalary + yearsBonus;
    
    document.getElementById('baseSalaryValue').textContent = '₺' + baseSalary.toLocaleString('tr-TR');
    document.getElementById('yearsBonusValue').textContent = '₺' + yearsBonus.toLocaleString('tr-TR');
    document.getElementById('totalSalaryValue').textContent = '₺' + totalSalary.toLocaleString('tr-TR');
    document.getElementById('result').style.display = 'block';
});
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.public', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\askeribilgiler\resources\views\calculators\salary.blade.php ENDPATH**/ ?>