This commit is contained in:
parent
2b8f80fe50
commit
4df74f116c
@ -31,125 +31,112 @@ class PtypeController extends Controller
|
|||||||
|
|
||||||
return view('admin.ptypes.list', $inputs);
|
return view('admin.ptypes.list', $inputs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新規登録(画面/処理)
|
||||||
|
*/
|
||||||
public function add(Request $request)
|
public function add(Request $request)
|
||||||
{
|
{
|
||||||
$inputs = [
|
if ($request->isMethod('get')) {
|
||||||
//TODO 駐輪分類ID not found in database specs
|
// 新規時は空のレコードを用意してフォーム描画
|
||||||
'ptype_subject' => $request->input('ptype_subject'), // 駐輪分類名
|
return view('admin.ptypes.add', [
|
||||||
'ptype_remarks' => $request->input('ptype_remarks'), // 備考
|
'isEdit' => false,
|
||||||
];
|
'record' => new Ptype(), // ← ★ Blade側で record->〇〇 が使える
|
||||||
|
]);
|
||||||
if ($request->isMethod('POST')) {
|
|
||||||
$rules = [
|
|
||||||
'ptype_subject' => 'required|string|max:255',
|
|
||||||
'floor_sort' => 'nullable|integer',
|
|
||||||
'ptype_remarks' => 'nullable|string|max:255',
|
|
||||||
];
|
|
||||||
$messages = [
|
|
||||||
'ptype_subject.required' => '駐輪分類名は必須です。',
|
|
||||||
];
|
|
||||||
$validator = Validator::make($request->all(), $rules, $messages);
|
|
||||||
if (!$validator->fails()) {
|
|
||||||
\DB::transaction(function () use ($inputs, &$type) {
|
|
||||||
$new = new Ptype();
|
|
||||||
$new->fill($inputs);
|
|
||||||
if ($new->save()) {
|
|
||||||
$type = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
if ($type) {
|
|
||||||
$request->session()->flash('success', __('データ新規作成しました。'));
|
|
||||||
return redirect()->route('ptypes');
|
|
||||||
} else {
|
|
||||||
$request->session()->flash('error', __('新規作成に失敗しました'));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$inputs['errorMsg'] = $this->__buildErrorMessasges($validator);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin.ptypes.add', $inputs);
|
// POST時:バリデーション
|
||||||
|
$rules = [
|
||||||
|
'ptype_subject' => 'required|string|max:255',
|
||||||
|
'ptype_remarks' => 'nullable|string|max:255',
|
||||||
|
];
|
||||||
|
$messages = [
|
||||||
|
'ptype_subject.required' => '駐輪分類名は必須です。',
|
||||||
|
];
|
||||||
|
|
||||||
|
$validator = Validator::make($request->all(), $rules, $messages);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return redirect()->back()->withErrors($validator)->withInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::transaction(function () use ($request) {
|
||||||
|
$new = new Ptype();
|
||||||
|
$new->fill($request->only(['ptype_subject', 'ptype_remarks']));
|
||||||
|
$new->save();
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect()->route('ptypes')->with('success', '登録しました。');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit(Request $request, $pk, $view = '')
|
/**
|
||||||
|
* 編集(画面/処理)
|
||||||
|
*/
|
||||||
|
public function edit(Request $request, $id)
|
||||||
{
|
{
|
||||||
$ptype = Ptype::getByPk($pk);
|
// 該当データ取得
|
||||||
if (empty($pk) || empty($ptype)) {
|
$record = Ptype::find($id);
|
||||||
|
if (!$record) {
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 追加のドロップダウンなどがある場合
|
if ($request->isMethod('get')) {
|
||||||
$dataList = $this->getDataDropList();
|
// 編集画面表示
|
||||||
|
return view('admin.ptypes.edit', [
|
||||||
if ($request->isMethod('POST')) {
|
'isEdit' => true,
|
||||||
$type = false;
|
'record' => $record,
|
||||||
|
]);
|
||||||
// バリデーションルール
|
|
||||||
$rules = [
|
|
||||||
'ptype_subject' => 'required|string|max:255',
|
|
||||||
'floor_sort' => 'nullable|integer',
|
|
||||||
'ptype_remarks' => 'nullable|string|max:255',
|
|
||||||
];
|
|
||||||
$messages = [
|
|
||||||
'ptype_subject.required' => '駐輪分類名は必須です。',
|
|
||||||
];
|
|
||||||
|
|
||||||
$validator = Validator::make($request->all(), $rules, $messages);
|
|
||||||
|
|
||||||
if (!$validator->fails()) {
|
|
||||||
\DB::transaction(function () use ($request, &$type, $ptype) {
|
|
||||||
$ptype->fill($request->all());
|
|
||||||
$ptype->save();
|
|
||||||
$type = true;
|
|
||||||
});
|
|
||||||
if ($type) {
|
|
||||||
$request->session()->flash('success', __('更新に成功しました'));
|
|
||||||
return redirect()->route('ptypes');
|
|
||||||
} else {
|
|
||||||
$request->session()->flash('error', __('更新に失敗しました'));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return redirect()->back()
|
|
||||||
->withErrors($validator)
|
|
||||||
->withInput();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blade に渡すときはモデルそのものを渡す
|
// POST時:バリデーション
|
||||||
if ($view != '') {
|
$rules = [
|
||||||
return view($view, array_merge($dataList, ['item' => $ptype]));
|
'ptype_subject' => 'required|string|max:255',
|
||||||
|
'floor_sort' => 'nullable|string|max:50',
|
||||||
|
|
||||||
|
'ptype_remarks' => 'nullable|string|max:255',
|
||||||
|
];
|
||||||
|
$messages = [
|
||||||
|
'ptype_subject.required' => '駐輪分類名は必須です。',
|
||||||
|
];
|
||||||
|
|
||||||
|
$validator = Validator::make($request->all(), $rules, $messages);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return redirect()->back()->withErrors($validator)->withInput();
|
||||||
}
|
}
|
||||||
return view('admin.ptypes.edit', array_merge($dataList, [
|
|
||||||
'item' => $ptype,
|
DB::transaction(function () use ($request, $record) {
|
||||||
'ptype_id' => $ptype->ptype_id,
|
$record->fill($request->only(['ptype_subject','floor_sort', 'ptype_remarks']));
|
||||||
]));
|
$record->save();
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect()->route('ptypes')->with('success', '更新しました。');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 削除(単一/複数対応)
|
||||||
|
*/
|
||||||
public function delete(Request $request)
|
public function delete(Request $request)
|
||||||
{
|
{
|
||||||
$arr_pk = $request->get('pk');
|
$ids = [];
|
||||||
|
|
||||||
// 単体削除の場合 string が来るので配列に変換
|
if ($request->filled('id')) {
|
||||||
if (!is_array($arr_pk)) {
|
$ids[] = (int) $request->input('id');
|
||||||
$arr_pk = [$arr_pk];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($arr_pk && count($arr_pk) > 0) {
|
if (is_array($request->input('pk'))) {
|
||||||
if (Ptype::whereIn('ptype_id', $arr_pk)->delete()) {
|
$ids = array_merge($ids, $request->input('pk'));
|
||||||
return redirect()->route('ptypes')->with('success', __("削除が完了しました。"));
|
|
||||||
} else {
|
|
||||||
return redirect()->route('ptypes')->with('error', __('削除に失敗しました。'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return redirect()->route('ptypes')->with('error', __('削除するデータを選択してください。'));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$ids = array_values(array_unique(array_map('intval', $ids)));
|
||||||
|
|
||||||
public function info(Request $request, $id)
|
if (empty($ids)) {
|
||||||
{
|
return back()->with('error', '削除対象が選択されていません。');
|
||||||
return $this->edit($request, $id, 'admin.ptypes.info');
|
}
|
||||||
|
|
||||||
|
Ptype::whereIn('ptype_id', $ids)->delete();
|
||||||
|
|
||||||
|
return redirect()->route('ptypes')->with('success', '削除しました。');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDataDropList()
|
public function getDataDropList()
|
||||||
|
|||||||
@ -5,6 +5,10 @@ namespace App\Http\Controllers\Admin;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Models\Station;
|
use App\Models\Station;
|
||||||
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use App\Models\Park;
|
||||||
|
|
||||||
|
|
||||||
class StationController extends Controller
|
class StationController extends Controller
|
||||||
{
|
{
|
||||||
@ -38,8 +42,8 @@ class StationController extends Controller
|
|||||||
'station_route_name',
|
'station_route_name',
|
||||||
'park_id',
|
'park_id',
|
||||||
'operator_id',
|
'operator_id',
|
||||||
// 'station_latitude', 追加予定
|
'station_latitude',
|
||||||
// 'station_longitude', 追加予定
|
'station_longitude',
|
||||||
])
|
])
|
||||||
->orderBy($sort, $sort_type)
|
->orderBy($sort, $sort_type)
|
||||||
->paginate(20);
|
->paginate(20);
|
||||||
@ -48,74 +52,140 @@ class StationController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新規登録
|
|
||||||
*/
|
|
||||||
public function add(Request $request)
|
public function add(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->isMethod('post')) {
|
if ($request->isMethod('get')) {
|
||||||
$validated = $request->validate([
|
// 駐車場リストを取得(プルダウン用)
|
||||||
'station_neighbor_station' => 'required|string|max:255',
|
$parks = Park::orderBy('park_name')->pluck('park_name', 'park_id');
|
||||||
'station_name_ruby' => 'nullable|string|max:255',
|
|
||||||
'station_route_name' => 'nullable|string|max:255',
|
|
||||||
'park_id' => 'nullable|integer',
|
|
||||||
'operator_id' => 'nullable|integer',
|
|
||||||
]);
|
|
||||||
|
|
||||||
Station::create($validated);
|
// 新規時:空レコードを渡す
|
||||||
return redirect()->route('stations')->with('success', '近傍駅が登録されました');
|
return view('admin.stations.add', [
|
||||||
|
'isEdit' => false,
|
||||||
|
'record' => new Station(),
|
||||||
|
'parks' => $parks, // ← これを追加
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin.stations.add');
|
// POST時:バリデーション
|
||||||
|
$rules = [
|
||||||
|
'station_neighbor_station' => 'required|string|max:255',
|
||||||
|
'station_name_ruby' => 'required|string|max:255',
|
||||||
|
'station_route_name' => 'required|string|max:255',
|
||||||
|
'station_latitude' => 'required|numeric',
|
||||||
|
'station_longitude' => 'required|numeric',
|
||||||
|
'operator_id' => 'nullable|integer',
|
||||||
|
'park_id' => 'required|integer',
|
||||||
|
];
|
||||||
|
|
||||||
|
$messages = [
|
||||||
|
'station_latitude.required' => '緯度は必須項目です。',
|
||||||
|
'station_longitude.required' => '経度は必須項目です。',
|
||||||
|
];
|
||||||
|
|
||||||
|
$validator = Validator::make($request->all(), $rules, $messages);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return redirect()->back()->withErrors($validator)->withInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::transaction(function () use ($request) {
|
||||||
|
Station::create($request->only([
|
||||||
|
'station_neighbor_station',
|
||||||
|
'station_name_ruby',
|
||||||
|
'station_route_name',
|
||||||
|
'station_latitude',
|
||||||
|
'station_longitude',
|
||||||
|
'park_id',
|
||||||
|
'operator_id',
|
||||||
|
]));
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect()->route('stations')->with('success', '登録しました。');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 編集
|
* 編集(画面/処理)
|
||||||
*/
|
*/
|
||||||
public function edit(Request $request, $id)
|
public function edit(Request $request, $id)
|
||||||
{
|
{
|
||||||
$station = Station::findOrFail($id);
|
$record = Station::findOrFail($id);
|
||||||
|
|
||||||
if ($request->isMethod('post')) {
|
if ($request->isMethod('get')) {
|
||||||
$validated = $request->validate([
|
// 駐車場リストを取得(プルダウン用)
|
||||||
'station_neighbor_station' => 'required|string|max:255',
|
$parks = Park::orderBy('park_name')->pluck('park_name', 'park_id');
|
||||||
'station_name_ruby' => 'nullable|string|max:255',
|
|
||||||
'station_route_name' => 'nullable|string|max:255',
|
return view('admin.stations.edit', [
|
||||||
'park_id' => 'nullable|integer',
|
'isEdit' => true,
|
||||||
'operator_id' => 'nullable|integer',
|
'record' => $record,
|
||||||
|
'parks' => $parks, // ← ここを追加
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$station->update($validated);
|
|
||||||
return redirect()->route('stations')->with('success', '更新しました');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin.stations.edit', compact('station'));
|
// ▼ POST時:バリデーション
|
||||||
|
$rules = [
|
||||||
|
'station_neighbor_station' => 'required|string|max:255',
|
||||||
|
'station_name_ruby' => 'required|string|max:255',
|
||||||
|
'station_route_name' => 'required|string|max:255',
|
||||||
|
'station_latitude' => 'required|numeric',
|
||||||
|
'station_longitude' => 'required|numeric',
|
||||||
|
'operator_id' => 'nullable|integer',
|
||||||
|
'park_id' => 'required|integer',
|
||||||
|
];
|
||||||
|
|
||||||
|
$messages = [
|
||||||
|
'station_latitude.required' => '緯度は必須項目です。',
|
||||||
|
'station_longitude.required' => '経度は必須項目です。',
|
||||||
|
];
|
||||||
|
|
||||||
|
$validator = Validator::make($request->all(), $rules, $messages);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return redirect()->back()->withErrors($validator)->withInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::transaction(function () use ($request, $record) {
|
||||||
|
$record->update($request->only([
|
||||||
|
'station_neighbor_station',
|
||||||
|
'station_name_ruby',
|
||||||
|
'station_route_name',
|
||||||
|
'park_id',
|
||||||
|
'operator_id',
|
||||||
|
'station_latitude',
|
||||||
|
'station_longitude',
|
||||||
|
]));
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect()->route('stations')->with('success', '更新しました。');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 詳細
|
|
||||||
*/
|
|
||||||
public function info($id)
|
|
||||||
{
|
|
||||||
$station = Station::findOrFail($id);
|
|
||||||
return view('admin.stations.info', compact('station'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 削除
|
* 削除(単一/複数対応)
|
||||||
*/
|
*/
|
||||||
public function delete(Request $request)
|
public function delete(Request $request)
|
||||||
{
|
{
|
||||||
$ids = $request->input('pk'); // 複数ID対応
|
$ids = [];
|
||||||
|
|
||||||
if (!empty($ids)) {
|
if ($request->filled('id')) {
|
||||||
Station::destroy($ids);
|
$ids[] = (int) $request->input('id');
|
||||||
return redirect()->route('stations')->with('success', '削除しました');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('stations')->with('error', '削除対象が見つかりません');
|
if (is_array($request->input('pk'))) {
|
||||||
|
$ids = array_merge($ids, $request->input('pk'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$ids = array_values(array_unique(array_map('intval', $ids)));
|
||||||
|
|
||||||
|
if (empty($ids)) {
|
||||||
|
return back()->with('error', '削除対象が選択されていません。');
|
||||||
|
}
|
||||||
|
|
||||||
|
Station::whereIn('station_id', $ids)->delete();
|
||||||
|
|
||||||
|
return redirect()->route('stations')->with('success', '削除しました');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CSVインポート(仮)
|
* CSVインポート(仮)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -15,5 +15,12 @@ class Station extends Model
|
|||||||
'station_name_ruby',
|
'station_name_ruby',
|
||||||
'station_route_name',
|
'station_route_name',
|
||||||
'operator_id',
|
'operator_id',
|
||||||
|
'station_latitude', // ← 緯度
|
||||||
|
'station_longitude', // ← 経度
|
||||||
];
|
];
|
||||||
|
public function park()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Park::class, 'park_id', 'park_id');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -254,6 +254,9 @@ return [
|
|||||||
'user_categoryid' => '利用者分類ID',
|
'user_categoryid' => '利用者分類ID',
|
||||||
'pplace_id' => '駐輪車室ID',
|
'pplace_id' => '駐輪車室ID',
|
||||||
'price' => '駐輪料金(税込)',
|
'price' => '駐輪料金(税込)',
|
||||||
|
'floor_sort' => '階数ソート順',
|
||||||
|
|
||||||
|
|
||||||
// SWA-59
|
// SWA-59
|
||||||
'ope_id' => 'オペレータID',
|
'ope_id' => 'オペレータID',
|
||||||
// 'ope_id' => 'オペレータ名',
|
// 'ope_id' => 'オペレータ名',
|
||||||
@ -423,6 +426,17 @@ return [
|
|||||||
'edit_master' => 'マスタ編集',
|
'edit_master' => 'マスタ編集',
|
||||||
'web_master' => 'ウェブ参照マスタ',
|
'web_master' => 'ウェブ参照マスタ',
|
||||||
'auto_change_date' => 'ウェブ参照マスタ自動切り替え日時',
|
'auto_change_date' => 'ウェブ参照マスタ自動切り替え日時',
|
||||||
|
//SWA-65
|
||||||
|
'station_id' => '近傍駅ID',
|
||||||
|
'created_at' => '登録日時',
|
||||||
|
'updated_at' => '更新日時',
|
||||||
|
'park_id' => '駐輪場ID',
|
||||||
|
'station_neighbor_station' => '近傍駅',
|
||||||
|
'station_name_ruby' => '近傍駅ふりがな',
|
||||||
|
'station_route_name' => '路線名',
|
||||||
|
'station_latitude' => '近傍駅座標(緯度)',
|
||||||
|
'station_longitude' => '近傍駅座標(経度)',
|
||||||
|
'operator_id' => '更新オペレータID',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,62 +1,102 @@
|
|||||||
|
{{-- アラート --}}
|
||||||
@if(Session::has('success'))
|
@if(Session::has('success'))
|
||||||
<div class="alert alert-success alert-dismissible" role="alert">
|
<div class="alert alert-success alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
{{ Session::get('success') }}
|
{{ Session::get('success') }}
|
||||||
</div>
|
</div>
|
||||||
@elseif(Session::has('error'))
|
@endif
|
||||||
|
|
||||||
|
@if($errors->any())
|
||||||
<div class="alert alert-danger alert-dismissible">
|
<div class="alert alert-danger alert-dismissible">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<h4><i class="icon fa fa-ban"></i> {{__('誤差')}}:</h4>
|
<h4><i class="icon fa fa-ban"></i> {{ __('入力内容に不備があります:') }}</h4>
|
||||||
{!! Session::get('error') !!}
|
<ul>
|
||||||
</div>
|
@foreach($errors->all() as $error)
|
||||||
@elseif(isset($errorMsg))
|
<li>{{ $error }}</li>
|
||||||
<div class="alert alert-danger alert-dismissible">
|
@endforeach
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
</ul>
|
||||||
<h4><i class="icon fa fa-ban"></i> {{__('誤差')}}:</h4>
|
|
||||||
{!! $errorMsg !!}
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
{{-- ▼ 駐輪分類ID(編集時のみ表示) --}}
|
||||||
|
@if($isEdit && isset($record->ptype_id))
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-sm-2 col-form-label">駐輪分類ID</label>
|
<label class="col-sm-2 col-form-label">駐輪分類ID</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" name="ptype_id" class="form-control" value="{{ old('ptype_id', $item->ptype_id ?? '') }}" @if(isset($item->ptype_id)) readonly @endif>
|
<input type="text"
|
||||||
|
name="ptype_id"
|
||||||
|
class="form-control"
|
||||||
|
value="{{ $record->ptype_id }}"
|
||||||
|
readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- ▼ 駐輪分類名 --}}
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-sm-2 col-form-label">駐輪分類名<span class="text-danger">*</span></label>
|
<label class="col-sm-2 col-form-label">
|
||||||
|
駐輪分類名<span class="text-danger">*</span>
|
||||||
|
</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" name="ptype_subject" class="form-control" value="{{ old('ptype_subject', $item->ptype_subject ?? '') }}" required>
|
<input type="text"
|
||||||
|
name="ptype_subject"
|
||||||
|
class="form-control"
|
||||||
|
value="{{ $isEdit ? old('ptype_subject', $record->ptype_subject ?? '') : '' }}"
|
||||||
|
placeholder="{{ __('validation.attributes.psection_subject') }}"
|
||||||
|
required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 階数ソート順 --}}
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-sm-2 col-form-label">階数ソート順</label>
|
<label class="col-sm-2 col-form-label">階数ソート順</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" name="floor_sort" class="form-control" value="{{ old('floor_sort', $item->floor_sort ?? '') }}">
|
<input type="text"
|
||||||
|
name="floor_sort"
|
||||||
|
class="form-control"
|
||||||
|
value="{{ $isEdit ? old('floor_sort', $record->floor_sort ?? '') : '' }}"
|
||||||
|
placeholder="{{ __('validation.attributes.floor_sort') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 備考 --}}
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-sm-2 col-form-label">備考</label>
|
<label class="col-sm-2 col-form-label">備考</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" name="ptype_remarks" class="form-control" value="{{ old('ptype_remarks', $item->ptype_remarks ?? '') }}">
|
<input type="text"
|
||||||
|
name="ptype_remarks"
|
||||||
|
class="form-control"
|
||||||
|
value="{{ $isEdit ? old('ptype_remarks', $record->ptype_remarks ?? '') : '' }}"
|
||||||
|
placeholder="{{ $isEdit ? '' : __('validation.attributes.ptype_remarks') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 下部ボタン --}}
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="form-group col-md-10 d-flex align-items-center gap-2 justify-content-start">
|
||||||
|
|
||||||
|
{{-- 登録ボタン --}}
|
||||||
|
@if($isEdit)
|
||||||
|
<button type="button" id="register_edit" class="btn btn-lg btn-success mr-2">
|
||||||
|
{{ __('登録') }}
|
||||||
|
</button>
|
||||||
|
@else
|
||||||
|
<button type="button" id="register" class="btn btn-lg btn-success mr-2 register">
|
||||||
|
{{ __('登録') }}
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- 削除ボタン(編集時のみ表示) --}}
|
||||||
|
@if($isEdit)
|
||||||
|
<button type="button" id="delete_edit" class="btn btn-lg btn-danger">
|
||||||
|
{{ __('削除') }}
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ▼ 下部ボタン --}}
|
|
||||||
<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(!empty($ptype_id))
|
|
||||||
</form>
|
|
||||||
<form method="POST" action="{{ route('ptypes_delete') }}"
|
|
||||||
onsubmit="return confirm('本当に削除しますか?')" class="d-inline-block mr-2">
|
|
||||||
@csrf
|
|
||||||
<input type="hidden" name="pk" value="{{ $ptype_id }}">
|
|
||||||
<button type="submit" class="btn btn-lg btn-danger mr-2">{{ __('削除') }}</button>
|
|
||||||
</form>
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title', '[東京都|〇〇駐輪場] 駐輪分類マスタ')
|
@section('title', '新規')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
@ -8,14 +8,13 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<h1 class="m-0 text-dark">新規登録</h1>
|
<h1 class="m-0 text-dark">新規</h1>
|
||||||
</div><!-- /.col -->
|
</div><!-- /.col -->
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<ol class="breadcrumb float-sm-right text-sm">
|
<ol class="breadcrumb float-sm-right text-sm">
|
||||||
<li class="breadcrumb-item"><a href="./index2.html">ホーム</a></li>
|
<li class="breadcrumb-item"><a href="./index2.html">ホーム</a></li>
|
||||||
<!-- <li class="breadcrumb-item"><a href="./index3.html">[東京都|〇〇駐輪場]</a></li> -->
|
|
||||||
<li class="breadcrumb-item"><a href="{{ route('ptypes') }}">駐輪分類マスタ</a></li>
|
<li class="breadcrumb-item"><a href="{{ route('ptypes') }}">駐輪分類マスタ</a></li>
|
||||||
<li class="breadcrumb-item active">新規登録</li>
|
<li class="breadcrumb-item active">新規</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div><!-- /.col -->
|
</div><!-- /.col -->
|
||||||
</div><!-- /.row -->
|
</div><!-- /.row -->
|
||||||
@ -31,11 +30,9 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<form method="post" action="{{ route('ptypes_add')}}" enctype="multipart/form-data">
|
<form id="form_add" action="{{ route('ptypes_add') }}" method="POST">
|
||||||
<!-- TOKEN FORM -->
|
@csrf
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" >
|
@include('admin.ptypes._form', ['isEdit' => false, 'record' => $record])
|
||||||
<!-- / .TOKEN FORM -->
|
|
||||||
@include('admin.ptypes._form',['isEdit'=>0,'isInfo'=>0])
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title', '[東京都|〇〇駐輪場] 駐輪分類マスタ')
|
@section('title', '編集')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
@ -21,23 +21,26 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- /.content-header -->
|
<!-- /.content-header -->
|
||||||
|
|
||||||
<!-- Main content -->
|
<section class="content">
|
||||||
<section class="content">
|
<div class="container-fluid">
|
||||||
<div class="container-fluid">
|
<div class="card">
|
||||||
<!-- SELECT2 EXAMPLE -->
|
<form id="form_edit"
|
||||||
|
action="{{ route('ptypes_edit', ['id' => $record->ptype_id]) }}"
|
||||||
|
method="POST">
|
||||||
|
@csrf
|
||||||
|
@include('admin.ptypes._form', ['isEdit' => true])
|
||||||
|
</form>
|
||||||
|
|
||||||
<div class="row">
|
{{-- Delete Form --}}
|
||||||
<div class="col-lg-12">
|
<form id="form_delete"
|
||||||
<div class="card">
|
action="{{ route('ptypes_delete') }}"
|
||||||
<form method="post" action="{{ route('ptypes_edit',['id'=>$ptype_id])}}" enctype="multipart/form-data">
|
method="POST"
|
||||||
@csrf
|
style="display:none;">
|
||||||
@include('admin.ptypes._form',['isEdit'=>1,'isInfo'=>0])
|
@csrf
|
||||||
</form>
|
<input type="hidden" name="id" value="{{ $record->ptype_id }}">
|
||||||
</div>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</div>
|
||||||
<!-- /.content -->
|
</section>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@ -1,47 +0,0 @@
|
|||||||
|
|
||||||
@extends('layouts.app')
|
|
||||||
@section('title', '[東京都|〇〇駐輪場] 駐輪分類マスタ')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<!-- Content Header (Page 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><!-- /.col -->
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<ol class="breadcrumb float-sm-right text-sm">
|
|
||||||
<li class="breadcrumb-item"><a href="./index2.html">XX様info(ホーム)</a></li>
|
|
||||||
<li class="breadcrumb-item"><a href="./index3.html">[東京都|〇〇駐輪場]</a></li>
|
|
||||||
<li class="breadcrumb-item">駐輪分類マスタ</li>
|
|
||||||
<li class="breadcrumb-item active">利用者マスタ</li>
|
|
||||||
</ol>
|
|
||||||
</div><!-- /.col -->
|
|
||||||
</div><!-- /.row -->
|
|
||||||
</div><!-- /.container-fluid -->
|
|
||||||
</div>
|
|
||||||
<!-- /.content-header -->
|
|
||||||
|
|
||||||
<!-- Main content -->
|
|
||||||
<section class="content">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<!-- SELECT2 EXAMPLE -->
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-12">
|
|
||||||
<div class="card">
|
|
||||||
<form method="post" action="{{ route('ptype_info',['id'=>$ptype_id])}}" enctype="multipart/form-data">
|
|
||||||
<!-- TOKEN FORM -->
|
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" >
|
|
||||||
<!-- / .TOKEN FORM -->
|
|
||||||
@include('admin.ptypes._form',['isEdit'=>0,'isInfo'=>1])
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
<!-- /.content -->
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@ -1,8 +1,7 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title', '[東京都|〇〇駐輪場] 駐輪分類マスタ')
|
@section('title', '駐輪分類マスタ')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
{{-- ▼ コンテンツヘッダー(パンくず) --}}
|
|
||||||
<div class="content-header">
|
<div class="content-header">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
@ -12,7 +11,6 @@
|
|||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<ol class="breadcrumb float-sm-right text-sm">
|
<ol class="breadcrumb float-sm-right text-sm">
|
||||||
<li class="breadcrumb-item"><a href="{{route('home')}}">ホーム</a></li>
|
<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>
|
<li class="breadcrumb-item active">{{__('駐輪分類マスタ')}}</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
@ -32,32 +30,13 @@
|
|||||||
{{-- ▼ アクションボタン(市区マスタ準拠) --}}
|
{{-- ▼ アクションボタン(市区マスタ準拠) --}}
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<a href="{{ route('ptypes_add') }}" class="btn btn-sm btn-default">新規</a>
|
<a href="{{ route('ptypes_add') }}" class="btn btn-sm btn-default">新規</a>
|
||||||
<button type="submit" form="deleteForm" class="btn btn-sm btn-default ml-2"
|
<button type="button" class="btn btn-sm btn-default mr10" id="delete">削除</button>
|
||||||
onclick="return confirm('選択した分類を削除しますか?');">削除</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ▼ フラッシュメッセージ --}}
|
|
||||||
@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
|
|
||||||
|
|
||||||
{{-- ▼ 一覧(編集+チェックを統合列に変更:背景 #faebd7) --}}
|
{{-- ▼ 一覧(編集+チェックを統合列に変更:背景 #faebd7) --}}
|
||||||
<form id="deleteForm" method="POST" action="{{ route('ptypes_delete') }}">
|
<form id="form_delete" method="POST" action="{{ route('ptypes_delete') }}">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
{{-- ▼ ページネーション(表の上に表示) --}}
|
{{-- ▼ ページネーション(表の上に表示) --}}
|
||||||
@ -66,71 +45,65 @@
|
|||||||
'sort' => $sort ?? '',
|
'sort' => $sort ?? '',
|
||||||
'sort_type' => $sort_type ?? ''
|
'sort_type' => $sort_type ?? ''
|
||||||
])->links('pagination') }}
|
])->links('pagination') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ フラッシュメッセージ --}}
|
||||||
|
@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
|
||||||
|
|
||||||
|
{{-- ▼ 一覧表 --}}
|
||||||
<table class="table table-bordered dataTable text-nowrap">
|
<table class="table table-bordered dataTable text-nowrap">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
{{-- ★ チェック + 編集 用の1列 --}}
|
<th style="width:140px;" class="text-left">
|
||||||
<th style="width:140px; border-left:1px solid #dcdcdc;" class="text-left">
|
|
||||||
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
|
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
|
||||||
</th>
|
</th>
|
||||||
|
<th>駐輪分類ID</th>
|
||||||
</th>
|
<th>駐輪分類名</th>
|
||||||
{{-- ▼ ソート対象列 --}}
|
<th>階数ソート順</th>
|
||||||
<th class="sorting {{ ($sort=='ptype_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
|
<th>備考</th>
|
||||||
sort="ptype_id">
|
|
||||||
<span>駐輪分類ID</span>
|
|
||||||
</th>
|
|
||||||
{{-- ▼ ソート不可列 --}}
|
|
||||||
<th><span>駐輪分類名</span></th>
|
|
||||||
<th><span>階数ソート順</span></th>
|
|
||||||
<th><span>備考</span></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="bg-white">
|
<tbody class="bg-white">
|
||||||
@foreach($list as $item)
|
@foreach($list as $item)
|
||||||
<tr>
|
<tr>
|
||||||
{{-- ▼ 統合セル:チェック + 編集 --}}
|
<td style="background-color:#faebd7;">
|
||||||
<td class="align-middle" style="background-color:#faebd7; border-left:1px solid #dcdcdc;">
|
<input type="checkbox" name="pk[]" value="{{ $item->ptype_id }}">
|
||||||
<div class="d-flex align-items-center">
|
<a href="{{ route('ptypes_edit', ['id' => $item->ptype_id]) }}"
|
||||||
<input type="checkbox" name="pk[]" value="{{ $item->ptype_id }}">
|
class="btn btn-sm btn-default ml10">編集</a>
|
||||||
<a href="{{ route('ptypes_edit', ['id' => $item->ptype_id]) }}"
|
</td>
|
||||||
class="btn btn-sm btn-default ml10">編集</a>
|
<td>{{ $item->ptype_id }}</td>
|
||||||
</div>
|
<td>{{ $item->ptype_subject }}</td>
|
||||||
</td>
|
<td>
|
||||||
{{-- ▼ データ列 --}}
|
@if(!is_null($item->floor_sort))
|
||||||
<td>{{ $item->ptype_id }}</td>
|
{{ $item->floor_sort }} 階
|
||||||
<td>{{ $item->ptype_subject }}</td>
|
@endif
|
||||||
<td>{{ $item->floor_sort }}</td>
|
</td>
|
||||||
<td>{{ $item->ptype_remarks }}</td>
|
<td>{{ $item->ptype_remarks }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('scripts')
|
|
||||||
<script>
|
|
||||||
$(function(){
|
|
||||||
$('.sorting').click(function(){
|
|
||||||
let sort = $(this).attr('sort');
|
|
||||||
let currentSort = $('input[name="sort"]').val();
|
|
||||||
let currentType = $('input[name="sort_type"]').val();
|
|
||||||
let newType = 'asc';
|
|
||||||
|
|
||||||
if (sort === currentSort) {
|
|
||||||
newType = (currentType === 'asc') ? 'desc' : 'asc';
|
|
||||||
}
|
|
||||||
$('input[name="sort"]').val(sort);
|
|
||||||
$('input[name="sort_type"]').val(newType);
|
|
||||||
$('#list-form').submit();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
|
|||||||
@ -1,153 +1,167 @@
|
|||||||
|
{{-- アラート --}}
|
||||||
@if(Session::has('success'))
|
@if(Session::has('success'))
|
||||||
<div class="alert alert-success alert-dismissible" role="alert">
|
<div class="alert alert-success alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
{{ Session::get('success') }}
|
{{ Session::get('success') }}
|
||||||
</div>
|
</div>
|
||||||
@elseif(Session::has('error'))
|
@endif
|
||||||
|
|
||||||
|
@if($errors->any())
|
||||||
<div class="alert alert-danger alert-dismissible">
|
<div class="alert alert-danger alert-dismissible">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<h4><i class="icon fa fa-ban"></i> {{__('誤差')}}:</h4>
|
<h4><i class="icon fa fa-ban"></i> {{ __('入力内容に不備があります:') }}</h4>
|
||||||
{!! Session::get('error') !!}
|
<ul>
|
||||||
|
@foreach($errors->all() as $error)
|
||||||
|
<li>{{ $error }}</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{-- バリデーションエラー表示 --}}
|
|
||||||
@if ($errors->any())
|
{{-- ▼ 近傍駅ID(自動採番:編集時のみ表示) --}}
|
||||||
<div class="alert alert-danger">
|
@if($isEdit)
|
||||||
<ul class="mb-0">
|
<div class="form-group row">
|
||||||
@foreach ($errors->all() as $error)
|
<label class="col-sm-2 col-form-label">近傍駅ID</label>
|
||||||
<li>{{ $error }}</li>
|
<div class="col-sm-10">
|
||||||
@endforeach
|
<input type="text"
|
||||||
</ul>
|
name="station_id"
|
||||||
|
class="form-control text-right bg-light"
|
||||||
|
value="{{ old('station_id', $record->station_id ?? '') }}"
|
||||||
|
maxlength="10"
|
||||||
|
readonly>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="row">
|
{{-- ▼ 駐車場 --}}
|
||||||
|
<div class="form-group row">
|
||||||
<!-- 近傍駅ID(自動採番) -->
|
<label class="col-sm-2 col-form-label required">駐車場</label>
|
||||||
<div class="col-3">
|
<div class="col-sm-10">
|
||||||
<label>{{ __('近傍駅ID') }}</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-9">
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" name="station_id"
|
<select name="park_id"
|
||||||
class="form-control text-right bg-light"
|
class="form-control form-control-lg"
|
||||||
value="{{ old('station_id', $station->station_id ?? '') }}"
|
required>
|
||||||
maxlength="10" readonly>
|
<option value="">{{ __('validation.attributes.park_id') }}</option>
|
||||||
|
@foreach($parks as $id => $name)
|
||||||
|
<option value="{{ $id }}"
|
||||||
|
{{ old('park_id', $record->park_id ?? '') == $id ? 'selected' : '' }}>
|
||||||
|
{{ $name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 駐輪場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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 近傍駅 -->
|
|
||||||
<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"
|
|
||||||
value="{{ old('station_neighbor_station', $station->station_neighbor_station ?? '') }}"
|
|
||||||
maxlength="50" required>
|
|
||||||
</div>
|
|
||||||
@error('station_neighbor_station')
|
|
||||||
<div class="text-danger small">{{ $message }}</div>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 近傍駅ふりがな -->
|
|
||||||
<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"
|
|
||||||
value="{{ old('station_name_ruby', $station->station_name_ruby ?? '') }}"
|
|
||||||
maxlength="50" required>
|
|
||||||
</div>
|
|
||||||
@error('station_name_ruby')
|
|
||||||
<div class="text-danger small">{{ $message }}</div>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 路線名 -->
|
|
||||||
<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"
|
|
||||||
value="{{ old('station_route_name', $station->station_route_name ?? '') }}"
|
|
||||||
maxlength="50" required>
|
|
||||||
</div>
|
|
||||||
@error('station_route_name')
|
|
||||||
<div class="text-danger small">{{ $message }}</div>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 緯度 -->
|
|
||||||
<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"
|
|
||||||
value="{{ old('latitude', $station->latitude ?? '') }}"
|
|
||||||
step="any" maxlength="20" required>
|
|
||||||
</div>
|
|
||||||
@error('latitude')
|
|
||||||
<div class="text-danger small">{{ $message }}</div>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 経度 -->
|
|
||||||
<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"
|
|
||||||
value="{{ old('longitude', $station->longitude ?? '') }}"
|
|
||||||
step="any" maxlength="20" required>
|
|
||||||
</div>
|
|
||||||
@error('longitude')
|
|
||||||
<div class="text-danger small">{{ $message }}</div>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- ▼ 下部ボタン --}}
|
|
||||||
<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(!empty($station->station_id))
|
<div class="form-group row">
|
||||||
</form>
|
<label class="col-sm-2 col-form-label required">近傍駅</label>
|
||||||
<form method="POST" action="{{ route('stations_delete') }}"
|
<div class="col-sm-10">
|
||||||
onsubmit="return confirm('本当に削除しますか?')" class="d-inline-block">
|
<input type="text"
|
||||||
@csrf
|
name="station_neighbor_station"
|
||||||
<input type="hidden" name="pk" value="{{ $station->station_id }}">
|
class="form-control"
|
||||||
<button type="submit" class="btn btn-lg btn-danger mr-2">{{ __('削除') }}</button>
|
value="{{ old('station_neighbor_station', $record->station_neighbor_station ?? '') }}"
|
||||||
</form>
|
maxlength="50"
|
||||||
@endif
|
placeholder="{{ __('validation.attributes.station_neighbor_station') }}"
|
||||||
|
required>
|
||||||
|
<!-- @error('station_neighbor_station')
|
||||||
|
<div class="text-danger small">{{ $message }}</div>
|
||||||
|
@enderror -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 近傍駅ふりがな --}}
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-sm-2 col-form-label required">近傍駅ふりがな</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="text"
|
||||||
|
name="station_name_ruby"
|
||||||
|
class="form-control"
|
||||||
|
value="{{ old('station_name_ruby', $record->station_name_ruby ?? '') }}"
|
||||||
|
maxlength="50"
|
||||||
|
placeholder="{{ __('validation.attributes.station_name_ruby') }}"
|
||||||
|
required>
|
||||||
|
<!-- @error('station_name_ruby')
|
||||||
|
<div class="text-danger small">{{ $message }}</div>
|
||||||
|
@enderror -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 路線名 --}}
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-sm-2 col-form-label required">路線名</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="text"
|
||||||
|
name="station_route_name"
|
||||||
|
class="form-control"
|
||||||
|
value="{{ old('station_route_name', $record->station_route_name ?? '') }}"
|
||||||
|
maxlength="50"
|
||||||
|
placeholder="{{ __('validation.attributes.station_route_name') }}"
|
||||||
|
required>
|
||||||
|
<!-- @error('station_route_name')
|
||||||
|
<div class="text-danger small">{{ $message }}</div>
|
||||||
|
@enderror -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 緯度 --}}
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-sm-2 col-form-label required">近傍駅座標(緯度)</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="number"
|
||||||
|
name="station_latitude"
|
||||||
|
class="form-control"
|
||||||
|
value="{{ old('station_latitude', $record->station_latitude ?? '') }}"
|
||||||
|
step="any"
|
||||||
|
maxlength="20"
|
||||||
|
placeholder="{{ __('validation.attributes.station_latitude') }}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 経度 --}}
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-sm-2 col-form-label required">近傍駅座標(経度)</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="number"
|
||||||
|
name="station_longitude"
|
||||||
|
class="form-control"
|
||||||
|
value="{{ old('station_longitude', $record->station_longitude ?? '') }}"
|
||||||
|
step="any"
|
||||||
|
maxlength="20"
|
||||||
|
placeholder="{{ __('validation.attributes.station_longitude') }}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- ▼ 下部ボタン --}}
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="form-group col-md-10 d-flex align-items-center gap-2 justify-content-start">
|
||||||
|
|
||||||
|
{{-- 登録ボタン --}}
|
||||||
|
@if($isEdit)
|
||||||
|
<button type="button" id="register_edit" class="btn btn-lg btn-success mr-2">
|
||||||
|
{{ __('登録') }}
|
||||||
|
</button>
|
||||||
|
@else
|
||||||
|
<button type="button" id="register" class="btn btn-lg btn-success mr-2 register">
|
||||||
|
{{ __('登録') }}
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- 削除ボタン(編集時のみ表示) --}}
|
||||||
|
@if($isEdit)
|
||||||
|
<button type="button" id="delete_edit" class="btn btn-lg btn-danger">
|
||||||
|
{{ __('削除') }}
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title', '[東京都|〇〇駐輪場] 近傍駅マスタ')
|
@section('title', '新規')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="content-header">
|
<div class="content-header">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<h1 class="m-0 text-dark">新規登録</h1>
|
<h1 class="m-0 text-dark">新規</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<ol class="breadcrumb float-sm-right text-sm">
|
<ol class="breadcrumb float-sm-right text-sm">
|
||||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
|
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
|
||||||
<li class="breadcrumb-item"><a href="{{ route('stations') }}">近傍駅マスタ</a></li>
|
<li class="breadcrumb-item"><a href="{{ route('stations') }}">近傍駅マスタ</a></li>
|
||||||
<li class="breadcrumb-item active">新規登録</li>
|
<li class="breadcrumb-item active">新規</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title', '[東京都|〇〇駐輪場] 近傍駅マスタ')
|
@section('title', '編集')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
@ -24,10 +24,21 @@
|
|||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<form method="POST" action="{{ route('stations_edit', ['id' => $station->station_id]) }}">
|
<form id="form_edit"
|
||||||
|
action="{{ route('stations_edit', ['id' => $record->station_id]) }}"
|
||||||
|
method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
@include('admin.stations._form', ['isEdit' => true])
|
@include('admin.stations._form', ['isEdit' => true])
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
{{-- Delete Form --}}
|
||||||
|
<form id="form_delete"
|
||||||
|
action="{{ route('stations_delete') }}"
|
||||||
|
method="POST"
|
||||||
|
style="display:none;">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="id" value="{{ $record->station_id }}">
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@ -1,24 +0,0 @@
|
|||||||
@extends('layouts.admin')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<h1>近傍駅 詳細</h1>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label>駅名:</label>
|
|
||||||
<p>{{ $station->station_neighbor_station }}</p>
|
|
||||||
|
|
||||||
<label>駅名ふりがな:</label>
|
|
||||||
<p>{{ $station->station_name_ruby }}</p>
|
|
||||||
|
|
||||||
<label>路線名:</label>
|
|
||||||
<p>{{ $station->station_route_name }}</p>
|
|
||||||
|
|
||||||
<label>駐輪場ID:</label>
|
|
||||||
<p>{{ $station->park_id }}</p>
|
|
||||||
|
|
||||||
<label>オペレーターID:</label>
|
|
||||||
<p>{{ $station->operator_id }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a href="{{ route('stations') }}" class="btn btn-secondary">戻る</a>
|
|
||||||
@endsection
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title', '[東京都|〇〇駐輪場] 近傍駅マスタ')
|
@section('title', '近傍駅マスタ')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<!-- Content Header -->
|
<!-- Content Header -->
|
||||||
@ -12,7 +12,6 @@
|
|||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<ol class="breadcrumb float-sm-right text-sm">
|
<ol class="breadcrumb float-sm-right text-sm">
|
||||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
|
<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>
|
<li class="breadcrumb-item active">近傍駅マスタ</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
@ -35,9 +34,7 @@
|
|||||||
<div class="col-lg-12 mb-3">
|
<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" onclick="location.href='{{ route('stations_add') }}'">新規</button>
|
||||||
{{-- 削除 --}}
|
{{-- 削除 --}}
|
||||||
<button type="submit" class="btn btn-sm btn-default mr10"
|
<button type="button" class="btn btn-sm btn-default mr10" id="delete">削除</button>
|
||||||
form="form_delete" name="delete"
|
|
||||||
onclick="return confirm('選択した項目を削除しますか?');">削除</button>
|
|
||||||
<button type="submit" class="btn btn-sm btn-default mr10" form="form_export">{{ __('CSV出力') }}</button>
|
<button type="submit" class="btn btn-sm btn-default mr10" form="form_export">{{ __('CSV出力') }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -53,6 +50,7 @@
|
|||||||
|
|
||||||
{{-- ▼ テーブル --}}
|
{{-- ▼ テーブル --}}
|
||||||
<div class="form col-lg-12">
|
<div class="form col-lg-12">
|
||||||
|
{{-- ▼ フラッシュメッセージ --}}
|
||||||
@if(Session::has('success'))
|
@if(Session::has('success'))
|
||||||
<div class="alert alert-success alert-dismissible" role="alert">
|
<div class="alert alert-success alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
@ -61,9 +59,15 @@
|
|||||||
@elseif(Session::has('error'))
|
@elseif(Session::has('error'))
|
||||||
<div class="alert alert-danger alert-dismissible">
|
<div class="alert alert-danger alert-dismissible">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<h4><i class="icon fa fa-ban"></i> {{ __('誤差') }}:</h4>
|
<h4><i class="icon fa fa-ban"></i> {{__('入力内容に不備があります')}}:</h4>
|
||||||
{!! Session::get('error') !!}
|
{!! Session::get('error') !!}
|
||||||
</div>
|
</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
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -102,7 +106,8 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="sm-item text-left align-middle">{{ $station->station_id }}</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->park_id }}</td> -->
|
||||||
|
<td class="sm-item text-left align-middle">{{ $station->park->park_name ?? '' }}</td>
|
||||||
<td class="sm-item text-left align-middle">{{ $station->station_neighbor_station }}</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_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_route_name }}</td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user