264 lines
12 KiB
PHP
264 lines
12 KiB
PHP
@extends('layouts.app')
|
||
@section('title', '定期予約マスタ')
|
||
|
||
@section('content')
|
||
<style>
|
||
/* 画面全体のフォント/サイズを統一(やや小さめ) */
|
||
.rv-page,
|
||
.rv-page .card,
|
||
.rv-page .form-control,
|
||
.rv-page .btn,
|
||
.rv-page table,
|
||
.rv-page .breadcrumb {
|
||
font-family: "Noto Sans JP","Hiragino Kaku Gothic ProN","Meiryo",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
||
font-size: 13px;
|
||
line-height: 1.45;
|
||
}
|
||
|
||
/* フィルター:1行=左ラベル/右入力、を縦に積む */
|
||
.rv-filter .field{display:flex;align-items:center;margin-bottom:.6rem;}
|
||
.rv-filter .label{flex:0 0 170px;margin:0;color:#333;font-weight:600;white-space:nowrap;}
|
||
.rv-filter .input{flex:1 1 auto;min-width:220px;}
|
||
.rv-filter .form-control{height:calc(2.0rem + 2px);padding:.25rem .5rem;}
|
||
.rv-filter .inline-range{display:flex;gap:.5rem;align-items:center;}
|
||
.rv-filter .tilde{color:#666;}
|
||
|
||
/* 一覧テーブル:斑馬(ゼブラ)無し、やや詰め気味 */
|
||
.rv-table th,.rv-table td{padding:.35rem .5rem;font-size:12px;}
|
||
.rv-table thead th{white-space:nowrap;background:#eeeeee;} /* ← 表頭:灰色 */
|
||
.card .card-header{background:#f5f5f5;} /* ← カード見出しも淡いグレー */
|
||
|
||
/* ツールバー:左にボタン群、右にページャ */
|
||
.rv-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;}
|
||
.rv-toolbar .btn+.btn{margin-left:.4rem;}
|
||
|
||
/* 操作セルの背景色(定期契約マスタと同じ雰囲気) */
|
||
.op-cell{background:#faebd7;}
|
||
</style>
|
||
|
||
<div class="rv-page">
|
||
{{-- パンくず・ヘッダ --}}
|
||
<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') }}">ホーム</a></li>
|
||
<li class="breadcrumb-item active">定期予約マスタ</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
@if(session('success'))
|
||
<div class="alert alert-success py-2 px-3 my-2">{{ session('success') }}</div>
|
||
@endif
|
||
@if($errors->any())
|
||
<div class="alert alert-danger py-2 px-3 my-2">
|
||
<ul class="mb-0">
|
||
@foreach($errors->all() as $e)<li>{{ $e }}</li>@endforeach
|
||
</ul>
|
||
</div>
|
||
@endif
|
||
<p class="text-muted mb-0">※この画面では予約情報の検索・一括削除が行えます。</p>
|
||
</div>
|
||
</div>
|
||
|
||
<section class="content">
|
||
<div class="container-fluid">
|
||
|
||
{{-- 絞り込みフィルター(ここは前回どおり。必要に応じて調整可) --}}
|
||
<div class="card rv-filter">
|
||
<div class="card-header"><h3 class="card-title">絞り込みフィルター</h3></div>
|
||
<div class="card-body">
|
||
<form action="{{ route('reserves') }}" method="post" id="filter-form">
|
||
@csrf
|
||
<input type="hidden" name="sort" id="sort" value="{{ $sort }}">
|
||
<input type="hidden" name="sort_type" id="sort_type" value="{{ $sort_type }}">
|
||
|
||
<div class="row">
|
||
<div class="col-lg-6">
|
||
<div class="field">
|
||
<label class="label">利用者ID</label>
|
||
<div class="input">
|
||
<input type="text" class="form-control" name="user_id"
|
||
value="{{ $user_id ?? '' }}" placeholder="123456">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="field">
|
||
<label class="label">有効フラグ</label>
|
||
<div class="input">
|
||
<select name="valid_flag" class="form-control">
|
||
<option value="">全て</option>
|
||
<option value="1" {{ (isset($valid_flag) && (string)$valid_flag==='1')?'selected':'' }}>有効</option>
|
||
<option value="0" {{ (isset($valid_flag) && (string)$valid_flag==='0')?'selected':'' }}>無効</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="field">
|
||
<label class="label">メール送信日時</label>
|
||
<div class="input inline-range">
|
||
<input type="datetime-local" class="form-control" name="mail_sent_from"
|
||
value="{{ $mail_sent_from ?? '' }}">
|
||
<span class="tilde">~</span>
|
||
<input type="datetime-local" class="form-control" name="mail_sent_to"
|
||
value="{{ $mail_sent_to ?? '' }}">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-lg-6">
|
||
<div class="field">
|
||
<label class="label">駐輪場</label>
|
||
<div class="input">
|
||
<select name="park_id" class="form-control">
|
||
<option value="">全て</option>
|
||
@if(!empty($parkOptions) && is_iterable($parkOptions))
|
||
@foreach($parkOptions as $pid => $pname)
|
||
<option value="{{ $pid }}" {{ (isset($park_id) && (string)$park_id===(string)$pid)?'selected':'' }}>
|
||
{{ $pname }}
|
||
</option>
|
||
@endforeach
|
||
@endif
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mt-2">
|
||
<button type="submit" class="btn btn-default">絞り込み</button>
|
||
<a href="{{ route('reserves') }}" class="btn btn-default">解除</a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
{{-- ツールバー:左=ボタン群、右=ページャ(CSV出力→削除) --}}
|
||
<div class="rv-toolbar mb-2">
|
||
<div class="left">
|
||
<a href="{{ route('reserves_add') }}" class="btn btn-sm btn-default">新規</a>
|
||
<button type="button" class="btn btn-sm btn-default" id="btnBulkDel">削除</button>
|
||
</div>
|
||
<div class="right">
|
||
{{ $list->appends(['sort'=>$sort,'sort_type'=>$sort_type])->links('pagination') }}
|
||
</div>
|
||
</div>
|
||
|
||
{{-- 一覧テーブル(先頭列の並び替えを削除/操作列にチェック+編集) --}}
|
||
<div class="card">
|
||
<form id="bulkDeleteForm" method="post" action="{{ route('reserves_delete') }}">
|
||
@csrf
|
||
<input type="hidden" name="confirmed" value="1">
|
||
<div class="table-responsive">
|
||
<table class="table table-bordered table-hover rv-table mb-0 text-nowrap">
|
||
<thead>
|
||
<tr>
|
||
{{-- 操作(全選択チェック+編集)※表頭は灰色 --}}
|
||
<th style="width:140px;">
|
||
<input type="checkbox" id="chkAll">
|
||
<span class="ml-1"></span>
|
||
</th>
|
||
|
||
{{-- ▼ 要求どおりの見出し(順番も完全一致) --}}
|
||
<th>定期予約ID</th>
|
||
<th>定期契約ID</th>
|
||
<th>定期契約日時</th>
|
||
<th>利用者分類ID</th>
|
||
<th>利用者ID</th>
|
||
<th>予約日時</th>
|
||
<th>駐輪場ID</th>
|
||
<th>駐輪場所ID</th>
|
||
<th>車種区分ID</th>
|
||
<th>駐輪分類ID</th>
|
||
<th>減免措置</th>
|
||
<th>自動リマインド日</th>
|
||
<th>手動リマインド日</th>
|
||
<th>800M以内フラグ</th>
|
||
<th>解約日</th>
|
||
<th>有効フラグ</th>
|
||
<th>メール送信日時</th>
|
||
<th>手動通知</th>
|
||
<th>手動通知方法</th>
|
||
<th>空き待ち順</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($list as $row)
|
||
<tr>
|
||
{{-- 操作セル--}}
|
||
<td class="op-cell">
|
||
<div class="d-flex align-items-center">
|
||
<input type="checkbox" class="mr-2 chkRow" name="ids[]" value="{{ $row->reserve_id }}">
|
||
<a href="{{ route('reserves_edit', ['reserve_id' => $row->reserve_id]) }}"
|
||
class="btn btn-sm btn-default">編集</a>
|
||
</div>
|
||
</td>
|
||
|
||
{{-- データ列(存在しないカラムは空文字で安全に表示) --}}
|
||
<td class="text-right">{{ $row->reserve_id }}</td> {{-- 定期予約ID --}}
|
||
<td class="text-right">{{ $row->contract_id ?? '' }}</td> {{-- 定期契約ID --}}
|
||
<td>{{ $row->contract_created_at ?? '' }}</td> {{-- 定期契約日時 --}}
|
||
<td class="text-right">{{ $row->user_categoryid ?? '' }}</td> {{-- 利用者分類ID --}}
|
||
<td class="text-right">{{ $row->user_id }}</td> {{-- 利用者ID --}}
|
||
<td>{{ $row->reserve_date ?? '' }}</td> {{-- 予約日時 --}}
|
||
<td class="text-right">{{ $row->park_id ?? '' }}</td> {{-- 駐輪場ID --}}
|
||
<td class="text-right">{{ $row->price_parkplaceid ?? '' }}</td> {{-- 駐輪場所ID --}}
|
||
<td class="text-right">{{ $row->psection_id ?? '' }}</td> {{-- 車種区分ID --}}
|
||
<td class="text-right">{{ $row->ptype_id ?? '' }}</td> {{-- 駐輪分類ID --}}
|
||
<td>{{ $row->reduction ?? '' }}</td> {{-- 減免措置 --}}
|
||
<td>{{ $row->auto_remind_date ?? '' }}</td> {{-- 自動リマインド日 --}}
|
||
<td>{{ $row->manual_remind_date ?? '' }}</td> {{-- 手動リマインド日 --}}
|
||
<td>{{ isset($row->within_800m_flag) ? (($row->within_800m_flag)?'有':'無') : '' }}</td> {{-- 800M以内フラグ --}}
|
||
<td>{{ $row->contract_cancelday ?? '' }}</td> {{-- 解約日 --}}
|
||
<td>{{ isset($row->valid_flag) ? (($row->valid_flag)?'有効':'無効') : '' }}</td> {{-- 有効フラグ --}}
|
||
<td>{{ $row->mail_sent_at ?? '' }}</td> {{-- メール送信日時 --}}
|
||
<td>{{ isset($row->manual_notice) ? (($row->manual_notice)?'有':'無') : '' }}</td> {{-- 手動通知 --}}
|
||
<td>{{ $row->manual_notice_method ?? '' }}</td> {{-- 手動通知方法 --}}
|
||
<td class="text-right">{{ $row->waitlist_order ?? '' }}</td> {{-- 空き待ち順 --}}
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
{{-- 下側ページャ(右寄せ) --}}
|
||
<div class="d-flex justify-content-end mt-2">
|
||
{{ $list->appends(['sort'=>$sort,'sort_type'=>$sort_type])->links('pagination') }}
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
|
||
{{-- 一括削除のフロント処理(jQuery不要) --}}
|
||
<script>
|
||
(function(){
|
||
// 全選択チェック
|
||
var chkAll = document.getElementById('chkAll');
|
||
var chks = document.getElementsByClassName('chkRow');
|
||
if (chkAll) {
|
||
chkAll.addEventListener('change', function(){
|
||
Array.prototype.forEach.call(chks, function(c){ c.checked = chkAll.checked; });
|
||
});
|
||
}
|
||
|
||
// 一括削除ボタン
|
||
var btn = document.getElementById('btnBulkDel');
|
||
var form = document.getElementById('bulkDeleteForm');
|
||
if (btn && form) {
|
||
btn.addEventListener('click', function(){
|
||
var any = false;
|
||
Array.prototype.forEach.call(chks, function(c){ if (c.checked) any = true; });
|
||
if (!any) { alert('削除対象の行を選択してください。'); return; }
|
||
if (confirm('選択した予約を削除します。よろしいですか?')) {
|
||
form.submit();
|
||
}
|
||
});
|
||
}
|
||
})();
|
||
</script>
|
||
@endsection
|