This commit is contained in:
parent
70bfd18204
commit
6019e68da7
130
app/Http/Controllers/Admin/ZoneController.php
Normal file
130
app/Http/Controllers/Admin/ZoneController.php
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Models\Zone;
|
||||||
|
|
||||||
|
class ZoneController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 一覧表示(絞り込み対応)
|
||||||
|
*/
|
||||||
|
public function list(Request $request)
|
||||||
|
{
|
||||||
|
if ($request->input('action') === 'reset') {
|
||||||
|
return redirect()->route('zones');
|
||||||
|
}
|
||||||
|
|
||||||
|
// ソート設定
|
||||||
|
$sort = $request->input('sort', 'zone_id');
|
||||||
|
$sort_type = $request->input('sort_type', 'desc');
|
||||||
|
|
||||||
|
// ベースクエリ
|
||||||
|
$query = Zone::query();
|
||||||
|
|
||||||
|
// === 絞り込み条件 ===
|
||||||
|
if ($request->filled('zone_id')) {
|
||||||
|
$query->where('zone_id', $request->zone_id);
|
||||||
|
}
|
||||||
|
if ($request->filled('zone_name')) {
|
||||||
|
$query->where('zone_name', 'LIKE', "%{$request->zone_name}%");
|
||||||
|
}
|
||||||
|
if ($request->filled('park_id')) {
|
||||||
|
$query->where('park_id', $request->park_id);
|
||||||
|
}
|
||||||
|
if ($request->filled('ptype_id')) {
|
||||||
|
$query->where('ptype_id', $request->ptype_id);
|
||||||
|
}
|
||||||
|
if ($request->filled('psection_id')) {
|
||||||
|
$query->where('psection_id', $request->psection_id);
|
||||||
|
}
|
||||||
|
if ($request->has('use_flag') && $request->use_flag !== '') {
|
||||||
|
$query->where('use_flag', $request->use_flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ページネーション
|
||||||
|
$zones = $query->orderBy($sort, $sort_type)->paginate(20);
|
||||||
|
|
||||||
|
return view('admin.zones.list', compact(
|
||||||
|
'zones', 'sort', 'sort_type'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新規登録
|
||||||
|
*/
|
||||||
|
public function add(Request $request)
|
||||||
|
{
|
||||||
|
if ($request->isMethod('post')) {
|
||||||
|
$data = $this->validateZone($request);
|
||||||
|
Zone::create($data);
|
||||||
|
|
||||||
|
return redirect()->route('zones')
|
||||||
|
->with('success', 'ゾーンを登録しました');
|
||||||
|
}
|
||||||
|
|
||||||
|
$zone = new Zone();
|
||||||
|
return view('admin.zones.add', compact('zone'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 編集
|
||||||
|
*/
|
||||||
|
public function edit($id, Request $request)
|
||||||
|
{
|
||||||
|
$zone = Zone::findOrFail($id);
|
||||||
|
|
||||||
|
if ($request->isMethod('post')) {
|
||||||
|
$data = $this->validateZone($request);
|
||||||
|
$zone->update($data);
|
||||||
|
|
||||||
|
return redirect()->route('zones')
|
||||||
|
->with('success', 'ゾーンを更新しました');
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('admin.zones.edit', compact('zone'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 詳細表示
|
||||||
|
*/
|
||||||
|
public function info($id)
|
||||||
|
{
|
||||||
|
$zone = Zone::findOrFail($id);
|
||||||
|
|
||||||
|
return view('admin.zones.info', compact('zone'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 削除
|
||||||
|
*/
|
||||||
|
public function delete(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('id');
|
||||||
|
if ($id) {
|
||||||
|
Zone::destroy($id);
|
||||||
|
return redirect()->route('zones')->with('success', 'ゾーンを削除しました');
|
||||||
|
}
|
||||||
|
return redirect()->route('zones')->with('error', '削除対象が指定されていません');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* バリデーション共通化
|
||||||
|
*/
|
||||||
|
private function validateZone(Request $request)
|
||||||
|
{
|
||||||
|
return $request->validate([
|
||||||
|
'zone_name' => 'required|string|max:50',
|
||||||
|
'park_id' => 'required|integer',
|
||||||
|
'ptype_id' => 'nullable|integer',
|
||||||
|
'psection_id' => 'nullable|integer',
|
||||||
|
'zone_number' => 'nullable|integer|min:0',
|
||||||
|
'zone_standard' => 'nullable|integer|min:0',
|
||||||
|
'zone_tolerance' => 'nullable|integer|min:0',
|
||||||
|
'use_flag' => 'nullable|boolean',
|
||||||
|
'memo' => 'nullable|string|max:255',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
44
app/Models/Zone.php
Normal file
44
app/Models/Zone.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Zone extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* テーブル名
|
||||||
|
*/
|
||||||
|
protected $table = 'zone';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主キー
|
||||||
|
*/
|
||||||
|
protected $primaryKey = 'zone_id';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* タイムスタンプを有効化
|
||||||
|
*/
|
||||||
|
public $timestamps = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一括代入可能なカラム
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'park_id',
|
||||||
|
'ptype_id',
|
||||||
|
'psection_id',
|
||||||
|
'zone_name',
|
||||||
|
'zone_number',
|
||||||
|
'zone_standard',
|
||||||
|
'zone_tolerance',
|
||||||
|
'zone_sort',
|
||||||
|
'delete_flag',
|
||||||
|
'ope_id',
|
||||||
|
'created_at',
|
||||||
|
'updated_at',
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -65,8 +65,8 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{{-- チェック + 編集ボタン --}}
|
{{-- チェック + 編集ボタン --}}
|
||||||
<th style="width:120px;" class="text-left">
|
<th style="width:140px;" class="text-left">
|
||||||
<input type="checkbox" class="minimal m-0" id="checkbox_all">
|
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
|
||||||
</th>
|
</th>
|
||||||
<th class="sorting {{ ($sort=='regular_type_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="regular_type_id"><span>定期種別ID</span></th>
|
<th class="sorting {{ ($sort=='regular_type_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="regular_type_id"><span>定期種別ID</span></th>
|
||||||
<th><span>市区名</span></th>
|
<th><span>市区名</span></th>
|
||||||
|
|||||||
@ -71,9 +71,9 @@
|
|||||||
<table class="table table-bordered table-striped dataTable text-nowrap">
|
<table class="table table-bordered table-striped dataTable text-nowrap">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width:120px;" class="text-left">
|
<th style="width:140px;" class="text-left">
|
||||||
<input type="checkbox" class="minimal m-0" id="checkbox_all">
|
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
|
||||||
</th>
|
</th>
|
||||||
<th sort="setting_id" class="sorting {{ ($sort=='setting_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"><span>{{ __('設定ID') }}</span></th>
|
<th sort="setting_id" class="sorting {{ ($sort=='setting_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"><span>{{ __('設定ID') }}</span></th>
|
||||||
<th sort="edit_master" class="sorting {{ ($sort=='edit_master') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"><span>{{ __('編集マスタ') }}</span></th>
|
<th sort="edit_master" class="sorting {{ ($sort=='edit_master') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"><span>{{ __('編集マスタ') }}</span></th>
|
||||||
<th sort="web_master" class="sorting {{ ($sort=='web_master') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"><span>{{ __('ウェブ参照マスタ') }}</span></th>
|
<th sort="web_master" class="sorting {{ ($sort=='web_master') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"><span>{{ __('ウェブ参照マスタ') }}</span></th>
|
||||||
|
|||||||
@ -87,9 +87,10 @@
|
|||||||
<table class="table table-bordered table-striped dataTable text-nowrap">
|
<table class="table table-bordered table-striped dataTable text-nowrap">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width:120px;" class="text-left">
|
<th style="width:140px;" class="text-left">
|
||||||
<input type="checkbox" class="minimal m-0" id="checkbox_all">
|
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
<th class="sorting {{ ($sort=='settlement_transaction_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="settlement_transaction_id"><span>決済トランザクションID</span></th>
|
<th class="sorting {{ ($sort=='settlement_transaction_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="settlement_transaction_id"><span>決済トランザクションID</span></th>
|
||||||
<th class="sorting {{ ($sort=='contract_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="contract_id"><span>定期契約ID</span></th>
|
<th class="sorting {{ ($sort=='contract_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="contract_id"><span>定期契約ID</span></th>
|
||||||
<th class="sorting {{ ($sort=='status') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="status"><span>ステータス</span></th>
|
<th class="sorting {{ ($sort=='status') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="status"><span>ステータス</span></th>
|
||||||
@ -110,10 +111,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="table-warning align-middle">
|
<td class="table-warning align-middle">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<input type="checkbox" class="minimal m-0 checkbox" name="ids[]" value="{{ $item->settlement_transaction_id }}">
|
<input type="checkbox" class="m-0 checkbox" name="pk[]" value="{{ $item->settlement_transaction_id }}">
|
||||||
<a href="{{ route('settlement_transactions_edit', ['id' => $item->settlement_transaction_id]) }}" class="btn btn-sm btn-default ml-2">編集</a>
|
<a href="{{ route('settlement_transactions_edit', ['id' => $item->settlement_transaction_id]) }}" class="btn btn-sm btn-default ml-2">編集</a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="sm-item text-left align-middle">{{ $item->settlement_transaction_id }}</td>
|
<td class="sm-item text-left align-middle">{{ $item->settlement_transaction_id }}</td>
|
||||||
<td class="sm-item text-left align-middle">{{ $item->contract_id }}</td>
|
<td class="sm-item text-left align-middle">{{ $item->contract_id }}</td>
|
||||||
<td class="sm-item text-left align-middle">{{ $item->status }}</td>
|
<td class="sm-item text-left align-middle">{{ $item->status }}</td>
|
||||||
|
|||||||
93
resources/views/admin/zones/_form.blade.php
Normal file
93
resources/views/admin/zones/_form.blade.php
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
@csrf
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">ゾーン名ID<span class="text-danger">※</span></label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="text" name="zone_id" class="form-control"
|
||||||
|
value="{{ old('zone_id', $zone->zone_id ?? '') }}" required>
|
||||||
|
@error('zone_id')
|
||||||
|
<span class="text-danger">{{ $message }}</span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">駐輪場ID<span class="text-danger">※</span></label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="number" name="park_id" class="form-control"
|
||||||
|
value="{{ old('park_id', $zone->park_id ?? '') }}" required>
|
||||||
|
@error('park_id')
|
||||||
|
<span class="text-danger">{{ $message }}</span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">駐輪分類ID</label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="number" name="ptype_id" class="form-control"
|
||||||
|
value="{{ old('ptype_id', $zone->ptype_id ?? '') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">車種区分ID</label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="number" name="psection_id" class="form-control"
|
||||||
|
value="{{ old('psection_id', $zone->psection_id ?? '') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">ゾーン名<span class="text-danger">※</span></label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="text" name="zone_name" class="form-control"
|
||||||
|
value="{{ old('zone_name', $zone->zone_name ?? '') }}" required>
|
||||||
|
@error('zone_name')
|
||||||
|
<span class="text-danger">{{ $message }}</span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">ゾーン内現在契約台数</label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="number" name="zone_number" class="form-control"
|
||||||
|
value="{{ old('zone_number', $zone->zone_number ?? '') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">ゾーン内標準台数</label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="number" name="zone_standard" class="form-control"
|
||||||
|
value="{{ old('zone_standard', $zone->zone_standard ?? '') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">ゾーン内許容台数</label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="number" name="zone_tolerance" class="form-control"
|
||||||
|
value="{{ old('zone_tolerance', $zone->zone_tolerance ?? '') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label">ゾーン順</label>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<input type="number" name="zone_sort" class="form-control form-control-lg"
|
||||||
|
value="{{ old('zone_sort', $zone->zone_sort ?? '') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-12 text-left">
|
||||||
|
@if(isset($zone) && $zone->zone_id)
|
||||||
|
{{-- 編集画面 --}}
|
||||||
|
<button type="submit" class="btn btn-primary">保存</button>
|
||||||
|
<a href="{{ route('zones') }}" class="btn btn-secondary">戻る</a>
|
||||||
|
@else
|
||||||
|
{{-- 新規画面 --}}
|
||||||
|
<button type="submit" class="btn btn-success">登録</button>
|
||||||
|
<a href="{{ route('zones') }}" class="btn btn-secondary">削除</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
34
resources/views/admin/zones/add.blade.php
Normal file
34
resources/views/admin/zones/add.blade.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
@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('zones') }}">ゾーンマスタ</a></li>
|
||||||
|
<li class="breadcrumb-item active">新規登録</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="content">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="{{ route('zones_add') }}" method="POST" class="form-horizontal">
|
||||||
|
@include('admin.zones._form')
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endsection
|
||||||
35
resources/views/admin/zones/edit.blade.php
Normal file
35
resources/views/admin/zones/edit.blade.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
@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('zones') }}">ゾーンマスタ</a></li>
|
||||||
|
<li class="breadcrumb-item active">編集</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="content">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="{{ route('zones_edit', $zone->zone_id) }}" method="POST" class="form-horizontal">
|
||||||
|
@method('POST')
|
||||||
|
@include('admin.zones._form')
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endsection
|
||||||
51
resources/views/admin/zones/info.blade.php
Normal file
51
resources/views/admin/zones/info.blade.php
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
@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('zones') }}">ゾーンマスタ</a></li>
|
||||||
|
<li class="breadcrumb-item active">詳細</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="content">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
{{-- 共通フォームをインクルード --}}
|
||||||
|
<form class="form-horizontal">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
{{-- form.blade.phpの内容を読み込み --}}
|
||||||
|
@include('admin.zones.form', ['zone' => $zone])
|
||||||
|
|
||||||
|
{{-- すべてのフォーム要素を非活性にするJS --}}
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
document.querySelectorAll('input, select, textarea').forEach(function(el) {
|
||||||
|
el.setAttribute('disabled', true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="form-group col-12 text-center">
|
||||||
|
<a href="{{ route('zones') }}" class="btn btn-secondary">戻る</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endsection
|
||||||
194
resources/views/admin/zones/list.blade.php
Normal file
194
resources/views/admin/zones/list.blade.php
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
@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 active">ゾーンマスタ</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="content">
|
||||||
|
<!-- ▼ 絞り込みフィルター -->
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">絞り込みフィルター</h3>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="{{ route('zones') }}" method="POST" id="list-form" class="form-horizontal">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="sort" value="{{ $sort ?? '' }}">
|
||||||
|
<input type="hidden" name="sort_type" value="{{ $sort_type ?? '' }}">
|
||||||
|
|
||||||
|
<table class="table table-borderless mb-0" style="width: 100%;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th style="text-align: left;">駐輪場ID</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="park_id" value="{{ old('park_id', $park_id ?? '') }}"
|
||||||
|
class="form-control input-sm" placeholder="123456">
|
||||||
|
</td>
|
||||||
|
<th style="text-align: left;">駐輪分類ID</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="ptype_id" value="{{ old('ptype_id', $ptype_id ?? '') }}"
|
||||||
|
class="form-control input-sm" placeholder="1">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th style="text-align: left;">車種区分ID</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="psection_id" value="{{ old('psection_id', $psection_id ?? '') }}"
|
||||||
|
class="form-control input-sm" placeholder="2">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="form-group col-12 text-left mt-3">
|
||||||
|
<button type="submit" name="action" value="filter" class="btn btn-default">絞り込み</button>
|
||||||
|
<button type="submit" name="action" value="reset" class="btn btn-default">解除</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ▲ 絞り込みフィルター -->
|
||||||
|
|
||||||
|
<!-- ▼ ツールバー -->
|
||||||
|
<div class="container-fluid mb20">
|
||||||
|
<a href="{{ route('zones_add') }}" class="btn btn-sm btn-default mr10">新規</a>
|
||||||
|
<button type="submit" form="deleteForm" class="btn btn-sm btn-default mr10"
|
||||||
|
onclick="return confirm('選択したゾーンを削除しますか?');">削除</button>
|
||||||
|
<div class="d-flex justify-content-end">
|
||||||
|
{{ $zones->appends(request()->all())->links('pagination') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ▲ ツールバー -->
|
||||||
|
|
||||||
|
<!-- ▼ 一覧テーブル -->
|
||||||
|
<div class="col-lg-12 mb20">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<form id="deleteForm" method="POST" action="{{ route('zones_delete') }}">
|
||||||
|
@csrf
|
||||||
|
<table class="table table-bordered table-striped dataTable text-nowrap">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<!-- 全選択チェックボックス -->
|
||||||
|
<th style="width:140px;" class="text-left">
|
||||||
|
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- ゾーンID -->
|
||||||
|
<th class="sorting {{ ($sort=='zone_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="zone_id">
|
||||||
|
<span>ゾーンID</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- 駐輪場ID -->
|
||||||
|
<th class="sorting {{ ($sort=='park_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="park_id">
|
||||||
|
<span>駐輪場ID</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- 駐輪分類ID -->
|
||||||
|
<th class="sorting {{ ($sort=='ptype_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="ptype_id">
|
||||||
|
<span>駐輪分類ID</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- ゾーン名 -->
|
||||||
|
<th class="sorting {{ ($sort=='zone_name') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="zone_name">
|
||||||
|
<span>ゾーン名</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- ゾーン内現在契約台数 -->
|
||||||
|
<th class="sorting {{ ($sort=='zone_number') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="zone_number">
|
||||||
|
<span>ゾーン内現在契約台数</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- ゾーン内標準台数 -->
|
||||||
|
<th class="sorting {{ ($sort=='zone_standard') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="zone_standard">
|
||||||
|
<span>ゾーン内標準台数</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- ゾーン内許容台数 -->
|
||||||
|
<th class="sorting {{ ($sort=='zone_tolerance') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="zone_tolerance">
|
||||||
|
<span>ゾーン内許容台数</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- ゾーン順 -->
|
||||||
|
<th class="sorting {{ ($sort=='zone_sort') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="zone_sort">
|
||||||
|
<span>ゾーン順</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<!-- 車種区分ID -->
|
||||||
|
<th class="sorting {{ ($sort=='psection_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="psection_id">
|
||||||
|
<span>車種区分ID</span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach($zones as $item)
|
||||||
|
<tr>
|
||||||
|
<td class="table-warning align-middle">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<input type="checkbox" class="m-0 checkbox" name="pk[]" value="{{ $item->zone_id }}">
|
||||||
|
<a href="{{ route('zones_edit', ['id' => $item->zone_id]) }}" class="btn btn-sm btn-default ml-2">編集</a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>{{ $item->zone_id }}</td>
|
||||||
|
<td>{{ $item->park_id }}</td>
|
||||||
|
<td>{{ $item->ptype_id }}</td>
|
||||||
|
<td>{{ $item->zone_name }}</td>
|
||||||
|
<td>{{ $item->zone_number }}</td>
|
||||||
|
<td>{{ $item->zone_standard }}</td>
|
||||||
|
<td>{{ $item->zone_tolerance }}</td>
|
||||||
|
<td>{{ $item->zone_sort }}</td>
|
||||||
|
<td>{{ $item->psection_id }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ▲ 一覧テーブル -->
|
||||||
|
</section>
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
// ---------------------
|
||||||
|
// ソート機能
|
||||||
|
// ---------------------
|
||||||
|
document.querySelectorAll('th.sorting').forEach(th => {
|
||||||
|
th.addEventListener('click', function() {
|
||||||
|
const form = document.getElementById('list-form');
|
||||||
|
const current = "{{ $sort ?? '' }}";
|
||||||
|
const currentType = "{{ $sort_type ?? '' }}";
|
||||||
|
const nextCol = this.getAttribute('sort');
|
||||||
|
let nextType = 'asc';
|
||||||
|
if (current === nextCol) {
|
||||||
|
nextType = (currentType === 'asc') ? 'desc' : 'asc';
|
||||||
|
}
|
||||||
|
form.querySelector('[name=sort]').value = nextCol;
|
||||||
|
form.querySelector('[name=sort_type]').value = nextType;
|
||||||
|
form.submit();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
||||||
|
@endsection
|
||||||
@ -399,6 +399,11 @@
|
|||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
<ul class="nav nav-treeview">
|
<ul class="nav nav-treeview">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="{{ route('zones') }}" class="nav-link ml-3">
|
||||||
|
<p class="mb-0">{{ __("ゾーンマスタ") }}</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="{{ route('regular_types') }}" class="nav-link ml-3">
|
<a href="{{ route('regular_types') }}" class="nav-link ml-3">
|
||||||
<p class="mb-0">{{ __("定期種別マスタ") }}</p>
|
<p class="mb-0">{{ __("定期種別マスタ") }}</p>
|
||||||
@ -409,8 +414,7 @@
|
|||||||
<p class="mb-0">{{ __("近傍駅マスタ") }}</p>
|
<p class="mb-0">{{ __("近傍駅マスタ") }}</p>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
<li class="nav-item">
|
|
||||||
<a href="{{ route('terms') }}" class="nav-link ml-3">
|
<a href="{{ route('terms') }}" class="nav-link ml-3">
|
||||||
<p class="mb-0">{{ __("利用契約マスタ") }}</p>
|
<p class="mb-0">{{ __("利用契約マスタ") }}</p>
|
||||||
</a>
|
</a>
|
||||||
@ -438,7 +442,6 @@
|
|||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-item has-treeview">
|
<li class="nav-item has-treeview">
|
||||||
<a href="#" class="nav-link">
|
<a href="#" class="nav-link">
|
||||||
|
|||||||
@ -20,6 +20,8 @@ use App\Http\Controllers\Admin\OperatorQueController;
|
|||||||
use App\Http\Controllers\Admin\SettingController;
|
use App\Http\Controllers\Admin\SettingController;
|
||||||
use App\Http\Controllers\Admin\MailTemplateController;
|
use App\Http\Controllers\Admin\MailTemplateController;
|
||||||
use App\Http\Controllers\Admin\InvSettingController;
|
use App\Http\Controllers\Admin\InvSettingController;
|
||||||
|
use App\Http\Controllers\Admin\ZoneController;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -311,4 +313,19 @@ Route::middleware('auth')->group(function () {
|
|||||||
Route::match(['get', 'post'], '/inv_settings', [InvSettingController::class, 'form'])->name('inv_settings');
|
Route::match(['get', 'post'], '/inv_settings', [InvSettingController::class, 'form'])->name('inv_settings');
|
||||||
Route::post('/inv_settings/save', [InvSettingController::class, 'save'])->name('inv_settings_save');
|
Route::post('/inv_settings/save', [InvSettingController::class, 'save'])->name('inv_settings_save');
|
||||||
|
|
||||||
|
// [東京都|〇〇駐輪場] ゾーンマスタ
|
||||||
|
Route::match(['get', 'post'], '/zones', [ZoneController::class, 'list'])->name('zones');
|
||||||
|
Route::match(['get', 'post'], '/zones/add', [ZoneController::class, 'add'])->name('zones_add');
|
||||||
|
Route::match(['get', 'post'], '/zones/edit/{id}', [ZoneController::class, 'edit'])
|
||||||
|
->where(['id' => '[0-9]+'])
|
||||||
|
->name('zones_edit');
|
||||||
|
Route::match(['get', 'post'], '/zones/info/{id}', [ZoneController::class, 'info'])
|
||||||
|
->where(['id' => '[0-9]+'])
|
||||||
|
->name('zones_info');
|
||||||
|
Route::match(['get', 'post'], '/zones/delete', [ZoneController::class, 'delete'])
|
||||||
|
->name('zones_delete');
|
||||||
|
|
||||||
|
//kin 2025/08/29 end
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user