File manager - Edit - /var/www/payraty/hris/resources/views/bonus_setups/index.blade.php
Back
@extends('layouts.admin') @section('page-title', __('Bonus Setup')) @section('action-button') <a href="#" data-url="{{ route('bonus-setups.create') }}" data-size="lg" data-ajax-popup="true" data-title="{{ __('Create Bonus Plan') }}" class="btn btn-sm btn-primary"> <i class="ti ti-plus"></i> {{ __('Add Bonus Plan') }} </a> @endsection @section('content') <div class="row"> <div class="col-12"> @include('layouts.hrm_setup') </div> <div class="col-md-12"> <div class="card"> <div class="card-body table-border-style"> <div class="table-responsive"> <table class="table datatable"> <thead> <tr> <th>{{ __('Name') }}</th> <th>{{ __('Bonus Type') }}</th> <th>{{ __('Calculation Type') }}</th> <th>{{ __('Flat Amount') }}</th> <th>{{ __('Target %') }}</th> <th>{{ __('Max %') }}</th> <th>{{ __('Formula') }}</th> <th>{{ __('Notes') }}</th> <th>{{ __('Effective Period') }}</th> <th>{{ __('Status') }}</th> <th class="text-end">{{ __('Actions') }}</th> </tr> </thead> <tbody> @forelse($bonusSetups as $setup) <tr> <td>{{ $setup->name }}</td> <td>{{ ucfirst(str_replace('_', ' ', $setup->bonus_type)) }}</td> <td>{{ ucfirst($setup->calculation_type) }}</td> <td> @if($setup->calculation_type === 'flat') {{ number_format($setup->flat_amount ?? 0, 2) }} @else - @endif </td> <td> @if($setup->calculation_type === 'percentage') {{ $setup->target_percent ?? '-' }}% @else - @endif </td> <td> @if($setup->calculation_type === 'percentage') {{ $setup->max_percent ?? '-' }}% @else - @endif </td> <td> @if($setup->calculation_type === 'formula') {{ $setup->formula ?? '-' }} @else - @endif </td> <td>{{ $setup->notes ?? '-' }}</td> <td> {{ $setup->effective_start ? $setup->effective_start->format('Y-m-d') : '-' }} - {{ $setup->effective_end ? $setup->effective_end->format('Y-m-d') : '-' }} </td> <td> @if($setup->active) <span class="badge bg-success">{{ __('Active') }}</span> @else <span class="badge bg-danger">{{ __('Inactive') }}</span> @endif </td> <td class="text-end"> <div class="action-btn bg-warning ms-2"> <a href="#" data-url="{{ route('bonus-setups.edit', $setup->id) }}" data-size="lg" data-ajax-popup="true" data-title="{{ __('Edit Bonus Plan') }}" class="mx-3 btn btn-sm align-items-center"> <i class="ti ti-pencil text-white"></i> </a> </div> <div class="action-btn bg-danger ms-2"> {!! Form::open(['method' => 'DELETE', 'route' => ['bonus-setups.destroy', $setup->id], 'id' => 'delete-form-' . $setup->id]) !!} <a href="#" class="mx-3 btn btn-sm align-items-center bs-pass-para" data-confirm="{{ __('Are You Sure?') }}" data-confirm-yes="document.getElementById('delete-form-{{ $setup->id }}').submit();"> <i class="ti ti-trash text-white"></i> </a> {!! Form::close() !!} </div> </td> </tr> @empty <tr> <td colspan="11" class="text-center">{{ __('No bonus plans found') }}</td> </tr> @endforelse </tbody> </table> </div> </div> </div> </div> </div> @endsection @push('scripts') <script> document.addEventListener('DOMContentLoaded', () => { function initBonusFormFields(formContainer = document) { const calculationSelect = formContainer.querySelector('#calculation_type'); if (!calculationSelect) return; const formulaSection = formContainer.querySelector('.formula-section'); const flatSection = formContainer.querySelector('.flat-section'); const percentSection = formContainer.querySelector('.percent-section'); const toggleFields = () => { const type = calculationSelect.value; formulaSection?.classList.toggle('d-none', type !== 'formula'); flatSection?.classList.toggle('d-none', type !== 'flat'); percentSection?.classList.toggle('d-none', type !== 'percentage'); }; calculationSelect.removeEventListener('change', toggleFields); calculationSelect.addEventListener('change', toggleFields); toggleFields(); } document.querySelectorAll('form').forEach(form => initBonusFormFields(form)); document.addEventListener('shown.bs.modal', event => { initBonusFormFields(event.target); }); }); </script> @endpush
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings