136 lines
7.5 KiB
PHP
136 lines
7.5 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">
|
||
|
||
{{-- ▼ ボタン列(新規/削除/CSV出力/インポート/エクスポート) --}}
|
||
<div class="container-fluid mb20">
|
||
<button type="button" class="btn btn-sm btn-primary mr10"
|
||
onclick="location.href='{{ route('price_add') }}'">新規</button>
|
||
<button type="submit" class="btn btn-sm btn-danger mr10" form="form_delete" name="delete" id="delete"
|
||
onclick="return confirm('選択した項目を削除しますか?');">削除</button>
|
||
<button type="submit" class="btn btn-sm btn-success mr10" name="export_csv" id="export_csv"
|
||
action="{{route('prices_export')}}">CSV出力</button>
|
||
<button type="submit" class="btn btn-sm btn-info mr10" name="import_csv" id="import_csv"
|
||
action="{{route('prices_import')}}">インポート</button>
|
||
<button type="button" class="btn btn-sm btn-info mr10"
|
||
onclick="location.href='{{ route('prices_export') }}'">エクスポート</button>
|
||
</div>
|
||
|
||
{{-- ▼ ページネーション(上部・右寄せ) --}}
|
||
<div style="width:100%; text-align: right;">
|
||
{{ $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>
|
||
|
||
{{-- ▼ 一覧(市区マスタ準拠:1枚テーブル/先頭が「チェック+編集」統合列) --}}
|
||
<form action="{{route('prices_delete')}}" method="post" id="form_delete">
|
||
@csrf
|
||
<div class="table-responsive">
|
||
<table class="table table-bordered table-hover" style="min-width:1000px;">
|
||
<thead class="thead-light">
|
||
<tr>
|
||
{{-- 統合列:全選択チェック + 編集(背景 #faebd7) --}}
|
||
<th style="width:160px;">
|
||
<input type="checkbox" id="checkbox_all" >
|
||
<span class="text-muted" style="font-weight:normal;"></span>
|
||
</th>
|
||
{{-- データ列(見出しはそのまま) --}}
|
||
<th><span>駐車場所ID</span></th>
|
||
<th><span>駐輪場ID</span></th>
|
||
<th><span>商品名</span></th>
|
||
<th><span>期間</span></th>
|
||
<th><span>利用者分類ID</span></th>
|
||
<th><span>駐輪料金(税込)</span></th>
|
||
<th><span>車種区分ID</span></th>
|
||
<th><span>駐輪分類ID</span></th>
|
||
<th><span>駐車車室ID</span></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($list as $item)
|
||
<tr>
|
||
{{-- ▼ 統合セル:チェック + 編集(pk[]/背景 #faebd7/間隔は ml-2) --}}
|
||
<td style="background:#faebd7;">
|
||
<input type="checkbox" name="pk[]"
|
||
value="{{$item->price_parkplaceid}}">
|
||
<a href="{{route('price_info', ['id' => $item->price_parkplaceid])}}"
|
||
class="btn btn-sm btn-outline-primary ml-2">{{__('編集')}}</a>
|
||
</td>
|
||
|
||
{{-- ▼ データ本体(既存表示そのまま) --}}
|
||
<td class='sm-item text-left'><span>{{ mb_substr($item->price_parkplaceid, 0, 10) }}</span></td>
|
||
<td class='sm-item text-right'><span>{{ mb_substr($item->park_id, 0, 10) }}</span></td>
|
||
<td class='sm-item text-right'><span>{{ mb_substr($item->prine_name, 0, 10) }}</span></td>
|
||
<td class='sm-item text-right'><span>{{ mb_substr($item->price_month, 0, 10) }}</span></td>
|
||
<td class='sm-item text-right'><span>{{ mb_substr($item->user_categoryid, 0, 10) }}</span></td>
|
||
<td class='sm-item text-right'><span>{{ mb_substr($item->price, 0, 10) }}</span></td>
|
||
<td class='sm-item text-right'><span>{{ mb_substr($item->psection_id, 0, 10) }}</span></td>
|
||
<td class='sm-item text-right'><span>{{ mb_substr($item->price_ptypeid, 0, 10) }}</span></td>
|
||
<td class='sm-item text-right'><span>{{ mb_substr($item->pplace_id, 0, 10) }}</span></td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
{{-- ▼ ページネーション(下部・右寄せ:必要に応じて表示) --}}
|
||
<div class="mt-3" style="text-align:right;">
|
||
{{ $list->appends(['sort' => $sort, 'sort_type' => $sort_type])->links('pagination') }}
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</section>
|
||
|
||
{{-- ▼ 全選択/全解除(name="pk[]" を対象) --}}
|
||
<script>
|
||
document.getElementById('checkbox_all')?.addEventListener('change', function(e){
|
||
document.querySelectorAll('input[name="pk[]"]').forEach(function(el){
|
||
el.checked = e.target.checked;
|
||
});
|
||
});
|
||
</script>
|
||
@endsection
|