This commit is contained in:
parent
0a5e21cd9a
commit
b22cc34379
@ -31,7 +31,7 @@
|
||||
{{-- ▼ ボタンエリア(上部) --}}
|
||||
<div class="mt-2">
|
||||
<button type="button" class="btn btn-default mt-2 btn-submit">登録</button>
|
||||
<a href="{{ route('reduction_confirm.index', ['park_id' => $park->park_id]) }}" class="btn btn-default mt-2">
|
||||
<a href="{{ route('reduction_confirm.list', ['park_id' => $park->park_id]) }}" class="btn btn-default mt-2">
|
||||
減免確認編集
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="btn btn-default mt-2">駐輪状況編集</a>
|
||||
|
||||
@ -3,10 +3,12 @@
|
||||
// reduction_confirm テーブルから取得したレコード
|
||||
$userCategoryId = $row->user_categoryid;
|
||||
$checkType = $row->reduction_confirm_type;
|
||||
$oldCheckType = old("reduction_confirm_type.$userCategoryId", $checkType);
|
||||
// use numeric index passed from parent to avoid name collisions when duplicate user_categoryid exist
|
||||
$idx = $index ?? ($userCategoryId);
|
||||
$oldCheckType = old("reduction_confirm_type.$idx", $checkType);
|
||||
|
||||
// 学生分類かどうかを判定
|
||||
$isStudent = $row->usertype_subject1 === '学生';
|
||||
$isStudent = ($row->usertype_subject1 ?? '') === '学生';
|
||||
$rowClass = $isStudent ? 'table-secondary' : '';
|
||||
$isDisabled = $isStudent;
|
||||
@endphp
|
||||
@ -17,17 +19,19 @@
|
||||
<td>{{ $row->usertype_subject2 ?? '-' }}</td>
|
||||
<td>{{ $row->usertype_subject3 ?? '-' }}</td>
|
||||
<td>
|
||||
{{-- hidden mapping to know which user_categoryid this input row targets --}}
|
||||
<input type="hidden" name="row_user_categoryid[{{ $idx }}]" value="{{ $userCategoryId }}">
|
||||
<div class="d-flex justify-content-center gap-3">
|
||||
{{-- 確認しない(0) --}}
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio"
|
||||
id="check_type_{{ $userCategoryId }}_0"
|
||||
name="reduction_confirm_type[{{ $userCategoryId }}]"
|
||||
id="check_type_{{ $idx }}_0"
|
||||
name="reduction_confirm_type[{{ $idx }}]"
|
||||
value="0"
|
||||
class="custom-control-input"
|
||||
@checked($oldCheckType == 0)
|
||||
@disabled($isDisabled)>
|
||||
<label class="custom-control-label" for="check_type_{{ $userCategoryId }}_0">
|
||||
<label class="custom-control-label" for="check_type_{{ $idx }}_0">
|
||||
確認しない
|
||||
</label>
|
||||
</div>
|
||||
@ -35,13 +39,13 @@
|
||||
{{-- 年1回(1) --}}
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio"
|
||||
id="check_type_{{ $userCategoryId }}_1"
|
||||
name="reduction_confirm_type[{{ $userCategoryId }}]"
|
||||
id="check_type_{{ $idx }}_1"
|
||||
name="reduction_confirm_type[{{ $idx }}]"
|
||||
value="1"
|
||||
class="custom-control-input"
|
||||
@checked($oldCheckType == 1)
|
||||
@disabled($isDisabled)>
|
||||
<label class="custom-control-label" for="check_type_{{ $userCategoryId }}_1">
|
||||
<label class="custom-control-label" for="check_type_{{ $idx }}_1">
|
||||
年1回
|
||||
</label>
|
||||
</div>
|
||||
@ -49,13 +53,13 @@
|
||||
{{-- 毎更新時(2) --}}
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio"
|
||||
id="check_type_{{ $userCategoryId }}_2"
|
||||
name="reduction_confirm_type[{{ $userCategoryId }}]"
|
||||
id="check_type_{{ $idx }}_2"
|
||||
name="reduction_confirm_type[{{ $idx }}]"
|
||||
value="2"
|
||||
class="custom-control-input"
|
||||
@checked($oldCheckType == 2)
|
||||
@disabled($isDisabled)>
|
||||
<label class="custom-control-label" for="check_type_{{ $userCategoryId }}_2">
|
||||
<label class="custom-control-label" for="check_type_{{ $idx }}_2">
|
||||
毎更新時
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@ -69,29 +69,28 @@
|
||||
</div>
|
||||
|
||||
|
||||
{{--
|
||||
<div class="text-right mb-2">
|
||||
全 {{ $list->total() }} 件中 {{ $list->firstItem() }}〜{{ $list->lastItem() }} 件を表示
|
||||
</div>
|
||||
<div class="ml-auto">
|
||||
{{ $list->appends(keepUserListQuery())->links('pagination') }}
|
||||
</div>
|
||||
--}}
|
||||
|
||||
</div>
|
||||
<!-- 減免確認マスタ テーブル -->
|
||||
|
||||
<div class="col-lg-12 px-0 ">
|
||||
<form action="{{ route('reduction_confirm.store') }}" method="POST" id="reduction-form">
|
||||
{{-- 登録ボタン --}}
|
||||
<div class="container-fluid mb20">
|
||||
<button type="submit" class="btn btn-primary mt-2 btn-submit">登録</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
{{-- 左側:登録ボタン --}}
|
||||
<button type="submit" class="btn btn-primary btn-submit">登録</button>
|
||||
|
||||
{{-- 右側:件数 + ページネーション --}}
|
||||
<div class="text-right">
|
||||
<div>
|
||||
全 {{ $reductionData->total() }} 件中
|
||||
{{ $reductionData->firstItem() }}〜{{ $reductionData->lastItem() }} 件を表示
|
||||
</div>
|
||||
<div>
|
||||
{{ $reductionData->appends(keepUserListQuery())->links('pagination') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@csrf
|
||||
<input type="hidden" name="park_id" value="{{ $parkId }}">
|
||||
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead class="thead-light">
|
||||
@ -105,7 +104,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($reductionData as $row)
|
||||
@include('admin.reduction_confirm._form', ['row' => $row])
|
||||
@include('admin.reduction_confirm._form', ['row' => $row, 'index' => $loop->index])
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5" class="text-center text-muted">
|
||||
@ -118,7 +117,6 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<style>
|
||||
@ -145,6 +143,7 @@
|
||||
width: fit-content;
|
||||
min-width: 320px;
|
||||
}
|
||||
|
||||
.sample03-wrapper {
|
||||
background-color: white;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user