This commit is contained in:
parent
5b6b4faa14
commit
0498760d46
@ -36,7 +36,7 @@ class DeviceController extends Controller
|
||||
'device_replace',
|
||||
'device_remarks',
|
||||
'operator_id',
|
||||
'ope_auth1', // ← ここもソートできるなら追加
|
||||
'ope_auth1',
|
||||
];
|
||||
|
||||
if (!in_array($sort, $sortable)) {
|
||||
|
||||
@ -30,95 +30,134 @@ class PplaceController extends Controller
|
||||
return view('admin.pplace.list', $inputs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新規登録(画面/処理)
|
||||
*/
|
||||
public function add(Request $request)
|
||||
{
|
||||
$inputs = [
|
||||
'pplace_number' => $request->input('pplace_number'),
|
||||
'pplace_remarks' => $request->input('pplace_remarks'),
|
||||
'operator_id' => $request->input('operator_id'),
|
||||
if ($request->isMethod('get')) {
|
||||
// 新規時:空のレコードとオペレーターリストを渡す
|
||||
return view('admin.pplace.add', [
|
||||
'isEdit' => false,
|
||||
'record' => new Pplace(),
|
||||
'operators' => Ope::getList(),
|
||||
]);
|
||||
}
|
||||
|
||||
// POST時:バリデーション
|
||||
$rules = [
|
||||
'pplace_number' => 'required|string|max:255',
|
||||
'pplace_remarks' => 'nullable|string|max:255',
|
||||
'operator_id' => 'nullable|integer',
|
||||
];
|
||||
$messages = [
|
||||
'pplace_number.required' => '駐輪場所番号は必須です。',
|
||||
];
|
||||
|
||||
$inputs['operators'] = Ope::getList(); //
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($request->isMethod('POST')) {
|
||||
$validator = Validator::make($inputs, [
|
||||
'pplace_number' => 'required|string|max:255',
|
||||
'pplace_remarks' => 'nullable|string|max:255',
|
||||
'operator_id' => 'nullable|integer',
|
||||
]);
|
||||
if ($validator->fails()) {
|
||||
return redirect()->back()
|
||||
->withErrors($validator)
|
||||
->withInput()
|
||||
->with(['operators' => Ope::getList()]);
|
||||
}
|
||||
|
||||
if (!$validator->fails()) {
|
||||
DB::transaction(function () use ($inputs) {
|
||||
$pplace = new Pplace();
|
||||
$pplace->fill($inputs);
|
||||
$pplace->save();
|
||||
// トランザクションで登録処理
|
||||
DB::transaction(function () use ($request) {
|
||||
$new = new Pplace();
|
||||
$new->fill($request->only(['pplace_number', 'pplace_remarks', 'operator_id']));
|
||||
$new->save();
|
||||
});
|
||||
|
||||
return redirect()->route('pplaces')->with('success', '登録しました。');
|
||||
} else {
|
||||
$inputs['errorMsg'] = $this->__buildErrorMessasges($validator);
|
||||
}
|
||||
}
|
||||
|
||||
return view('admin.pplace.add', $inputs);
|
||||
}
|
||||
|
||||
public function edit(Request $request, $id, $view = '')
|
||||
/**
|
||||
* 編集(画面/処理)
|
||||
*/
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
|
||||
// 該当データ取得
|
||||
$record = Pplace::find($id);
|
||||
if (!$record) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
if (!$record) abort(404);
|
||||
// オペレーターリスト取得(常に渡す)
|
||||
$operators = Ope::getList();
|
||||
|
||||
$data = $record->toArray();
|
||||
$data['operators'] = Ope::getList();
|
||||
if ($request->isMethod('get')) {
|
||||
// 編集画面表示
|
||||
return view('admin.pplace.edit', [
|
||||
'isEdit' => true,
|
||||
'record' => $record,
|
||||
'operators' => $operators,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
if ($request->isMethod('POST')) {
|
||||
$inputs = $request->all();
|
||||
$validator = Validator::make($inputs, [
|
||||
// POST時:バリデーション
|
||||
$rules = [
|
||||
'pplace_number' => 'required|string|max:255',
|
||||
'pplace_remarks' => 'nullable|string|max:255',
|
||||
'operator_id' => 'nullable|integer',
|
||||
]);
|
||||
];
|
||||
$messages = [
|
||||
'pplace_number.required' => '駐輪場所番号は必須です。',
|
||||
];
|
||||
|
||||
$data = array_merge($data, $inputs);
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if (!$validator->fails()) {
|
||||
DB::transaction(function () use ($record, $inputs) {
|
||||
$record->fill($inputs);
|
||||
if ($validator->fails()) {
|
||||
return redirect()->back()
|
||||
->withErrors($validator)
|
||||
->withInput()
|
||||
->with(['operators' => $operators]);
|
||||
}
|
||||
|
||||
// 更新処理
|
||||
DB::transaction(function () use ($request, $record) {
|
||||
$record->fill($request->only(['pplace_number', 'pplace_remarks', 'operator_id']));
|
||||
$record->save();
|
||||
});
|
||||
return redirect()->route('pplaces')->with('success', '更新成功');
|
||||
} else {
|
||||
$data['errorMsg'] = $this->__buildErrorMessasges($validator);
|
||||
}
|
||||
|
||||
return redirect()->route('pplaces')->with('success', '更新しました。');
|
||||
}
|
||||
|
||||
return view($view ?: 'admin.pplace.edit', $data);
|
||||
}
|
||||
|
||||
public function info(Request $request, $id)
|
||||
{
|
||||
return $this->edit($request, $id, 'admin.pplace.info');
|
||||
}
|
||||
|
||||
/**
|
||||
* 削除(単一/複数対応)
|
||||
*/
|
||||
public function delete(Request $request)
|
||||
{
|
||||
$arr_pk = $request->get('pk');
|
||||
$ids = [];
|
||||
|
||||
if ($arr_pk) {
|
||||
$ids = is_array($arr_pk) ? $arr_pk : [$arr_pk];
|
||||
|
||||
if (Pplace::deleteByPk($ids)) {
|
||||
return redirect()->route('pplaces')->with('success', __("削除成功しました。"));
|
||||
} else {
|
||||
return redirect()->route('pplaces')->with('error', __('削除に失敗しました。'));
|
||||
}
|
||||
// 単一削除(id)
|
||||
if ($request->filled('id')) {
|
||||
$ids[] = (int) $request->input('id');
|
||||
}
|
||||
|
||||
return redirect()->route('pplaces')->with('error', __('削除するデータを選択してください。'));
|
||||
// 複数削除(チェックボックス pk[])
|
||||
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', '削除対象が選択されていません。');
|
||||
}
|
||||
|
||||
// 削除実行
|
||||
Pplace::whereIn('pplace_id', $ids)->delete();
|
||||
|
||||
return redirect()->route('pplaces')->with('success', '削除しました。');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function export()
|
||||
{
|
||||
|
||||
@ -46,8 +46,8 @@ class PsectionController extends Controller
|
||||
if ($request->isMethod('get')) {
|
||||
// GET:新規画面を表示
|
||||
return view('admin.psection.add', [
|
||||
'isEdit' => false, // フォーム判定用
|
||||
'record' => new Psection(), // ← ★★ これを渡すことで $record が使える
|
||||
'isEdit' => false,
|
||||
'record' => new Psection(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@ -14,24 +14,51 @@ class PtypeController extends Controller
|
||||
{
|
||||
public function list(Request $request)
|
||||
{
|
||||
// 受け取る入力値
|
||||
$inputs = [
|
||||
'isMethodPost' => 0,
|
||||
'isMethodPost' => $request->isMethod('post') ? 1 : 0,
|
||||
'isExport' => 0,
|
||||
'sort' => $request->input('sort', ''),
|
||||
'sort_type' => $request->input('sort_type', ''),
|
||||
'sort' => $request->input('sort', 'ptype_id'), // デフォルト: ID
|
||||
'sort_type' => strtolower($request->input('sort_type', 'asc')),
|
||||
'page' => $request->get('page', 1),
|
||||
|
||||
];
|
||||
$inputs['isMethodPost'] = $request->isMethod('post');
|
||||
$inputs['list'] = Ptype::search($inputs);
|
||||
|
||||
// 許可するソート可能カラム
|
||||
$allowedSortColumns = [
|
||||
'ptype_id',
|
||||
'ptype_subject',
|
||||
'floor_sort',
|
||||
'created_at',
|
||||
];
|
||||
|
||||
// 検索クエリ作成
|
||||
$query = \App\Models\Ptype::query();
|
||||
|
||||
// ソート処理
|
||||
if (in_array($inputs['sort'], $allowedSortColumns, true)) {
|
||||
$sortType = in_array($inputs['sort_type'], ['asc', 'desc'], true)
|
||||
? $inputs['sort_type']
|
||||
: 'asc';
|
||||
|
||||
$query->orderBy($inputs['sort'], $sortType);
|
||||
} else {
|
||||
|
||||
$query->orderBy('ptype_id', 'asc');
|
||||
}
|
||||
|
||||
// ページネーション
|
||||
$inputs['list'] = $query->paginate(20);
|
||||
|
||||
// ページが超過している場合リダイレクト
|
||||
if ($inputs['list']->total() > 0 && $inputs['page'] > $inputs['list']->lastPage()) {
|
||||
return redirect()->route('ptypes');
|
||||
}
|
||||
|
||||
// 画面へ
|
||||
return view('admin.ptypes.list', $inputs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新規登録(画面/処理)
|
||||
*/
|
||||
|
||||
@ -131,7 +131,7 @@ class RegularTypeController extends Controller
|
||||
$record->save();
|
||||
});
|
||||
|
||||
$request->session()->flash('success', __('更新に成功しました'));
|
||||
$request->session()->flash('success', __('更新しました。'));
|
||||
return redirect()->route('regular_types');
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ class TermsController extends Controller
|
||||
]);
|
||||
|
||||
Term::create($validated);
|
||||
return redirect()->route('terms')->with('success', '利用規約が登録されました');
|
||||
return redirect()->route('terms')->with('success', '登録しました。');
|
||||
}
|
||||
// 都市の選択肢を取得
|
||||
$cities = City::pluck('city_name', 'city_id');
|
||||
@ -82,7 +82,7 @@ class TermsController extends Controller
|
||||
]);
|
||||
|
||||
$term->update($validated);
|
||||
return redirect()->route('terms')->with('success', '利用規約が更新されました');
|
||||
return redirect()->route('terms')->with('success', '更新しました。');
|
||||
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ class TermsController extends Controller
|
||||
$deleted = Term::destroy($ids);
|
||||
|
||||
if ($deleted > 0) {
|
||||
return redirect()->route('terms')->with('success', __('削除成功しました。'));
|
||||
return redirect()->route('terms')->with('success', __('削除しました。'));
|
||||
} else {
|
||||
return redirect()->route('terms')->with('error', __('削除に失敗しました。'));
|
||||
}
|
||||
|
||||
@ -6,6 +6,11 @@ use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Zone;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Models\Park;
|
||||
use App\Models\Ptype;
|
||||
use App\Models\Psection;
|
||||
|
||||
|
||||
class ZoneController extends Controller
|
||||
{
|
||||
@ -20,7 +25,7 @@ class ZoneController extends Controller
|
||||
|
||||
// ソート設定
|
||||
$sort = $request->input('sort', 'zone_id');
|
||||
$sort_type = $request->input('sort_type', 'desc');
|
||||
$sort_type = $request->input('sort_type', 'asc');
|
||||
|
||||
// ベースクエリ
|
||||
$query = Zone::query();
|
||||
@ -50,8 +55,8 @@ class ZoneController extends Controller
|
||||
|
||||
// === 下拉选单用の一覧データ ===
|
||||
$parkList = DB::table('park')->pluck('park_name', 'park_id');
|
||||
$ptypeList = DB::table('ptype')->pluck('ptype_id', 'ptype_id'); // 暂时显示 ID
|
||||
$psectionList = DB::table('psection')->pluck('psection_id', 'psection_id'); // 暂时显示 ID
|
||||
$ptypeList = DB::table('ptype')->pluck('ptype_subject', 'ptype_id');
|
||||
$psectionList = DB::table('psection')->pluck('psection_subject', 'psection_id');
|
||||
|
||||
return view('admin.zones.list', compact(
|
||||
'zones', 'sort', 'sort_type',
|
||||
@ -59,65 +64,172 @@ class ZoneController extends Controller
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新規登録
|
||||
* 新規登録(画面/処理)
|
||||
*/
|
||||
public function add(Request $request)
|
||||
{
|
||||
if ($request->isMethod('post')) {
|
||||
$data = $this->validateZone($request);
|
||||
Zone::create($data);
|
||||
if ($request->isMethod('get')) {
|
||||
$parkList = DB::table('park')->pluck('park_name', 'park_id');
|
||||
$ptypeList = DB::table('ptype')->pluck('ptype_subject', 'ptype_id');
|
||||
$psectionList = DB::table('psection')->pluck('psection_subject', 'psection_id');
|
||||
|
||||
return redirect()->route('zones')
|
||||
->with('success', 'ゾーンを登録しました');
|
||||
|
||||
return view('admin.zones.add', [
|
||||
'isEdit' => false,
|
||||
'record' => new Zone(),
|
||||
'parkList' => $parkList,
|
||||
'ptypeList' => $ptypeList,
|
||||
'psectionList' => $psectionList,
|
||||
]);
|
||||
}
|
||||
|
||||
$zone = new Zone();
|
||||
return view('admin.zones.add', compact('zone'));
|
||||
// ▼ POST時:バリデーション
|
||||
$rules = [
|
||||
'park_id' => 'required|integer',
|
||||
'ptype_id' => 'required|integer',
|
||||
'psection_id' => 'required|integer',
|
||||
'zone_name' => 'required|string|max:255',
|
||||
'zone_number' => 'nullable|integer|min:0',
|
||||
'zone_standard' => 'nullable|integer|min:0',
|
||||
'zone_tolerance' => 'nullable|integer|min:0',
|
||||
'zone_sort' => 'nullable|integer|min:0',
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'park_id.required' => '駐輪場は必須です。',
|
||||
'ptype_id.required' => '駐輪分類は必須です。',
|
||||
'psection_id.required' => '車種区分は必須です。',
|
||||
'zone_name.required' => 'ゾーン名は必須です。',
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return redirect()->back()->withErrors($validator)->withInput();
|
||||
}
|
||||
|
||||
// ▼ 登録処理
|
||||
DB::transaction(function () use ($request) {
|
||||
$new = new Zone();
|
||||
$new->fill($request->only([
|
||||
'park_id',
|
||||
'ptype_id',
|
||||
'psection_id',
|
||||
'zone_name',
|
||||
'zone_number',
|
||||
'zone_standard',
|
||||
'zone_tolerance',
|
||||
'zone_sort',
|
||||
]));
|
||||
$new->save();
|
||||
});
|
||||
|
||||
return redirect()->route('zones')->with('success', '登録しました。');
|
||||
}
|
||||
|
||||
/**
|
||||
* 編集
|
||||
* 編集(画面/処理)
|
||||
*/
|
||||
public function edit($id, Request $request)
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
$zone = Zone::findOrFail($id);
|
||||
|
||||
if ($request->isMethod('post')) {
|
||||
$data = $this->validateZone($request);
|
||||
$zone->update($data);
|
||||
|
||||
return redirect()->route('zones')
|
||||
->with('success', 'ゾーンを更新しました');
|
||||
// 該当データ取得
|
||||
$record = Zone::find($id);
|
||||
if (!$record) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
return view('admin.zones.edit', compact('zone'));
|
||||
$parkList = DB::table('park')->pluck('park_name', 'park_id');
|
||||
$ptypeList = DB::table('ptype')->pluck('ptype_subject', 'ptype_id');
|
||||
$psectionList = DB::table('psection')->pluck('psection_subject', 'psection_id');
|
||||
|
||||
|
||||
if ($request->isMethod('get')) {
|
||||
// 編集画面表示
|
||||
return view('admin.zones.edit', [
|
||||
'isEdit' => true,
|
||||
'record' => $record,
|
||||
'parkList' => $parkList,
|
||||
'ptypeList' => $ptypeList,
|
||||
'psectionList' => $psectionList,
|
||||
]);
|
||||
}
|
||||
|
||||
// ▼ POST時:バリデーション
|
||||
$rules = [
|
||||
'park_id' => 'required|integer',
|
||||
'ptype_id' => 'required|integer',
|
||||
'psection_id' => 'required|integer',
|
||||
'zone_name' => 'required|string|max:255',
|
||||
'zone_number' => 'nullable|integer|min:0',
|
||||
'zone_standard' => 'nullable|integer|min:0',
|
||||
'zone_tolerance' => 'nullable|integer|min:0',
|
||||
'zone_sort' => 'nullable|integer|min:0',
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'park_id.required' => '駐輪場は必須です。',
|
||||
'ptype_id.required' => '駐輪分類は必須です。',
|
||||
'psection_id.required' => '車種区分は必須です。',
|
||||
'zone_name.required' => 'ゾーン名は必須です。',
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return redirect()->back()->withErrors($validator)->withInput();
|
||||
}
|
||||
|
||||
// ▼ 更新処理
|
||||
DB::transaction(function () use ($request, $record) {
|
||||
$record->fill($request->only([
|
||||
'park_id',
|
||||
'ptype_id',
|
||||
'psection_id',
|
||||
'zone_name',
|
||||
'zone_number',
|
||||
'zone_standard',
|
||||
'zone_tolerance',
|
||||
'zone_sort',
|
||||
]));
|
||||
$record->save();
|
||||
});
|
||||
|
||||
return redirect()->route('zones')->with('success', '更新しました。');
|
||||
}
|
||||
|
||||
/**
|
||||
* 詳細表示
|
||||
*/
|
||||
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', 'ゾーンを削除しました');
|
||||
$ids = [];
|
||||
|
||||
// 単一削除(id 指定)
|
||||
if ($request->filled('id')) {
|
||||
$ids[] = (int) $request->input('id');
|
||||
}
|
||||
return redirect()->route('zones')->with('error', '削除対象が指定されていません');
|
||||
|
||||
// 複数削除(チェックボックス pk[])
|
||||
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', '削除対象が選択されていません。');
|
||||
}
|
||||
|
||||
// 削除実行
|
||||
Zone::whereIn('zone_id', $ids)->delete();
|
||||
|
||||
return redirect()->route('zones')->with('success', '削除しました。');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* バリデーション共通化
|
||||
*/
|
||||
|
||||
@ -29,6 +29,7 @@ class Zone extends Model
|
||||
*/
|
||||
protected $fillable = [
|
||||
'park_id',
|
||||
'park_name',
|
||||
'ptype_id',
|
||||
'psection_id',
|
||||
'zone_name',
|
||||
@ -41,4 +42,19 @@ class Zone extends Model
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
public function park()
|
||||
{
|
||||
return $this->belongsTo(Park::class, 'park_id', 'park_id');
|
||||
}
|
||||
|
||||
public function ptype()
|
||||
{
|
||||
return $this->belongsTo(Ptype::class, 'ptype_id', 'ptype_id');
|
||||
}
|
||||
public function psection()
|
||||
{
|
||||
return $this->belongsTo(Psection::class, 'psection_id', 'psection_id');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -20,7 +20,8 @@ use Illuminate\Support\Facades\Hash;
|
||||
class Utils
|
||||
{
|
||||
// ページあたりのアイテム数(旧システムから継承)
|
||||
const item_per_page = 50;
|
||||
// const item_per_page = 50;
|
||||
const item_per_page = 20;
|
||||
|
||||
// 画像保存パス(旧システムから継承)
|
||||
const image_path = 'storage/images/';
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
<div class="form-group col-3">
|
||||
<label>市区ID</label>
|
||||
<select name="city_id" class="form-control">
|
||||
<option value="">--</option>
|
||||
<option value="">市区ID</option>
|
||||
@foreach($cityList as $id => $name)
|
||||
<option value="{{ $id }}" @if(($inputs['city_id'] ?? '') == $id) selected @endif>{{ $name }}</option>
|
||||
@endforeach
|
||||
@ -66,6 +66,7 @@
|
||||
</div>
|
||||
<div class="form-group col-3">
|
||||
<label>許容市区名</label>
|
||||
|
||||
<input type="text" name="contract_allowable_city_name" class="form-control"
|
||||
value="{{ $inputs['contract_allowable_city_name'] ?? '' }}">
|
||||
</div>
|
||||
|
||||
@ -1,34 +1,41 @@
|
||||
{{-- アラート --}}
|
||||
@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'))
|
||||
@endif
|
||||
|
||||
@if($errors->any())
|
||||
<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 !!}
|
||||
<h4><i class="icon fa fa-ban"></i> {{ __('入力内容に不備があります:') }}</h4>
|
||||
<ul>
|
||||
@foreach($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{-- 駐輪車室ID --}}
|
||||
{{-- 駐輪車室ID(編集時のみ表示) --}}
|
||||
@if($isEdit)
|
||||
<div class="form-group col-3">
|
||||
<label>{{ __('駐輪車室ID') }}</label>
|
||||
</div>
|
||||
<div class="form-group col-9">
|
||||
<div class="input-group">
|
||||
<input type="text" value="{{ $pplace_id ?? '' }}" placeholder="{{ __('駐輪車室ID') }}"
|
||||
name="pplace_id" class="form-control form-control-lg" readonly />
|
||||
<input type="text"
|
||||
value="{{ $record->pplace_id ?? '' }}"
|
||||
placeholder="{{ __('駐輪車室ID') }}"
|
||||
name="pplace_id"
|
||||
class="form-control form-control-lg"
|
||||
readonly />
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- 番号 --}}
|
||||
<div class="form-group col-3">
|
||||
@ -36,8 +43,11 @@
|
||||
</div>
|
||||
<div class="form-group col-9">
|
||||
<div class="input-group">
|
||||
<input type="text" value="{{ $pplace_number ?? '' }}" placeholder="{{ __('駐輪車室番号') }}"
|
||||
name="pplace_number" class="form-control form-control-lg">
|
||||
<input type="text"
|
||||
name="pplace_number"
|
||||
value="{{ old('pplace_number', $record->pplace_number ?? '') }}"
|
||||
placeholder="{{ __('駐輪車室番号') }}"
|
||||
class="form-control form-control-lg">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -47,38 +57,40 @@
|
||||
</div>
|
||||
<div class="form-group col-9">
|
||||
<div class="input-group">
|
||||
<input type="text" value="{{ $pplace_remarks ?? '' }}" placeholder="{{ __('備考') }}"
|
||||
name="pplace_remarks" class="form-control form-control-lg" @if(!empty($isEdit))@endif />
|
||||
<input type="text"
|
||||
name="pplace_remarks"
|
||||
value="{{ old('pplace_remarks', $record->pplace_remarks ?? '') }}"
|
||||
placeholder="{{ __('備考') }}"
|
||||
class="form-control form-control-lg">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- {{-- オペレーター --}}
|
||||
<div class="form-group col-3">
|
||||
<label>{{ __('更新オペレータID') }}</label>
|
||||
</div>
|
||||
<div class="form-group col-9">
|
||||
<select name="operator_id" class="form-control form-control-lg" @if(!empty($isEdit)) disabled @endif>
|
||||
<option value="">{{ __('選択してください') }}</option>
|
||||
@foreach($operators ?? [] as $id => $name)
|
||||
<option value="{{ $id }}" @if(($operator_id ?? '') == $id) selected @endif>{{ $name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="text-center"> -->
|
||||
{{-- ▼ 下部ボタン --}}
|
||||
<div class="row mt-4">
|
||||
<div class="form-group col-md-10 d-flex align-items-center gap-2 justify-content-start">
|
||||
|
||||
{{-- 登録ボタン --}}
|
||||
<button type="submit" class="btn btn-lg btn-success mr-2">{{ __('登録') }}</button>
|
||||
|
||||
{{-- 削除ボタン(編集画面のみ表示) --}}
|
||||
@if(!empty($pplace_id))
|
||||
</form>
|
||||
<form method="POST" action="{{ route('pplace_delete') }}"
|
||||
onsubmit="return confirm('本当に削除しますか?')" class="d-inline-block mr-2">
|
||||
@csrf
|
||||
<input type="hidden" name="pk" value="{{ $pplace_id }}">
|
||||
<button type="submit" class="btn btn-lg btn-danger mr-2">{{ __('削除') }}</button>
|
||||
</form>
|
||||
@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
|
||||
<!-- </div> -->
|
||||
|
||||
{{-- 削除ボタン(編集時のみ表示) --}}
|
||||
@if($isEdit)
|
||||
<button type="button" id="delete_edit" class="btn btn-lg btn-danger">
|
||||
{{ __('削除') }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', '[東京都|〇〇駐輪場] 駐輪車室マスタ')
|
||||
@section('title', '新規')
|
||||
|
||||
@section('content')
|
||||
<!-- Content Header (Page header) -->
|
||||
@ -7,13 +7,13 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-lg-6">
|
||||
<h1 class="m-0 text-dark">新規登録</h1>
|
||||
<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="{{ route('pplaces') }}">駐輪車室マスタ</a></li>
|
||||
<li class="breadcrumb-item active">新規登録</li>
|
||||
<li class="breadcrumb-item active">新規</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@ -27,9 +27,9 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<form method="post" action="{{ route('pplace_add') }}" enctype="multipart/form-data">
|
||||
<form id="form_add" action="{{ route('pplaces_add') }}" method="POST">
|
||||
@csrf
|
||||
@include('admin.pplace._form', ['isEdit' => 0, 'isInfo' => 0])
|
||||
@include('admin.pplace._form', ['isEdit' => false, 'record' => $record])
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', '[東京都|〇〇駐輪場] 駐輪車室マスタ')
|
||||
@section('title', '編集')
|
||||
|
||||
@section('content')
|
||||
<!-- Content Header (Page header) -->
|
||||
@ -27,10 +27,21 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<form method="post" action="{{ route('pplace_edit', ['id' => $pplace_id]) }}" enctype="multipart/form-data">
|
||||
<form id="form_edit"
|
||||
action="{{ route('pplaces_edit', ['id' => $record->pplace_id]) }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@include('admin.pplace._form', ['isEdit' => true])
|
||||
</form>
|
||||
|
||||
{{-- Delete Form --}}
|
||||
<form id="form_delete"
|
||||
action="{{ route('pplaces_delete') }}"
|
||||
method="POST"
|
||||
style="display:none;">
|
||||
@csrf
|
||||
<input type="hidden" name="id" value="{{ $record->pplace_id }}">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,46 +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>
|
||||
<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="javascript:void(0);">[東京都|〇〇駐輪場]</a></li>
|
||||
<li class="breadcrumb-item">駐輪車室マスタ</li>
|
||||
<li class="breadcrumb-item active">詳細</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<form method="post" action="{{ route('pplace_info', ['id' => $pplace_id]) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('admin.pplace._form', ['isEdit' => 0, 'isInfo' => 1])
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid mb20">
|
||||
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('削除') }}</button>
|
||||
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('インポート') }}</button>
|
||||
<button type="submit" class="btn btn-sm btn-default mr10">{{ __('CSV出力') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@ -1,5 +1,5 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', '[東京都|〇〇駐輪場] 駐輪車室マスタ')
|
||||
@section('title', '駐輪車室マスタ')
|
||||
@section('content')
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
@ -26,14 +26,11 @@
|
||||
<input type="hidden" value="{{$sort_type}}" name="sort_type" id="sort_type">
|
||||
</form>
|
||||
|
||||
<div class="container-fluid mb20">
|
||||
<button type="button" class="btn btn-sm btn-default mr10" onclick="location.href='{{ route('pplace_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" name="import_csv" id="import_csv" action="{{route('pplace_import')}}">{{__('インポート')}}</button> -->
|
||||
<button type="submit" class="btn btn-sm btn-default mr10" name="export_csv" id="export_csv" action="{{route('pplace_export')}}">{{__('CSV出力')}}</button>
|
||||
{{-- ▼ アクションボタン --}}
|
||||
<div class="mb-3">
|
||||
<a href="{{ route('pplaces_add') }}" class="btn btn-sm btn-default mr10">新規</a>
|
||||
<button type="button" class="btn btn-sm btn-default mr10" id="delete">削除</button>
|
||||
<button type="submit" class="btn btn-sm btn-default mr10" name="export_csv" id="export_csv" action="{{route('pplaces_export')}}">{{__('CSV出力')}}</button>
|
||||
</div>
|
||||
|
||||
{{-- ▼ ページネーション --}}
|
||||
@ -55,19 +52,19 @@
|
||||
@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>
|
||||
<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>
|
||||
<h4><i class="icon fa fa-ban"></i> {{__('入力内容に不備があります')}}:</h4>
|
||||
{!! $errorMsg !!}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<form action="{{route('pplace_delete')}}" method="post" id="form_delete">
|
||||
<form action="{{route('pplaces_delete')}}" method="post" id="form_delete">
|
||||
@csrf
|
||||
<!-- ▼ ここから単一テーブル構成 ----------------------------------------- -->
|
||||
<div class="col-lg-12 mb20">
|
||||
@ -96,7 +93,7 @@
|
||||
<td class="align-middle" style="background-color:#faebd7; border-left:1px solid #dcdcdc;">
|
||||
<div class="d-flex align-items-center">
|
||||
<input type="checkbox" class="m-0 checkbox" name="pk[]" value="{{ $item->pplace_id }}">
|
||||
<a href="{{ route('pplace_edit', ['id' => $item->pplace_id]) }}"
|
||||
<a href="{{ route('pplaces_edit', ['id' => $item->pplace_id]) }}"
|
||||
class="btn btn-sm btn-default ml10">編集</a>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
</td>
|
||||
|
||||
{{-- ▼ データ列 --}}
|
||||
<td style="text-align:right;">{{ $item->psection_id }}</td>
|
||||
<td style="text-align:left;">{{ $item->psection_id }}</td>
|
||||
<td>{{ $item->psection_subject }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
<th style="width:140px;" class="text-left">
|
||||
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
|
||||
</th>
|
||||
<th>駐輪分類ID</th>
|
||||
<th class="sorting {{ ($sort=='ptype_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="ptype_id"><span>駐輪分類ID</span></th>
|
||||
<th>駐輪分類名</th>
|
||||
<th>階数ソート順</th>
|
||||
<th>備考</th>
|
||||
@ -92,7 +92,7 @@
|
||||
<td>{{ $item->ptype_subject }}</td>
|
||||
<td>
|
||||
@if(!is_null($item->floor_sort))
|
||||
{{ $item->floor_sort }} 階
|
||||
{{ $item->floor_sort }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $item->ptype_remarks }}</td>
|
||||
|
||||
@ -1,93 +1,182 @@
|
||||
@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
|
||||
{{-- アラート --}}
|
||||
@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>
|
||||
</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-success">登録</button>
|
||||
<a href="{{ route('zones') }}" class="btn btn-secondary">削除</a>
|
||||
@else
|
||||
{{-- 新規画面 --}}
|
||||
<button type="submit" class="btn btn-success">登録</button>
|
||||
|
||||
@endif
|
||||
|
||||
@if($errors->any())
|
||||
<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>
|
||||
<ul>
|
||||
@foreach($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
{{-- ▼ ゾーンID(編集時のみ表示) --}}
|
||||
@if($isEdit && isset($record->zone_id))
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">ゾーンID</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text"
|
||||
name="zone_id"
|
||||
class="form-control form-control-lg"
|
||||
value="{{ $record->zone_id }}"
|
||||
readonly>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
{{-- ▼ 駐輪場 --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label required">駐輪場</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="park_id" class="form-control form-control-lg" required>
|
||||
<option value="" disabled {{ old('park_id', $record->park_id ?? '') == '' ? 'selected' : '' }}>
|
||||
駐輪場
|
||||
</option>
|
||||
@foreach($parkList as $id => $name)
|
||||
<option value="{{ $id }}" {{ old('park_id', $record->park_id ?? '') == $id ? 'selected' : '' }}>
|
||||
{{ $name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- ▼ 駐輪分類 --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label required">駐輪分類</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="ptype_id" class="form-control form-control-lg" required>
|
||||
<option value="" disabled {{ old('ptype_id', $record->ptype_id ?? '') == '' ? 'selected' : '' }}>
|
||||
駐輪分類
|
||||
</option>
|
||||
@foreach($ptypeList as $id => $name)
|
||||
<option value="{{ $id }}" {{ old('ptype_id', $record->ptype_id ?? '') == $id ? 'selected' : '' }}>
|
||||
{{ $name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{-- ▼ 車種区分 --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label required">
|
||||
車種区分
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="psection_id" class="form-control form-control-lg" required>
|
||||
<option value="" disabled {{ old('psection_id', $record->psection_id ?? '') == '' ? 'selected' : '' }}>
|
||||
車種区分
|
||||
</option>
|
||||
@foreach($psectionList as $id => $name)
|
||||
<option value="{{ $id }}" {{ old('psection_id', $record->psection_id ?? '') == $id ? 'selected' : '' }}>
|
||||
{{ $name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</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="zone_name"
|
||||
class="form-control form-control-lg"
|
||||
value="{{ old('zone_name', $record->zone_name ?? '') }}"
|
||||
placeholder="ゾーン名"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{-- ▼ ゾーン内現在契約台数 --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">ゾーン内現在契約台数</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number"
|
||||
name="zone_number"
|
||||
class="form-control form-control-lg"
|
||||
value="{{ old('zone_number', $record->zone_number ?? '') }}"
|
||||
placeholder="ゾーン内現在契約台数">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- ▼ ゾーン内標準台数 --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">ゾーン内標準台数</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number"
|
||||
name="zone_standard"
|
||||
class="form-control form-control-lg"
|
||||
value="{{ old('zone_standard', $record->zone_standard ?? '') }}"
|
||||
placeholder="ゾーン内標準台数">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- ▼ ゾーン内許容台数 --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">ゾーン内許容台数</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number"
|
||||
name="zone_tolerance"
|
||||
class="form-control form-control-lg"
|
||||
value="{{ old('zone_tolerance', $record->zone_tolerance ?? '') }}"
|
||||
placeholder="ゾーン内許容台数">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- ▼ ゾーン順 --}}
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">ゾーン順</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number"
|
||||
name="zone_sort"
|
||||
class="form-control form-control-lg"
|
||||
value="{{ old('zone_sort', $record->zone_sort ?? '') }}"
|
||||
placeholder="ゾーン順">
|
||||
</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>
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', '[東京都|〇〇駐輪場] ゾーンマスタ新規登録')
|
||||
@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>
|
||||
<h1 class="m-0 text-dark">新規</h1>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<ol class="breadcrumb float-sm-right text-sm">
|
||||
@ -24,8 +24,9 @@
|
||||
<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 id="form_add" action="{{ route('zones_add') }}" method="POST">
|
||||
@csrf
|
||||
@include('admin.zones._form', ['isEdit' => false, 'record' => $record])
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', '[東京都|〇〇駐輪場] ゾーンマスタ編集')
|
||||
@section('title', '編集')
|
||||
|
||||
@section('content')
|
||||
<div class="content-header">
|
||||
@ -24,9 +24,20 @@
|
||||
<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 id="form_edit"
|
||||
action="{{ route('zones_edit', ['id' => $record->zone_id]) }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@include('admin.zones._form', ['isEdit' => true])
|
||||
</form>
|
||||
|
||||
{{-- Delete Form --}}
|
||||
<form id="form_delete"
|
||||
action="{{ route('zones_delete') }}"
|
||||
method="POST"
|
||||
style="display:none;">
|
||||
@csrf
|
||||
<input type="hidden" name="id" value="{{ $record->zone_id }}">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
@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') }}">ホーム</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
|
||||
@ -1,6 +1,6 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', '[東京都|〇〇駐輪場] ゾーンマスタ')
|
||||
@section('title', 'ゾーンマスタ')
|
||||
|
||||
@section('content')
|
||||
<div class="content-header">
|
||||
@ -20,6 +20,27 @@
|
||||
</div>
|
||||
|
||||
<section class="content">
|
||||
|
||||
{{-- ▼ フラッシュメッセージ --}}
|
||||
@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
|
||||
|
||||
<!-- ▼ 絞り込みフィルター -->
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
@ -38,7 +59,7 @@
|
||||
<th style="form-group col-2">駐輪場ID</th>
|
||||
<td>
|
||||
<select name="park_id" class="form-control form-control-sm" style="width: 300px;">
|
||||
<option value="">全て</option>
|
||||
<option value="">駐輪場ID</option>
|
||||
@foreach($parkList as $id => $label)
|
||||
<option value="{{ $id }}" {{ old('park_id', $park_id ?? '') == $id ? 'selected' : '' }}>
|
||||
{{ $label }}
|
||||
@ -49,7 +70,7 @@
|
||||
<th style="form-group col-2">駐輪分類ID</th>
|
||||
<td>
|
||||
<select name="ptype_id" class="form-control form-control-sm" style="width: 300px;">
|
||||
<option value="">全て</option>
|
||||
<option value="">駐輪分類ID</option>
|
||||
@foreach($ptypeList as $id => $label)
|
||||
<option value="{{ $id }}" {{ old('ptype_id', $ptype_id ?? '') == $id ? 'selected' : '' }}>
|
||||
{{ $label }}
|
||||
@ -62,7 +83,7 @@
|
||||
<th style="form-group col-2">車種区分ID</th>
|
||||
<td>
|
||||
<select name="psection_id" class="form-control form-control-sm" style="width: 300px;">
|
||||
<option value="">全て</option>
|
||||
<option value="">車種区分ID</option>
|
||||
@foreach($psectionList as $id => $label)
|
||||
<option value="{{ $id }}" {{ old('psection_id', $psection_id ?? '') == $id ? 'selected' : '' }}>
|
||||
{{ $label }}
|
||||
@ -74,7 +95,6 @@
|
||||
</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>
|
||||
@ -86,23 +106,29 @@
|
||||
<!-- ▲ 絞り込みフィルター -->
|
||||
|
||||
<!-- ▼ ツールバー -->
|
||||
<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>
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
{{-- ▼ アクションボタン --}}
|
||||
<div class="mb-3">
|
||||
<a href="{{ route('zones_add') }}" class="btn btn-sm btn-default">新規</a>
|
||||
<button type="button" class="btn btn-sm btn-default mr10" id="delete">削除</button>
|
||||
</div>
|
||||
|
||||
{{-- ▼ ページネーション --}}
|
||||
<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') }}">
|
||||
<form id="form_delete" method="POST" action="{{ route('zones_delete') }}">
|
||||
@csrf
|
||||
<table class="table table-bordered dataTable text-nowrap">
|
||||
<thead>
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<!-- 全選択チェックボックス -->
|
||||
<th style="width:140px;" class="text-left">
|
||||
@ -167,14 +193,14 @@
|
||||
</td>
|
||||
|
||||
<td>{{ $item->zone_id }}</td>
|
||||
<td>{{ $item->park_id }}</td>
|
||||
<td>{{ $item->ptype_id }}</td>
|
||||
<td>{{ $item->park->park_name ?? '' }}</td>
|
||||
<td>{{ $item->ptype->ptype_subject ?? '' }}</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>
|
||||
<td>{{ $item->psection->psection_subject ?? '' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
@ -146,12 +146,12 @@ Route::middleware('auth')->group(function () {
|
||||
|
||||
// [東京都|〇〇駐輪場] 駐輪車室マスタ
|
||||
Route::match(['get', 'post'], '/pplace', [PplaceController::class, 'list'])->name('pplaces');
|
||||
Route::match(['get', 'post'], '/pplace/add', [PplaceController::class, 'add'])->name('pplace_add');
|
||||
Route::match(['get', 'post'], '/pplace/edit/{id}', [PplaceController::class, 'edit'])->name('pplace_edit')->where(['id' => '[0-9]+']);
|
||||
Route::match(['get', 'post'], '/pplace/info/{id}', [PplaceController::class, 'info'])->name('pplace_info')->where(['id' => '[0-9]+']);
|
||||
Route::match(['get', 'post'], '/pplace/delete', [PplaceController::class, 'delete'])->name('pplace_delete');
|
||||
Route::match(['get', 'post'], '/pplace/import', [PplaceController::class, 'import'])->name('pplace_import');
|
||||
Route::get('/pplace/export', [PplaceController::class, 'export'])->name('pplace_export');
|
||||
Route::match(['get', 'post'], '/pplace/add', [PplaceController::class, 'add'])->name('pplaces_add');
|
||||
Route::match(['get', 'post'], '/pplace/edit/{id}', [PplaceController::class, 'edit'])->name('pplaces_edit')->where(['id' => '[0-9]+']);
|
||||
Route::match(['get', 'post'], '/pplace/info/{id}', [PplaceController::class, 'info'])->name('pplaces_info')->where(['id' => '[0-9]+']);
|
||||
Route::match(['get', 'post'], '/pplace/delete', [PplaceController::class, 'delete'])->name('pplaces_delete');
|
||||
Route::match(['get', 'post'], '/pplace/import', [PplaceController::class, 'import'])->name('pplaces_import');
|
||||
Route::get('/pplace/export', [PplaceController::class, 'export'])->name('pplaces_export');
|
||||
// sou end
|
||||
|
||||
// ou start
|
||||
|
||||
Loading…
Reference in New Issue
Block a user