<table id="example1" class="table table-striped table-bordered">
  <thead>
    <tr>
      <th>#</th>
      <th><?php echo Trans('positions.menu'); ?></th>
      <th><?php echo Trans('positions.for'); ?></th>
      <?php if(UserRole::has('edit_position') || UserRole::has('delete_position')): ?>
      <th><?php echo Trans('dashboard.crud.actions'); ?></th>
      <?php endif; ?>
    </tr>
  </thead>
  <tbody>
    <?php foreach($positions as $position): ?>
      <tr>
        <td><?php echo $position->id; ?></td>
        <td><?php echo $position->name; ?></td>
        <td>
          <?php if(App::getLocale() == "kh"): ?>
            <?php echo getPositionKh($position->for); ?>

          <?php else: ?>
            <?php echo $position->for; ?>

          <?php endif; ?>
        </td>
        <?php if(UserRole::has('edit_position') || UserRole::has('delete_position')): ?>
        <td>
          <?php if(UserRole::has('edit_position')): ?>
          <a href="<?php echo Route("positions.edit",$position->id); ?>" class="btn btn-xs btn-info"><?php echo Trans("dashboard.crud.edit"); ?></a>
          <?php endif; ?>
          <?php if(UserRole::has('delete_position')): ?>
          <a href="#" class="btn btn-xs btn-danger" data-toggle="modal" data-target="#myModal<?php echo $position->id; ?>"><?php echo Trans("dashboard.crud.remove"); ?></a>
          <?php echo $__env->make('layouts.includes.modals.danger', ['model' => $position,'toRoute'=>'positions','attribute'=>'name'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
          <?php endif; ?>
        </td>
        <?php endif; ?>
      </tr>
    <?php endforeach; ?>
  </tbody>
</table>
