212 lines
12 KiB
PHP
212 lines
12 KiB
PHP
@extends('layouts.app')
|
||
@section('title', '[東京都|〇〇駐輪場] 駐輪場管理者マスタ')
|
||
|
||
@section('content')
|
||
<div class="content-header">
|
||
<div class="container-fluid">
|
||
<div class="row mb-2">
|
||
<div class="col-lg-6">
|
||
<h1 class="m-0 text-dark">{{ __('駐輪場管理者マスタ') }}</h1>
|
||
</div>
|
||
<div class="col-lg-6">
|
||
<ol class="breadcrumb float-sm-right text-sm">
|
||
<li class="breadcrumb-item"><a href="{{ route('home') }}">XX様info(ホーム)</a></li>
|
||
<li class="breadcrumb-item"><a href="javascript: void(0);">[東京都|〇〇駐輪場]</a></li>
|
||
<li class="breadcrumb-item active">{{ __('駐輪場管理者マスタ') }}</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<section class="content">
|
||
<div class="container-fluid">
|
||
|
||
<div class="row">
|
||
{{-- 並び替え用 --}}
|
||
<form action="{{ route('managers') }}" method="post" id="list-form">
|
||
@csrf
|
||
<input type="hidden" value="{{ $sort }}" name="sort" id="sort">
|
||
<input type="hidden" value="{{ $sort_type }}" name="sort_type" id="sort_type">
|
||
</form>
|
||
|
||
<div class="container-fluid mb20">
|
||
{{-- 新規 --}}
|
||
<a href="{{ route('managers_add') }}" class="btn btn-sm btn-default mr10">
|
||
{{ __('新規') }}
|
||
</a>
|
||
{{-- 削除(左侧勾选后提交下方 form_delete) --}}
|
||
<button type="submit" class="btn btn-sm btn-default mr10" id="delete" form="form_delete">
|
||
{{ __('削除') }}
|
||
</button>
|
||
|
||
{{ $list->appends(['sort' => $sort, 'sort_type' => $sort_type])->links('pagination') }}
|
||
</div>
|
||
|
||
<div class="form col-lg-12">
|
||
@if(Session::has('success'))
|
||
<div class="alert alert-success alert-dismissible" role="alert">
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||
{{ Session::get('success') }}
|
||
</div>
|
||
@elseif(Session::has('error'))
|
||
<div class="alert alert-danger alert-dismissible">
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||
<h4><i class="icon fa fa-ban"></i> {{ __('誤差') }}:</h4>
|
||
{!! Session::get('error') !!}
|
||
</div>
|
||
@elseif(isset($errorMsg))
|
||
<div class="alert alert-danger alert-dismissible">
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||
<h4><i class="icon fa fa-ban"></i> {{ __('誤差') }}:</h4>
|
||
{!! $errorMsg !!}
|
||
</div>
|
||
@endif
|
||
</div>
|
||
|
||
<div class="col-lg-12 row sample03-wrapper no_padding_right mb20">
|
||
{{-- 左:チェック&操作 --}}
|
||
<div class="col-xl-2 col-lg-2 col-md-2 col-sm-3 col-xs-3 table_left">
|
||
<form action="{{ route('managers_delete') }}" method="post" id="form_delete">
|
||
@csrf
|
||
<table class="table dataTable">
|
||
<thead>
|
||
<tr>
|
||
<th>
|
||
<input type="checkbox" class="minimal m-0" id="checkbox_all">
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($list as $item)
|
||
<tr role="row">
|
||
<td>
|
||
<input type="checkbox" class="minimal m-0 checkbox"
|
||
value="{{ $item->manager_id }}" name="pk[]">
|
||
<div class="btn_action">
|
||
{{-- <a href="{{ route('managers_add') }}" class="btn btn-sm btn-default">詳細</a> --}}
|
||
<a href="{{ route('managers_info', ['manager_id' => $item->manager_id]) }}"
|
||
class="btn btn-sm btn-default ml10">{{ __('編集') }}</a>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</form>
|
||
</div>
|
||
|
||
{{-- 右:一覧テーブル --}}
|
||
<div class="col-lg-10 col-xl-10 col-md-10 col-sm-9 col-xs-9 table_right no_padding_right">
|
||
<div class="scroll">
|
||
<table class="table dataTable">
|
||
<thead>
|
||
<tr>
|
||
{{-- 駐車場管理者ID --}}
|
||
<th class="sorting @if($sort=='manager_id'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif"
|
||
sort="manager_id"><span>{{ __('validation.attributes.manager_id') }}</span></th>
|
||
|
||
{{-- 駐車場管理者名 --}}
|
||
<th class="sorting @if($sort=='manager_name'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif"
|
||
sort="manager_name"><span>{{ __('validation.attributes.manager_name') }}</span></th>
|
||
|
||
{{-- 種別 --}}
|
||
<th><span>{{ __('validation.attributes.manager_type') }}</span></th>
|
||
|
||
{{-- 所属駐車場ID --}}
|
||
<th class="sorting @if($sort=='manager_parkid'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif"
|
||
sort="manager_parkid"><span>{{ __('validation.attributes.manager_parkid') }}</span></th>
|
||
|
||
{{-- 管理デバイス1/2 --}}
|
||
<th><span>{{ __('validation.attributes.manager_device1') }}</span></th>
|
||
<th><span>{{ __('validation.attributes.manager_device2') }}</span></th>
|
||
|
||
{{-- メール --}}
|
||
<th><span>{{ __('validation.attributes.manager_mail') }}</span></th>
|
||
|
||
{{-- 電話 --}}
|
||
<th class="sorting @if($sort=='manager_tel'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif"
|
||
sort="manager_tel"><span>{{ __('validation.attributes.manager_tel') }}</span></th>
|
||
|
||
{{-- アラート1(★sort 修正済) --}}
|
||
<th class="sorting @if($sort=='manager_alert1'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif"
|
||
sort="manager_alert1"><span>{{ __('validation.attributes.manager_alert1') }}</span></th>
|
||
|
||
{{-- アラート2 --}}
|
||
<th class="sorting @if($sort=='manager_alert2'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif"
|
||
sort="manager_alert2"><span>{{ __('validation.attributes.manager_alert2') }}</span></th>
|
||
|
||
{{-- 退職フラグ --}}
|
||
<th class="sorting @if($sort=='manager_quit_flag'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif"
|
||
sort="manager_quit_flag"><span>{{ __('validation.attributes.manager_quit_flag') }}</span></th>
|
||
|
||
{{-- 退職日 --}}
|
||
<th><span>{{ __('validation.attributes.manager_quitday') }}</span></th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
@foreach($list as $item)
|
||
<tr>
|
||
<td class='sm-item text-left'>
|
||
<span>{{ mb_substr($item->manager_id, 0, 10) }}</span>
|
||
</td>
|
||
<td class='sm-item text-right'>
|
||
<span>{{ mb_substr($item->manager_name, 0, 10) }}</span>
|
||
</td>
|
||
<td class='sm-item text-left'>
|
||
<span>{{ mb_substr($item->manager_type, 0, 10) }}</span>
|
||
</td>
|
||
<td class='sm-item text-right'>
|
||
<span>{{ mb_substr(!empty($item->getPark()) ? $item->getPark()->park_name : "", 0, 10) }}</span>
|
||
</td>
|
||
<td class='sm-item text-right'>
|
||
<span>{{ mb_substr(!empty($item->getDevice1()) ? $item->getDevice1()->device_subject : "", 0, 10) }}</span>
|
||
</td>
|
||
<td class='sm-item text-right'>
|
||
<span>{{ mb_substr(!empty($item->getDevice2()) ? $item->getDevice2()->device_subject : "", 0, 10) }}</span>
|
||
</td>
|
||
<td class='sm-item text-left'>
|
||
<span>{{ mb_substr($item->manager_mail, 0, 20) }}</span>
|
||
</td>
|
||
<td class='sm-item text-left'>
|
||
<span>{{ mb_substr($item->manager_tel, 0, 20) }}</span>
|
||
</td>
|
||
<td class='sm-item text-left'>
|
||
<span>{{ mb_substr($item->manager_alert1, 0, 20) }}</span>
|
||
</td>
|
||
<td class='sm-item text-left'>
|
||
<span>{{ mb_substr($item->manager_alert2, 0, 20) }}</span>
|
||
</td>
|
||
<td class='sm-item text-left'>
|
||
<span>{{ $item->getManagerQuitFlagDisplay() }}</span>
|
||
</td>
|
||
<td class='sm-item text-right'>
|
||
@if($item->manager_quitday)
|
||
<span class="text-muted"><i class="fa fa-clock-o mr-1"></i>
|
||
{{ mb_substr($item->manager_quitday, 0, 10) }}
|
||
</span>
|
||
@endif
|
||
</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<script>
|
||
// 全選択
|
||
document.getElementById('checkbox_all')?.addEventListener('change', function () {
|
||
const checks = document.querySelectorAll('#form_delete .checkbox');
|
||
checks.forEach(ch => ch.checked = this.checked);
|
||
});
|
||
</script>
|
||
@endsection
|