krgm.so-manager-dev.com/resources/views/admin/stations/list.blade.php
kin.rinzen b0ed603472
All checks were successful
Deploy main / deploy (push) Successful in 24s
近傍駅マスタ画面の修正
2025-09-19 15:21:07 +09:00

124 lines
6.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')
<!-- Content Header -->
<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"><a href="javascript:void(0);">[東京都|〇〇駐輪場]</a></li> -->
<li class="breadcrumb-item active">近傍駅マスタ</li>
</ol>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<section class="content">
<div class="container-fluid">
{{-- 並び替え用 hidden --}}
<form action="{{ route('stations') }}" method="POST" id="list-form">
@csrf
<input type="hidden" name="sort" value="{{ $sort ?? '' }}">
<input type="hidden" name="sort_type" value="{{ $sort_type ?? '' }}">
</form>
{{-- ボタンエリア --}}
<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="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>
{{-- ページネーション --}}
<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">
<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>
@endif
</div>
<!-- ここから単一テーブル構成 ----------------------------------------- -->
<div class="col-lg-12 mb20">
<div class="table-responsive">
<form action="{{ route('stations_delete') }}" method="POST" id="form_delete">
@csrf
<table class="table table-bordered dataTable text-nowrap">
<thead>
<tr>
{{-- チェック + 編集 用の1列 --}}
<th style="width:140px;" class="text-left">
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
</th>
{{-- ソート --}}
<th class="sorting {{ ($sort=='station_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="station_id"><span>近傍駅ID</span></th>
<th class="sorting {{ ($sort=='park_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="park_id"><span>駐車場ID</span></th>
<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>{{ __('近傍駅座標(緯度)') }}</th>
<th>{{ __('近傍駅座標(経度)') }}</th>
</tr>
</thead>
<tbody class="bg-white">
@foreach($list as $station)
<tr>
{{-- 同じセル内に チェック + 編集ボタン) --}}
<td class="align-middle" style="background-color:#faebd7;">
<div class="d-flex align-items-center">
<input type="checkbox" class="m-0 checkbox" name="pk[]" value="{{ $station->station_id }}">
<a href="{{ route('stations_edit', ['id' => $station->station_id]) }}" class="btn btn-sm btn-default ml10">編集</a>
</div>
</td>
<td class="sm-item text-left align-middle">{{ $station->station_id }}</td>
<td class="sm-item text-left align-middle">{{ $station->park_id }}</td>
<td class="sm-item text-left align-middle">{{ $station->station_neighbor_station }}</td>
<td class="sm-item text-left align-middle">{{ $station->station_name_ruby }}</td>
<td class="sm-item text-left align-middle">{{ $station->station_route_name }}</td>
<td class="sm-item text-left align-middle">{{ $station->station_latitude }}</td>
<td class="sm-item text-left align-middle">{{ $station->station_longitude }}</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
<!-- 単一テーブル構成ここまで ----------------------------------------- -->
</div>
</section>
<form action="{{ route('stations_export') }}" method="GET" id="form_export"></form>
@endsection