krgm.so-manager-dev.com/resources/views/admin/neighbor_stations/add.blade.php

146 lines
6.1 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="{{ route('neighbor_stations') }}">[東京都|〇〇駐輪場]</a></li>
<li class="breadcrumb-item active">[東京都|〇〇駐輪場] 近傍駅マスタ</li>
</ol>
</div>
</div>
</div>
</div>
<section class="content">
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-md-8">
<form method="POST" action="{{ route('neighbor_station_add') }}">
@csrf
<table class="table table-bordered">
<tr>
<th>近傍駅ID</th>
<td>
<input type="text" name="station_id"
class="form-control text-right bg-ro"
value="{{ old('station_id', $station->station_id ?? '') }}"
maxlength="10"
readonly>
</td>
</tr>
<tr>
<th>駐車場ID</th>
<td>
<input type="text" name="park_id"
class="form-control text-right bg-ro"
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"
maxlength="10"
required
value="{{ old('station_neighbor_station', $station->station_neighbor_station ?? '') }}">
</td>
</tr>
<tr>
<th>近傍駅ふりがな <span class="text-danger"></span></th>
<td>
<input type="text" name="station_name_ruby"
class="form-control text-left"
maxlength="10"
required
value="{{ old('station_name_ruby', $station->station_name_ruby ?? '') }}">
</td>
</tr>
<tr>
<th>路線名 <span class="text-danger"></span></th>
<td>
<input type="text" name="station_route_name"
class="form-control text-left"
maxlength="10"
required
value="{{ old('station_route_name', $station->station_route_name ?? '') }}">
</td>
</tr>
<tr>
<th>近傍駅座標(緯度) <span class="text-danger"></span></th>
<td>
<input type="number" name="latitude"
class="form-control text-right"
maxlength="10"
step="any"
required
value="{{ old('latitude', $station->latitude ?? '') }}">
</td>
</tr>
<tr>
<th>近傍駅座標(経度) <span class="text-danger"></span></th>
<td>
<input type="number" name="longitude"
class="form-control text-right"
maxlength="10"
step="any"
required
value="{{ old('longitude', $station->longitude ?? '') }}">
</td>
</tr>
</table>
<div class="text-center mt-4">
<button type="submit" class="btn btn-primary">登録</button>
<button type="button" class="btn btn-danger ml-3" onclick="confirmDelete()">削除</button>
<form id="delete-form" method="POST"
action="{{ route('neighbor_stations_delete') }}"
style="display:none;">
@csrf
<input type="hidden" name="pk[]" value="{{ old('station_id') ?? 0 }}">
</form>
</div>
</form>
</div>
</div>
</div>
</section>
@endsection
@section('scripts')
<script>
function confirmDelete() {
if (confirm('削除してよろしいですか?')) {
document.getElementById('delete-form').submit();
}
}
</script>
@endsection
<style>
.bg-ro {
background-color: #e9ecef;
}
</style>