krgm.so-manager-dev.com/resources/views/admin/stations/_form.blade.php
kin.rinzen 7913f58d19
All checks were successful
Deploy main / deploy (push) Successful in 22s
画面表示とレイアウト修正
2025-09-05 17:49:01 +09:00

151 lines
5.5 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.

@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
@php
// $isEdit = 1 or 0
@endphp
<div class="card-body">
<table class="table table-borderless">
{{-- 近傍駅ID自動採番 --}}
<tr>
<th>{{ __('近傍駅ID') }}</th>
<td>
<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>
{{-- 駐輪場ID --}}
<tr>
<th>{{ __('駐車場ID') }}</th>
<td>
<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>
{{-- 近傍駅 --}}
<tr>
<th>{{ __('近傍駅') }} <span class="text-danger"></span></th>
<td>
<input type="text" name="station_neighbor_station"
class="form-control text-left"
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>
{{-- 近傍駅ふりがな --}}
<tr>
<th>{{ __('近傍駅ふりがな') }} <span class="text-danger"></span></th>
<td>
<input type="text" name="station_name_ruby"
class="form-control text-left"
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>
{{-- 路線名 --}}
<tr>
<th>{{ __('路線名') }} <span class="text-danger"></span></th>
<td>
<input type="text" name="station_route_name"
class="form-control text-left"
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>
{{-- 緯度 --}}
<tr>
<th>{{ __('近傍駅座標(緯度)') }} <span class="text-danger"></span></th>
<td>
<input type="number" name="latitude"
class="form-control text-left"
value="{{ old('latitude', $station->latitude ?? '') }}"
step="any" maxlength="10" required>
@error('latitude')
<div class="text-danger small">{{ $message }}</div>
@enderror
</td>
</tr>
{{-- 経度 --}}
<tr>
<th>{{ __('近傍駅座標(経度)') }} <span class="text-danger"></span></th>
<td>
<input type="number" name="longitude"
class="form-control text-l"
value="{{ old('longitude', $station->longitude ?? '') }}"
step="any" maxlength="10" required>
@error('longitude')
<div class="text-danger small">{{ $message }}</div>
@enderror
</td>
</tr>
</table>
{{-- 登録・削除 ボタン --}}
<div class="text-left mt-4">
@if($isInfo)
{{-- 詳細画面:編集に遷移 --}}
<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>
{{-- 編集時のみ削除可能 --}}
@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
@endif
</div>
</div>
@section('scripts')
<script>
function confirmDelete() {
if (confirm('削除してよろしいですか?')) {
document.getElementById('delete-form').submit();
}
}
</script>
@endsection