Merge branch 'main' of https://git.so-manager-dev.com/so-manager/krgm.so-manager-dev.com
All checks were successful
Deploy main / deploy (push) Successful in 23s

This commit is contained in:
你的名字 2025-09-19 17:53:05 +09:00
commit 9df0d9c2c5
13 changed files with 257 additions and 249 deletions

View File

@ -24,10 +24,10 @@ class PplaceController extends Controller
$inputs['list'] = Pplace::search($inputs);
if ($inputs['list']->total() > 0 && $inputs['page'] > $inputs['list']->lastPage()) {
return redirect()->route('pplace');
return redirect()->route('pplaces');
}
return view('admin.Pplace.list', $inputs);
return view('admin.pplace.list', $inputs);
}
public function add(Request $request)
@ -53,13 +53,13 @@ class PplaceController extends Controller
$pplace->fill($inputs);
$pplace->save();
});
return redirect()->route('pplace')->with('success', '登録成功');
return redirect()->route('pplaces')->with('success', '登録しました。');
} else {
$inputs['errorMsg'] = $this->__buildErrorMessasges($validator);
}
}
return view('admin.Pplace.add', $inputs);
return view('admin.pplace.add', $inputs);
}
public function edit(Request $request, $id, $view = '')
@ -88,29 +88,38 @@ class PplaceController extends Controller
$record->fill($inputs);
$record->save();
});
return redirect()->route('pplace')->with('success', '更新成功');
return redirect()->route('pplaces')->with('success', '更新成功');
} else {
$data['errorMsg'] = $this->__buildErrorMessasges($validator);
}
}
return view($view ?: 'admin.Pplace.edit', $data);
return view($view ?: 'admin.pplace.edit', $data);
}
public function info(Request $request, $id)
{
return $this->edit($request, $id, 'admin.Pplace.info');
return $this->edit($request, $id, 'admin.pplace.info');
}
public function delete(Request $request)
{
$pk = $request->get('pk');
if ($pk && Pplace::destroy($pk)) {
return redirect()->route('pplace')->with('success', '削除成功');
$arr_pk = $request->get('pk');
if ($arr_pk) {
$ids = is_array($arr_pk) ? $arr_pk : [$arr_pk];
if (Pplace::deleteByPk($ids)) {
return redirect()->route('pplaces')->with('success', __("削除成功しました。"));
} else {
return redirect()->route('pplaces')->with('error', __('削除に失敗しました。'));
}
}
return redirect()->route('pplace')->with('error', '削除失敗');
return redirect()->route('pplaces')->with('error', __('削除するデータを選択してください。'));
}
public function export()
{
$headers = [
@ -142,7 +151,7 @@ class PplaceController extends Controller
{
$file = $request->file('file');
if (!$file) {
return redirect()->route('pplace')->with('error', 'CSVファイルを選択してください');
return redirect()->route('pplaces')->with('error', 'CSVファイルを選択してください');
}
$data = \App\Utils::csvToArray($file);
@ -161,10 +170,10 @@ class PplaceController extends Controller
]);
}
DB::commit();
return redirect()->route('pplace')->with('success', 'インポート成功');
return redirect()->route('pplaces')->with('success', 'インポート成功');
} catch (\Exception $e) {
DB::rollBack();
return redirect()->route('pplace')->with('error', "{$record} : " . $e->getMessage());
return redirect()->route('pplaces')->with('error', "{$record} : " . $e->getMessage());
}
}

View File

@ -16,7 +16,6 @@ class StationController extends Controller
$sort = $request->input('sort', 'station_id');
$sort_type = $request->input('sort_type', 'asc');
// 許可されたソート項目のみ
$allowedSorts = [
'station_id',
'park_id',
@ -32,19 +31,23 @@ class StationController extends Controller
$sort_type = 'asc';
}
// 必要カラムのみ取得
$stations = Station::select([
'station_id',
'station_neighbor_station',
'station_name_ruby',
'station_route_name',
'park_id',
'operator_id'
])->orderBy($sort, $sort_type)->paginate(20);
$list = Station::select([
'station_id',
'station_neighbor_station',
'station_name_ruby',
'station_route_name',
'park_id',
'operator_id',
'station_latitude',
'station_longitude',
])
->orderBy($sort, $sort_type)
->paginate(20);
return view('admin.stations.list', compact('stations', 'sort', 'sort_type'));
return view('admin.stations.list', compact('list', 'sort', 'sort_type'));
}
/**
* 新規登録
*/

View File

@ -65,11 +65,15 @@ class Pplace extends Model
/**
* 主キー配列で一括削除
*/
public static function deleteByPk($arr)
public static function deleteByPk($ids)
{
return self::whereIn('pplace_id', $arr)->delete();
if (!is_array($ids)) {
$ids = [$ids];
}
return self::whereIn('pplace_id', $ids)->delete();
}
/**
* 選択リスト取得用(フォーム等)
*/

View File

@ -17,19 +17,9 @@
</div>
@endif
<div class="card-header">
@if($isInfo)
<a href="{{ route('pplace_add') }}" class="btn btn-lg btn-success">{{ __('登録') }}</a>
<a href="{{ route('pplace_edit', ['id' => $pplace_id]) }}" class="btn btn-lg btn-danger">{{ __('編集') }}</a>
@else
<button type="submit" class="btn btn-lg btn-danger register">{{ __('保存') }}</button>
@endif
</div>
<div class="card-body">
<div class="row">
{{-- 駐輪車室ID --}}
@if($isInfo || $isEdit)
<div class="form-group col-3">
<label>{{ __('駐輪車室ID') }}</label>
</div>
@ -39,16 +29,15 @@
name="pplace_id" class="form-control form-control-lg" readonly />
</div>
</div>
@endif
{{-- 番号 --}}
<div class="form-group col-3">
<label @if(!$isInfo) class="required" @endif>{{ __('駐輪車室番号') }}</label>
<label class="required">{{ __('駐輪車室番号') }}</label>
</div>
<div class="form-group col-9">
<div class="input-group">
<input type="text" value="{{ $pplace_number ?? '' }}" placeholder="{{ __('駐輪車室番号') }}"
name="pplace_number" class="form-control form-control-lg" @if($isInfo) readonly @endif />
name="pplace_number" class="form-control form-control-lg">
</div>
</div>
@ -59,28 +48,37 @@
<div class="form-group col-9">
<div class="input-group">
<input type="text" value="{{ $pplace_remarks ?? '' }}" placeholder="{{ __('備考') }}"
name="pplace_remarks" class="form-control form-control-lg" @if($isInfo) readonly @endif />
name="pplace_remarks" class="form-control form-control-lg" @if(!empty($isEdit))@endif />
</div>
</div>
{{-- オペレーター --}}
<!-- {{-- オペレーター --}}
<div class="form-group col-3">
<label>{{ __('更新オペレータID') }}</label>
</div>
<div class="form-group col-9">
<select name="operator_id" class="form-control form-control-lg" @if($isInfo) disabled @endif>
<select name="operator_id" class="form-control form-control-lg" @if(!empty($isEdit)) disabled @endif>
<option value="">{{ __('選択してください') }}</option>
@foreach($operators ?? [] as $id => $name)
<option value="{{ $id }}" @if(($operator_id ?? '') == $id) selected @endif>{{ $name }}</option>
@endforeach
</select>
</div>
</div> -->
</div>
@if($isInfo)
<a href="{{ route('pplace_add') }}" class="btn btn-lg btn-success">{{ __('登録') }}</a>
<a href="{{ route('pplace_edit', ['id' => $pplace_id]) }}" class="btn btn-lg btn-danger">{{ __('編集') }}</a>
@else
<button type="submit" class="btn btn-lg btn-danger register">{{ __('保存') }}</button>
<!-- <div class="text-center"> -->
{{-- 登録ボタン --}}
<button type="submit" class="btn btn-lg btn-success mr-2">{{ __('登録') }}</button>
{{-- 削除ボタン(編集画面のみ表示) --}}
@if(!empty($pplace_id))
</form>
<form method="POST" action="{{ route('pplace_delete') }}"
onsubmit="return confirm('本当に削除しますか?')" class="d-inline-block mr-2">
@csrf
<input type="hidden" name="pk" value="{{ $pplace_id }}">
<button type="submit" class="btn btn-lg btn-danger mr-2">{{ __('削除') }}</button>
</form>
@endif
<!-- </div> -->
</div>

View File

@ -7,13 +7,12 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-lg-6">
<h1 class="m-0 text-dark">[東京都|〇〇駐輪場] 駐輪車室マスタ</h1>
<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">駐輪車室マスタ</li>
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
<li class="breadcrumb-item"><a href="{{ route('pplaces') }}">駐輪車室マスタ</a></li>
<li class="breadcrumb-item active">新規登録</li>
</ol>
</div>
@ -35,12 +34,7 @@
</div>
</div>
</div>
<div class="container-fluid mb20">
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('削除') }}</button>
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('インポート') }}</button>
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('CSV出力') }}</button>
</div>
</div>
</section>
<!-- /.content -->

View File

@ -7,13 +7,12 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-lg-6">
<h1 class="m-0 text-dark">[東京都|〇〇駐輪場] 駐輪車室マスタ</h1>
<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">駐輪車室マスタ</li>
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
<li class="breadcrumb-item"><a href="{{ route('pplaces') }}">駐輪車室マスタ</a></li>
<li class="breadcrumb-item active">編集</li>
</ol>
</div>
@ -30,17 +29,11 @@
<div class="card">
<form method="post" action="{{ route('pplace_edit', ['id' => $pplace_id]) }}" enctype="multipart/form-data">
@csrf
@include('admin.pplace._form', ['isEdit' => 1, 'isInfo' => 0])
@include('admin.pplace._form', ['isEdit' => true])
</form>
</div>
</div>
</div>
<div class="container-fluid mb20">
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('削除') }}</button>
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('インポート') }}</button>
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('CSV出力') }}</button>
</div>
</div>
</section>
<!-- /.content -->

View File

@ -9,8 +9,7 @@
</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"><a href="{{route('home')}}">ホーム</a></li>
<li class="breadcrumb-item active">{{__('駐輪車室マスタ')}}</li>
</ol>
</div>
@ -20,18 +19,31 @@
<section class="content">
<div class="container-fluid">
<div class="row">
<form action="{{route('pplace')}}" method='post' id='list-form'>
<form action="{{route('pplaces')}}" 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">
<button type="submit" class="btn btn-sm btn-default mr10" name="delete" id="delete">{{__('削除')}}</button>
<button type="submit" class="btn btn-sm btn-default mr10" name="import_csv" id="import_csv" action="{{route('pplace_import')}}">{{__('インポート')}}</button>
<button type="button" class="btn btn-sm btn-default mr10" onclick="location.href='{{ route('pplace_add') }}'">新規</button>
<button type="submit" class="btn btn-sm btn-default mr10"
form="form_delete" name="delete"
onclick="return confirm('削除してよろしいですか?');">削除
</button>
<!-- <button type="submit" class="btn btn-sm btn-default mr10" name="import_csv" id="import_csv" action="{{route('pplace_import')}}">{{__('インポート')}}</button> -->
<button type="submit" class="btn btn-sm btn-default mr10" name="export_csv" id="export_csv" action="{{route('pplace_export')}}">{{__('CSV出力')}}</button>
{{ $list->appends(['sort' => $sort,'sort_type'=>$sort_type])->links('pagination') }}
</div>
{{-- ページネーション --}}
<div class="container-fluid">
<div class="d-flex justify-content-end mb-3">
{{ $list->appends([
'sort' => $sort ?? '',
'sort_type' => $sort_type ?? ''
])->links('pagination') }}
</div>
</div>
<div class="form col-lg-12">
@ -55,63 +67,50 @@
@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('pplace_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>
<td>
<input type="checkbox" class="minimal m-0 checkbox" value="{{$item->pplace_id}}" name="pk[]">
<div class="btn_action">
<a href="{{route('pplace_info', ['id' => $item->pplace_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>
<form action="{{route('pplace_delete')}}" method="post" id="form_delete">
@csrf
<!-- ここから単一テーブル構成 ----------------------------------------- -->
<div class="col-lg-12 mb20">
<div class="table-responsive">
<table class="table table-bordered dataTable text-nowrap">
<thead class="thead-light">
<tr>
<th style="width:140px; border-left:1px solid #dcdcdc;" class="text-left">
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
</th>
<th class="sorting @if($sort=='pplace_id'){{$sort_type == 'asc'?'sorting_asc':'sorting_desc'}}@endif" sort="pplace_id">
<span>{{__('ID')}}</span>
<span>{{__('駐輪車室ID')}}</span>
</th>
<th class="sorting @if($sort=='pplace_number'){{$sort_type == 'asc'?'sorting_asc':'sorting_desc'}}@endif" sort="pplace_number">
<span>{{__('番号')}}</span>
<th>
<span>{{__('駐輪車室番号')}}</span>
</th>
<th class="sorting @if($sort=='pplace_remarks'){{$sort_type == 'asc'?'sorting_asc':'sorting_desc'}}@endif" sort="pplace_remarks">
<th>
<span>{{__('備考')}}</span>
</th>
</tr>
</thead>
<tbody>
<tbody class="bg-white">
@foreach($list as $item)
<tr>
<td class="align-middle" style="background-color:#faebd7; border-left:1px solid #dcdcdc;">
<div class="d-flex align-items-center">
<input type="checkbox" class="m-0 checkbox" name="pk[]" value="{{ $item->pplace_id }}">
<a href="{{ route('pplace_edit', ['id' => $item->pplace_id]) }}"
class="btn btn-sm btn-default ml10">編集</a>
</div>
</td>
<td class='sm-item text-left'><span>{{mb_substr($item->pplace_id, 0, 10)}}</span></td>
<td class='sm-item text-left'><span>{{mb_substr($item->pplace_number, 0, 20)}}</span></td>
<td class='sm-item text-left'><span>{{mb_substr($item->pplace_remarks, 0, 20)}}</span></td>
<td class='sm-item text-left'><span>{{mb_substr($item->pplace_remarks, 0, 20)}}</span></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- ここまで単一テーブル構成 ----------------------------------------- -->
</form>
</div>
</section>
@endsection

View File

@ -11,140 +11,144 @@
</div>
@endif
@php
// $isEdit = 1 or 0
@endphp
<div class="card-body">
<table class="table table-borderless">
{{-- 近傍駅ID自動採番 --}}
<tr>
<th>{{ __('近傍駅ID') }}</th>
<td>
{{-- バリデーションエラー表示 --}}
@if ($errors->any())
<div class="alert alert-danger">
<ul class="mb-0">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="row">
<!-- 近傍駅ID自動採番 -->
<div class="col-3">
<label>{{ __('近傍駅ID') }}</label>
</div>
<div class="form-group col-9">
<div class="input-group">
<input type="text" name="station_id"
class="form-control text-right bg-light"
value="{{ old('station_id', $station->station_id ?? '') }}"
maxlength="10" readonly>
</td>
</tr>
</div>
</div>
{{-- 駐輪場ID --}}
<tr>
<th>{{ __('駐車場ID') }}</th>
<td>
<!-- 駐輪場ID -->
<div class="col-3">
<label>{{ __('駐車場ID') }}</label>
</div>
<div class="form-group col-9">
<div class="input-group">
<input type="text" name="park_id"
class="form-control text-right bg-light"
value="{{ old('park_id', $station->park_id ?? '') }}"
maxlength="10" readonly>
</td>
</tr>
</div>
</div>
{{-- 近傍駅 --}}
<tr>
<th>{{ __('近傍駅') }} <span class="text-danger"></span></th>
<td>
<!-- 近傍駅 -->
<div class="form-group col-3">
<label class="required">{{ __('近傍駅') }}</label>
</div>
<div class="form-group col-9">
<div class="input-group">
<input type="text" name="station_neighbor_station"
class="form-control text-left"
class="form-control"
value="{{ old('station_neighbor_station', $station->station_neighbor_station ?? '') }}"
maxlength="10" required>
@error('station_neighbor_station')
<div class="text-danger small">{{ $message }}</div>
@enderror
</td>
</tr>
maxlength="50" required>
</div>
@error('station_neighbor_station')
<div class="text-danger small">{{ $message }}</div>
@enderror
</div>
{{-- 近傍駅ふりがな --}}
<tr>
<th>{{ __('近傍駅ふりがな') }} <span class="text-danger"></span></th>
<td>
<!-- 近傍駅ふりがな -->
<div class="form-group col-3">
<label class="required">{{ __('近傍駅ふりがな') }}</label>
</div>
<div class="form-group col-9">
<div class="input-group">
<input type="text" name="station_name_ruby"
class="form-control text-left"
class="form-control"
value="{{ old('station_name_ruby', $station->station_name_ruby ?? '') }}"
maxlength="10" required>
@error('station_name_ruby')
<div class="text-danger small">{{ $message }}</div>
@enderror
</td>
</tr>
maxlength="50" required>
</div>
@error('station_name_ruby')
<div class="text-danger small">{{ $message }}</div>
@enderror
</div>
{{-- 路線名 --}}
<tr>
<th>{{ __('路線名') }} <span class="text-danger"></span></th>
<td>
<!-- 路線名 -->
<div class="form-group col-3">
<label class="required">{{ __('路線名') }}</label>
</div>
<div class="form-group col-9">
<div class="input-group">
<input type="text" name="station_route_name"
class="form-control text-left"
class="form-control"
value="{{ old('station_route_name', $station->station_route_name ?? '') }}"
maxlength="10" required>
@error('station_route_name')
<div class="text-danger small">{{ $message }}</div>
@enderror
</td>
</tr>
maxlength="50" required>
</div>
@error('station_route_name')
<div class="text-danger small">{{ $message }}</div>
@enderror
</div>
{{-- 緯度 --}}
<tr>
<th>{{ __('近傍駅座標(緯度)') }} <span class="text-danger"></span></th>
<td>
<!-- 緯度 -->
<div class="form-group col-3">
<label class="required">{{ __('近傍駅座標(緯度)') }}</label>
</div>
<div class="form-group col-9">
<div class="input-group">
<input type="number" name="latitude"
class="form-control text-left"
class="form-control"
value="{{ old('latitude', $station->latitude ?? '') }}"
step="any" maxlength="10" required>
@error('latitude')
<div class="text-danger small">{{ $message }}</div>
@enderror
</td>
</tr>
step="any" maxlength="20" required>
</div>
@error('latitude')
<div class="text-danger small">{{ $message }}</div>
@enderror
</div>
{{-- 経度 --}}
<tr>
<th>{{ __('近傍駅座標(経度)') }} <span class="text-danger"></span></th>
<td>
<!-- 経度 -->
<div class="form-group col-3">
<label class="required">{{ __('近傍駅座標(経度)') }}</label>
</div>
<div class="form-group col-9">
<div class="input-group">
<input type="number" name="longitude"
class="form-control text-l"
class="form-control"
value="{{ old('longitude', $station->longitude ?? '') }}"
step="any" maxlength="10" required>
@error('longitude')
<div class="text-danger small">{{ $message }}</div>
@enderror
</td>
</tr>
</table>
step="any" maxlength="20" required>
</div>
@error('longitude')
<div class="text-danger small">{{ $message }}</div>
@enderror
</div>
{{-- 登録・削除 ボタン --}}
<div class="text-left mt-4">
@if($isInfo)
{{-- 詳細画面:編集に遷移 --}}
</div>
<a href="{{ route('stations_edit', ['id' => $station->id]) }}" class="btn btn-lg btn-success">
編集
</a>
@else
{{-- 新規/編集 共通フォーム --}}
<button type="submit" class="btn btn-lg btn-success">
{{ $isEdit ? '更新' : '登録' }}
</button>
{{-- 下部ボタン --}}
<div class="form-group col-12 d-flex gap-2 mt-4">
{{-- 登録ボタン --}}
<button type="submit" class="btn btn-lg btn-success mr-2">{{ __('登録') }}</button>
{{-- 編集時のみ削除可能 --}}
@if($isEdit && isset($station->id))
<form id="delete-form" method="POST"
action="{{ route('stations_delete') }}"
style="display:inline;">
@csrf
<input type="hidden" name="pk[]" value="{{ $station->id }}">
<button type="submit" class="btn btn-lg btn-danger ml-2"
onclick="return confirm('削除してよろしいですか?')">削除</button>
</form>
@endif
{{-- 削除ボタン(編集画面のみ表示) --}}
@if(!empty($station->station_id))
</form>
<form method="POST" action="{{ route('stations_delete') }}"
onsubmit="return confirm('本当に削除しますか?')" class="d-inline-block">
@csrf
<input type="hidden" name="pk" value="{{ $station->station_id }}">
<button type="submit" class="btn btn-lg btn-danger mr-2">{{ __('削除') }}</button>
</form>
@endif
</div>
</div>
@section('scripts')
<script>
function confirmDelete() {
if (confirm('削除してよろしいですか?')) {
document.getElementById('delete-form').submit();
}
}
</script>
@endsection
</div>
<!-- /.card-body -->

View File

@ -24,11 +24,7 @@
<div class="card">
<form method="POST" action="{{ route('stations_add') }}">
@csrf
@include('admin.stations._form', [
'isEdit' => 0,
'isInfo' => 0,
'station' => $station ?? null
])
@include('admin.stations._form', ['isEdit' => false])
</form>
</div>
</div>

View File

@ -26,11 +26,7 @@
<div class="card">
<form method="POST" action="{{ route('stations_edit', ['id' => $station->station_id]) }}">
@csrf
@include('admin.stations._form', [
'isEdit' => 1,
'isInfo' => 0,
'station' => $station
])
@include('admin.stations._form', ['isEdit' => true])
</form>
</div>
</div>

View File

@ -23,6 +23,7 @@
<!-- Main Content -->
<section class="content">
<div class="container-fluid">
{{-- 並び替え用 hidden --}}
<form action="{{ route('stations') }}" method="POST" id="list-form">
@csrf
@ -30,15 +31,27 @@
<input type="hidden" name="sort_type" value="{{ $sort_type ?? '' }}">
</form>
<div class="container-fluid mb20">
{{-- ボタンエリア --}}
<div class="col-lg-12 mb-3">
<button type="button" class="btn btn-sm btn-default mr10" onclick="location.href='{{ route('stations_add') }}'">新規</button>
<button type="button" class="btn btn-sm btn-default mr10" id="delete">削除</button>
{{-- 削除 --}}
<button type="submit" class="btn btn-sm btn-default mr10"
form="form_delete" name="delete"
onclick="return confirm('選択した項目を削除しますか?');">削除</button>
<button type="submit" class="btn btn-sm btn-default mr10" form="form_export">{{ __('CSV出力') }}</button>
<div class="d-flex justify-content-end">
{{ $stations->appends(['sort' => $sort ?? '', 'sort_type' => $sort_type ?? ''])->links('pagination') }}
</div>
{{-- ページネーション --}}
<div class="col-lg-12">
<div class="d-flex justify-content-end mb-3">
{{ $list->appends([
'sort' => $sort ?? '',
'sort_type' => $sort_type ?? ''
])->links('pagination') }}
</div>
</div>
{{-- テーブル --}}
<div class="form col-lg-12">
@if(Session::has('success'))
<div class="alert alert-success alert-dismissible" role="alert">
@ -52,15 +65,7 @@
{!! Session::get('error') !!}
</div>
@endif
<!-- メッセージ表示 -->
<div class="col-lg-12">
@if(session('success'))
<div class="alert alert-success alert-dismissible">{{ session('success') }}</div>
@elseif(session('error'))
<div class="alert alert-danger alert-dismissible">{{ session('error') }}</div>
@endif
</div>
</div>
<!-- ここから単一テーブル構成 ----------------------------------------- -->
<div class="col-lg-12 mb20">
@ -80,12 +85,13 @@
<th class="sorting {{ ($sort=='station_neighbor_station') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="station_neighbor_station"><span>近傍駅</span></th>
<th class="sorting {{ ($sort=='station_name_ruby') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="station_name_ruby"><span>近傍駅ふりがな</span></th>
<th class="sorting {{ ($sort=='station_route_name') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="station_route_name"><span>路線名</span></th>
<th><span>近傍駅座標(緯度)</span></th>
<th><span>近傍駅座標(経度)</span></th>
<th>{{ __('近傍駅座標(緯度)') }}</th>
<th>{{ __('近傍駅座標(経度)') }}</th>
</tr>
</thead>
<tbody class="bg-white">
@foreach($stations as $station)
@foreach($list as $station)
<tr>
{{-- 同じセル内に チェック + 編集ボタン) --}}
<td class="align-middle" style="background-color:#faebd7;">

View File

@ -450,6 +450,7 @@
'stations',
'terms',
'contract_allowable_cities',
'pplace',
];
$current = app('router')->currentRouteName();
@endphp
@ -492,6 +493,10 @@
<i class="fa fa-circle-o nav-icon"></i>
<p>{{ __("ゾーンマスタ") }}</p></a>
</li>
<li class="nav-item"><a href="{{ route('pplaces') }}" class="nav-link @if($current === 'pplaces') active @endif">
<i class="fa fa-circle-o nav-icon"></i>
<p>{{ __("駐輪場室マスタ") }}</p></a>
</li>
<li class="nav-item"><a href="{{ route('regular_types') }}" class="nav-link @if($current === 'regular_types') active @endif">
<i class="fa fa-circle-o nav-icon"></i>
<p>{{ __("定期種別マスタ") }}</p></a>

View File

@ -41,6 +41,7 @@ use App\Http\Controllers\Admin\SettingController;
use App\Http\Controllers\Admin\MailTemplateController;
use App\Http\Controllers\Admin\InvSettingController;
use App\Http\Controllers\Admin\ZoneController;
use App\Http\Controllers\Admin\PplaceController;
/**
@ -144,7 +145,7 @@ Route::middleware('auth')->group(function () {
Route::get('/regular_contracts/export', [App\Http\Controllers\Admin\RegularContractController::class, 'export'])->name('regular_contracts_export');
// [東京都|〇〇駐輪場] 駐輪車室マスタ
Route::match(['get', 'post'], '/pplace', [PplaceController::class, 'list'])->name('pplace');
Route::match(['get', 'post'], '/pplace', [PplaceController::class, 'list'])->name('pplaces');
Route::match(['get', 'post'], '/pplace/add', [PplaceController::class, 'add'])->name('pplace_add');
Route::match(['get', 'post'], '/pplace/edit/{id}', [PplaceController::class, 'edit'])->name('pplace_edit')->where(['id' => '[0-9]+']);
Route::match(['get', 'post'], '/pplace/info/{id}', [PplaceController::class, 'info'])->name('pplace_info')->where(['id' => '[0-9]+']);