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

<div class="mt5">
    <?php if($type == 2): ?>
    <?php echo $__env->make('admin.objects.components.regist-band-user', ['title' => 'ウェブ管理者一覧'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php elseif($type == 3): ?>
    <?php echo $__env->make('admin.objects.components.regist-band-user', ['title' => 'スタッフ一覧'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php endif; ?>
    <div class="d-flex justify-content-between pager mt10">
    <p class="col-8 c-tab__title">社員一覧</p>
        <!--<div class="d-flex justify-content-end">
            <a href="/admin/staffCreate/3" class="btn_imagesave w120 store_new_btn">新規登録</a>
        </div>-->
    </div>
    <?php echo $__env->make('admin.objects.components.regist-band', ['title' => '社員検索'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <div class="search_vendor mb50">
        <form method="POST" class="enter-off" action="<?php echo e(route('staff-list-search')); ?>" id="test" onkeypress="return event.keyCode != 13;">
        <?php echo e(csrf_field()); ?>

        <dl class="d-flex search_vendor__con">
            <dt>社員氏名</dt>
            <dd><?php echo $__env->make('admin.objects.components.input', ['name' => 'search_name', 'class' => 'w400', 'value' => $search['search_name']?? ''], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?></dd>
        </dl>
        <div class="search_vendor__btn">
        <?php echo $__env->make('admin.objects.components.btn', ['title' => '検索', 'class'=> 'btn_search w120'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <a href="/admin/staffCreate/3" class="btn_imagesave w120 store_new_btn">新規登録</a>

        <a href="javascript:void(0);" class="facility_clear">条件をクリア</a>
        </div>
        </form>
    </div>

    <div class="user_list">
        <input type="hidden" name="" value="<?php echo e(route('staff-sort')); ?>" id="url-staff-sort">
    <?php $__currentLoopData = $staff; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php if(count($row) > 0): ?>
        <div class="mb50">
        <?php echo $__env->make('admin.objects.components.regist-band', ['title' => $row[0]['store_name']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <div class="d-flex justify-content-lg-start pager mt10">
            <!--<div class="m-2">
        <span class="">
            <?php echo e($row[0]['store_name']); ?>

        </span>
      </div>-->
            <div class="m-2">
                <span class="recommend_text_sub">店舗内の範囲で、ドラッグ＆ドロップで並べ替えができます。</span>
            </div>
        </div>
        <table>
            <tr>
                <th class="w50"></th>
                <th class="w125">店舗カテゴリ</th>
                <th class="w150">写真画像</th>
                <th class="w100">社員ID</th>
                <th class="w150">氏名</th>
                <th class="w100">部署</th>
                <th class="w100">役職</th>
                <th class="w125">公開</th>
                <th></th>
            </tr>
            <tbody class="sortable-staff-list">
            <?php $__currentLoopData = $row; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr data-id="<?php echo e($item["id"]); ?>">
                <td><?php echo e($loop->iteration); ?></td>
                <td><?php echo e($item['store_name']); ?></td>
                <td>
                    <div class="flex-center" style="width: 150px; height: 105px">
                        <?php if(!empty($item['file_path'])): ?>
                            <img style="max-height: 100%;" src="<?php echo e($item['file_path']); ?>" />
                        <?php else: ?>
                            <img style="max-height: 100%;" src="<?php echo e(root('img/noimage2.jpg')); ?>" />
                        <?php endif; ?>
                    </div>
                </td>
                <td name="user_id"><?php echo e($item['employee_number']); ?></td>
                <td><span class="user_role">
                  <?php if($item['role']==1): ?>
                  マスター管理者
                  <?php elseif($item['role']==2): ?>
                  ウェブ管理者
                  <?php else: ?>
                  スタッフ
                  <?php endif; ?>
                </span>
                  <?php echo e($item['fullname']); ?></td>
                <td><?php echo e($item['department']); ?></td>
                <td><?php echo e($item['position']); ?></td>
                <td class="text-center">
                    <?php echo $__env->make('admin.objects.components.hidden', ['name' => 'user_id', 'value' => $item['employee_number']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    <?php echo $__env->make('admin.objects.components.switch', ['name' => 'user_disp', 'checked' => $item['disp']], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                </td>
                <?php if($user->role == 1): ?>
                    <td>
                        <div class="d-flex">
                            <?php echo $__env->make('admin.objects.components.link-btn-nostyle', ['name' => 'edit_user', 'url' => '/admin/staffEdit/'.$item['employee_number'], 'class' => 'edit_user_btn', 'title' => '編集'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                            <?php echo $__env->make('admin.objects.components.link-btn-nostyle', ['name' => 'delete_user', 'url' => 'javascript:void(0);', 'class' => 'delete_user del_user_btn', 'title' => '削除'], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        </div>
                    </td>
                <?php endif; ?>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
      </div>
        <?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.base', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>