krgm.so-manager-dev.com/resources/views/admin/seals/list.blade.php
你的名字 1de2a0f022
All checks were successful
Deploy main / deploy (push) Successful in 27s
ソート機能追加
2025-09-09 20:09:28 +09:00

164 lines
8.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.app')
@section('title', '[東京都|〇〇駐輪場] シール発行履歴')
@section('content')
<div class="container-fluid">
<div class="d-flex justify-content-between align-items-center mb-2">
<h3 class="m-0 text-dark">シール発行履歴</h3>
<nav aria-label="breadcrumb" class="mb-0" style="background: transparent;">
<ol class="breadcrumb px-2 py-2 mb-0" style="background: transparent;">
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
<li class="breadcrumb-item active" aria-current="page">シール発行履歴</li>
</ol>
</nav>
</div>
<!-- 絞り込みフィルター -->
<div class="card mb-3">
<div class="card-body">
<form method="GET" action="{{ route('seals') }}">
<div class="row mb-3 align-items-center">
<label class="col-sm-2 col-form-label fw-bold">シール発行駐輪場</label>
<div class="col-sm-4">
<select name="park_id" class="form-select">
<option value="">全て</option>
{{-- @foreach($parks as $park)
<option value="{{ $park->id }}" {{ request('park_id') == $park->id ? 'selected' : '' }}>{{ $park->name }}</option>
@endforeach --}}
</select>
</div>
</div>
<div class="row mb-3 align-items-center">
<label class="col-sm-2 col-form-label fw-bold py-0">発行日</label>
<div class="col-sm-10">
<div class="row g-2 align-items-center mb-0">
<div class="col-auto">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="period_type" id="period_type_range" value="range" {{ request('period_type', 'range') == 'range' ? 'checked' : '' }}>
<label class="form-check-label" for="period_type_range">範囲指定</label>
</div>
</div>
<div class="col-auto">
<div class="input-group">
<input type="date" name="seal_day_from" id="seal_day_from" class="form-control" value="{{ request('seal_day_from') }}">
<span class="input-group-text"></span>
<input type="date" name="seal_day_to" id="seal_day_to" class="form-control" value="{{ request('seal_day_to') }}">
</div>
</div>
</div>
<div class="row g-2 align-items-center">
<div class="col-auto">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="period_type" id="period_type_recent" value="recent" {{ request('period_type') == 'recent' ? 'checked' : '' }}>
<label class="form-check-label" for="period_type_recent">直近Nヶ月等</label>
</div>
</div>
<div class="col-auto">
<select name="recent_period" id="recent_period" class="form-select">
<option value="">全て</option>
<option value="12m" {{ request('recent_period') == '12m' ? 'selected' : '' }}>直近12ヶ月</option>
<option value="6m" {{ request('recent_period') == '6m' ? 'selected' : '' }}>直近6ヶ月</option>
<option value="3m" {{ request('recent_period') == '3m' ? 'selected' : '' }}>直近3ヶ月</option>
<option value="2m" {{ request('recent_period') == '2m' ? 'selected' : '' }}>直近2ヶ月</option>
<option value="1m" {{ request('recent_period') == '1m' ? 'selected' : '' }}>直近1ヶ月</option>
<option value="1w" {{ request('recent_period') == '1w' ? 'selected' : '' }}>直近1週間</option>
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 text-end">
<button type="submit" class="btn btn-default me-2">絞り込み</button>
<a href="{{ route('seals') }}" class="btn btn-default">解除</a>
</div>
</div>
</form>
</div>
</div>
<!-- データテーブル -->
<style>
/* このページ限定:テーブルの右端/下端線を常に表示 */
#seals-table-wrapper {
border-right: 1px solid #dee2e6;
border-bottom: 1px solid #dee2e6;
}
</style>
<div id="seals-table-wrapper" class="table-responsive">
<table class="table table-bordered table-hover table-sm dataTable">
<thead class="thead-light">
<tr>
<th class="sorting {{ ($sort=='seal_issueid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="seal_issueid" style="cursor:pointer;">
シール発行履歴ID
</th>
<th class="sorting {{ ($sort=='park_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="park_id" style="cursor:pointer;">
シール発行駐輪場
</th>
<th class="sorting {{ ($sort=='contract_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="contract_id" style="cursor:pointer;">
定期契約ID
</th>
<th>車種区分ID</th>
<th class="sorting {{ ($sort=='seal_day') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="seal_day" style="cursor:pointer;">
発行日
</th>
<th class="sorting {{ ($sort=='contract_seal_issue') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="contract_seal_issue" style="cursor:pointer;">
発行回数
</th>
<th>理由</th>
</tr>
</thead>
<tbody class="bg-white">
@foreach($list as $item)
<tr>
<td>{{ $item->seal_issueid }}</td>
<td>{{ $item->park_name ?? $item->park_id }}</td>
<td>{{ $item->contract_id }}</td>
<td>{{ $item->psection_name ?? $item->psection_id }}</td>
<td>{{ $item->seal_day }}</td>
<td>{{ $item->contract_seal_issue }}</td>
<td>{{ $item->seal_reason }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="d-flex align-items-center mb-2">
@push('scripts')
<script>
// タグ発行キュー処理と同じソート挙動
document.querySelectorAll('th.sorting').forEach(th => {
th.addEventListener('click', function(){
const url = new URL(window.location.href);
const current = url.searchParams.get('sort') || '';
const currentType = url.searchParams.get('sort_type') || '';
const nextCol = this.getAttribute('sort');
let nextType = 'asc';
if (current === nextCol) {
nextType = (currentType === 'asc') ? 'desc' : 'asc';
}
url.searchParams.set('sort', nextCol);
url.searchParams.set('sort_type', nextType);
window.location.href = url.toString();
});
});
</script>
@endpush
<div class="ms-auto">
{{ $list->appends(request()->except('page'))->links('pagination') }}
</div>
</div>
</div>
<script>
function togglePeriodInputs() {
const isRange = document.getElementById('period_type_range').checked;
document.getElementById('seal_day_from').disabled = !isRange;
document.getElementById('seal_day_to').disabled = !isRange;
document.getElementById('recent_period').disabled = isRange;
}
document.getElementById('period_type_range').addEventListener('change', togglePeriodInputs);
document.getElementById('period_type_recent').addEventListener('change', togglePeriodInputs);
window.addEventListener('DOMContentLoaded', togglePeriodInputs);
</script>
@endsection