
<?php $__env->startSection('content'); ?>
<style>
        
    h1 {
        color: #2c3e50;
        border-bottom: 2px solid #eee;
        padding-bottom: 10px;
    }
    
    h2 {
        color: #3498db;
        margin-top: 30px;
    }
    
    .form-section {
        background-color: #f9f9f9;
        padding: 20px;
        border-radius: 5px;
        margin-bottom: 20px;
        border-left: 4px solid #3498db;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    label {
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .required:after {
        content: " *";
        color: red;
    }
    
    input[type="text"], select {
        width: 100%;
        padding: 8px;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-sizing: border-box;
    }
    
    .radio-group {
        display: flex;
        gap: 20px;
        margin-top: 5px;
    }
    
    .radio-option {
        display: flex;
        align-items: center;
    }
    
    .radio-option input {
        margin-right: 5px;
    }
    
    .code-inputs {
        display: flex;
        gap: 10px;
        align-items: center;
    }
    
    .code-inputs input {
        width: 50px;
        text-align: center;
    }
    
    .divider {
        height: 1px;
        background-color: #eee;
        margin: 20px 0;
    }
    
    .save-btn {
        background-color: #3498db;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 16px;
    }
    
    .save-btn:hover {
        background-color: #2980b9;
    }
</style>

<!-- begin::main content -->
<main class="main-content">
    <div class="container">
        <!-- begin::page header -->
        <div class="page-header">
            <h3>Tax</h3>
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Dashboard</a></li>
                    <li class="breadcrumb-item active" aria-current="page">Tax</li>
                </ol>
            </nav>
        </div>
        
        <?php if (isset($component)) { $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\FlashMessage::class, []); ?>
<?php $component->withName('flashMessage'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74)): ?>
<?php $component = $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74; ?>
<?php unset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74); ?>
<?php endif; ?>
        
        <div class="card">
                    
            <div class="card-body">
                <form action="<?php echo e(asset('hrms/add-tax')); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="tax_id" value="<?php echo e(isset($tax) ? $tax->id : ''); ?>">
                    <h2>Organisation Tax Details</h2>
                    
                    <div class="form-section">
                        <div class="form-group">
                            <label for="pan" class="required">PAN</label>
                            <input type="text" id="pan" name="pan_number" placeholder="AZLPK3434P" value="<?php echo e(isset($tax) ? $tax->pan_number : ''); ?>" required>
                        </div>
                        
                        <div class="divider"></div>
                        
                        <div class="form-group">
                            <label>TDS circle / AO code ( )</label>
                            <div class="code-inputs">
                                <input type="text" maxlength="3" name="ao_code_1" value="<?php echo e(isset($tax) ? $tax->ao_code_1 : ''); ?>" placeholder="AAA">
                                <span>/</span>
                                <input type="text" maxlength="2" name="ao_code_2" value="<?php echo e(isset($tax) ? $tax->ao_code_2 : ''); ?>" placeholder="AA">
                                <span>/</span>
                                <input type="text" maxlength="3" name="ao_code_3" value="<?php echo e(isset($tax) ? $tax->ao_code_3 : ''); ?>" placeholder="000">
                                <span>/</span>
                                <input type="text" maxlength="2" name="ao_code_4" value="<?php echo e(isset($tax) ? $tax->ao_code_4 : ''); ?>" placeholder="00">
                            </div>
                        </div>
                        
                        <div class="divider"></div>
                        
                        <h3>Tax Deductor Details</h3>
                        
                        <div class="form-group">
                            <label>Deductor's Type</label>
                            <div class="radio-group">
                                <div class="radio-option">
                                    <input type="radio" id="employee" name="deductor_type" value="employee" <?php echo e(isset($tax) ? ($tax->deductor_type == "employee" ? 'checked': '') : ''); ?> >
                                    <label for="employee">Employee</label>
                                </div>
                                <div class="radio-option">
                                    <input type="radio" id="non-employee" name="deductor_type" value="non_employee" <?php echo e(isset($tax) ? ($tax->deductor_type == "non_employee" ? 'checked': '') : ''); ?>>
                                    <label for="non-employee">Non-Employee</label>
                                </div>
                            </div>
                        </div>
                        
                    </div>
                    
                    <div class="d-flex justify-content-end">
                        <button type="submit" class="btn btn-primary">Save</button>
                    </div>
                    
                    <p><em>* indicates mandatory fields</em></p>
                </form>
            
            </div>
            
        </div>
    </div>
</main>
<!-- end::main content -->
<?php $__env->stopSection(); ?>

<?php $__env->startPush('footer-script'); ?>
<script>
    $(document).ready(function(){
        $(".bonus_status").on("change",function(){
            var bonus_id = $(this).attr("bonus_id");
            var status = $(this).val();
            //alert(claim_id);
            $.ajaxSetup({
                            headers: {
                                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                            }
                        });
            $.ajax({
                type: "post",
                data: {
                    "bonus_id": bonus_id,
                    "status": status
                },
                url: "<?php echo e(asset('hrms/bonus-status-change')); ?>",
                dataType: "html",
                success: function(result) 
                {
                    toastr.success("Status changed successfully !");
                    window.location.reload();
                },
                error: function(error,xhr,status)
                {
                    toastr.error("Failed !");
                    window.location.reload();
                }
            });
        });

        // Trigger file input click
    $('#uploadBtn').click(function(e) {
        e.preventDefault();
        $('#csvFileInput').click();
    });

    // Handle file selection
    $('#csvFileInput').change(function() {
        if (this.files.length > 0) {
            uploadCSV(this.files[0]);
        }
    });

    function uploadCSV(file) {
        let formData = new FormData();
        formData.append('csv_file', file);
        formData.append('_token', $('meta[name="csrf-token"]').attr('content'));

        // Show progress bar
        $('#uploadProgress').show();
        
        $.ajax({
            url: "<?php echo e(asset('hrms/import-bonus')); ?>",
            type: 'POST',
            data: formData,
            processData: false,
            contentType: false,
            
            success: function(response) {
                console.log(response);
                toastr.success('Upload Successfully !');
            },
            error: function(xhr) {
                let err = xhr.responseJSON.message;
                toastr.error(err);
            }
        });
    }
    });
    
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\blurb_erp\resources\views/hrms/tax/list.blade.php ENDPATH**/ ?>