<?php $__env->startSection('page-title'); ?>
<?php echo e(__('Manage Rating Types')); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
<li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>"><?php echo e(__('Home')); ?></a></li>
<li class="breadcrumb-item"><?php echo e(__('Rating Types')); ?></li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('action-button'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
    
    <div class="col-12">
        <?php echo $__env->make('layouts.hrm_setup', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    </div>

    <div class="col-12">
        <div class="my-3 d-flex justify-content-end">
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Goal Type')): ?>
            <a href="#"
                data-url="<?php echo e(route('rating-types.create')); ?>"
                data-ajax-popup="true"
                data-title="<?php echo e(__('Create New Rating Type')); ?>"
                class="btn btn-sm btn-primary"
                data-bs-toggle="tooltip"
                title="<?php echo e(__('Create')); ?>">
                <i class="ti ti-plus"></i>
            </a>
            <?php endif; ?>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <div class="card">
                    <div class="card-body table-border-style">
                        <div class="table-responsive">
                            <table class="table datatable">
                                <thead>
                                    <tr>
                                        <th><?php echo e(__('Name')); ?></th>
                                        <th><?php echo e(__('Type')); ?></th>
                                        <th><?php echo e(__('Is Visible To Employee')); ?></th>
                                        <th width="200px"><?php echo e(__('Action')); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $ratingTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ratingType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($ratingType->name); ?></td>
                                        <td class="text-capitalize"><?php echo e($ratingType->type); ?></td>
                                        <td>
                                            <?php if($ratingType->is_visible_to_employee): ?>
                                            <span class="badge bg-success"><?php echo e(__('Yes')); ?></span>
                                            <?php else: ?>
                                            <span class="badge bg-secondary"><?php echo e(__('No')); ?></span>
                                            <?php endif; ?>
                                        </td>

                                        <td class="Action">
                                            <div class="dt-buttons">
                                                <span class="float-start">

                                                    <div class="action-btn me-2">
                                                        
                                                        <a href="#" class="btn btn-sm bg-success"
                                                            data-url="<?php echo e(route('rating_types.metrics.index', $ratingType->id)); ?>"
                                                            data-ajax-popup="true"
                                                            data-title="<?php echo e(__('Manage Metrics for: ') . $ratingType->name); ?>">
                                                            <i class="ti ti-chart-bar"></i>
                                                        </a>
                                                    </div>

                                                    <div class="action-btn me-2">
                                                        <a href="#"
                                                            class="btn btn-sm bg-info"
                                                            data-url="<?php echo e(route('rating-types.edit', $ratingType->id)); ?>"
                                                            data-ajax-popup="true"
                                                            data-title="<?php echo e(__('Edit Rating Type')); ?>"
                                                            data-bs-toggle="tooltip"
                                                            title="<?php echo e(__('Edit')); ?>">
                                                            <i class="ti ti-pencil text-white"></i>
                                                        </a>
                                                    </div>

                                                    <div class="action-btn">
                                                        <?php echo Form::open([
                                                        'method' => 'DELETE',
                                                        'route' => ['rating-types.destroy', $ratingType->id],
                                                        'id' => 'delete-form-' . $ratingType->id,
                                                        ]); ?>

                                                        <a href="#"
                                                            class="btn btn-sm bg-danger align-items-center bs-pass-para"
                                                            data-bs-toggle="tooltip"
                                                            title="<?php echo e(__('Delete')); ?>">
                                                            <i class="ti ti-trash text-white"></i>
                                                        </a>
                                                        <?php echo Form::close(); ?>

                                                    </div>

                                                </span>
                                            </div>
                                        </td>
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>

                            
                            <div class="mt-3">
                                <?php echo e($ratingTypes->links()); ?>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/payraty/hris/resources/views/rating_types/index.blade.php ENDPATH**/ ?>