This commit is contained in:
parent
ed7d4482b8
commit
00a15f6a35
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin;
|
|||||||
use App\Http\Requests\PriceRequest;
|
use App\Http\Requests\PriceRequest;
|
||||||
use App\Models\Park;
|
use App\Models\Park;
|
||||||
use App\Models\Price;
|
use App\Models\Price;
|
||||||
|
use App\Models\Pplace;
|
||||||
use App\Models\Psection;
|
use App\Models\Psection;
|
||||||
use App\Models\Ptype;
|
use App\Models\Ptype;
|
||||||
use App\Models\Usertype;
|
use App\Models\Usertype;
|
||||||
@ -41,117 +42,92 @@ class PriceController extends Controller
|
|||||||
|
|
||||||
public function add(Request $request)
|
public function add(Request $request)
|
||||||
{
|
{
|
||||||
// POST の場合のみバリデーション + 保存
|
if ($request->isMethod('get')) {
|
||||||
if ($request->isMethod('POST')) {
|
return view('admin.prices.add', array_merge(
|
||||||
|
$this->getDataDropList(),
|
||||||
// ★ 1. 全角数字を半角に変換(例:123 → 123)
|
[
|
||||||
$request->merge([
|
'record' => new Price(),
|
||||||
'pplace_id' => mb_convert_kana($request->input('pplace_id'), 'n'),
|
'isEdit' => false,
|
||||||
]);
|
]
|
||||||
|
));
|
||||||
// バリデーション
|
|
||||||
$validated = $request->validate([
|
|
||||||
'price_parkplaceid' => 'required|integer', // 駐車場所ID
|
|
||||||
'park_id' => 'required|integer', // 駐輪場ID
|
|
||||||
'prine_name' => 'required|string|max:255', // 商品名
|
|
||||||
'price_month' => 'nullable|integer', // 期間(月)
|
|
||||||
'user_categoryid' => 'required|integer', // 利用者分類ID
|
|
||||||
'price' => 'required|numeric|min:0', // 駐輪料金(税込)
|
|
||||||
'psection_id' => 'required|integer', // 車種区分ID
|
|
||||||
'price_ptypeid' => 'required|integer', // 駐輪分類ID
|
|
||||||
'pplace_id' => 'required|integer', // 駐車車室ID
|
|
||||||
], [
|
|
||||||
'pplace_id.integer' => '駐車車室ID は整数で入力してください。',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// DB 登録
|
|
||||||
$type = false;
|
|
||||||
\DB::transaction(function () use ($validated, &$type) {
|
|
||||||
$new = new Price();
|
|
||||||
$new->fill($validated);
|
|
||||||
if ($new->save()) {
|
|
||||||
$type = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 結果
|
|
||||||
if ($type) {
|
|
||||||
return redirect()->route('prices')
|
|
||||||
->with('success', __('新しい成功を創造する。'));
|
|
||||||
} else {
|
|
||||||
return redirect()->route('prices')
|
|
||||||
->with('error', __('新しい作成に失敗しました。'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET の場合 → 画面表示
|
$request->merge([
|
||||||
$dataList = $this->getDataDropList();
|
'pplace_id' => mb_convert_kana($request->input('pplace_id'), 'n'),
|
||||||
return view('admin.prices.add', $dataList);
|
]);
|
||||||
|
|
||||||
|
$validated = $this->validateRequest($request);
|
||||||
|
|
||||||
|
$created = false;
|
||||||
|
\DB::transaction(function () use ($validated, &$created) {
|
||||||
|
$price = new Price();
|
||||||
|
$price->fill($validated);
|
||||||
|
$created = $price->save();
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect()->route('prices')
|
||||||
|
->with($created ? 'success' : 'error', $created ? '登録しました。' : '登録に失敗しました。');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function edit(Request $request, $pk ,$view='')
|
public function edit(Request $request, $id)
|
||||||
{
|
{
|
||||||
$price = Price::getByPk($pk);
|
$price = Price::getByPk($id);
|
||||||
if (empty($pk) || empty($price)) {
|
if (!$price) {
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
$data = $price->getAttributes();
|
|
||||||
$dataList = $this->getDataDropList();
|
|
||||||
$data = array_merge($data, $dataList);
|
|
||||||
|
|
||||||
if ($request->isMethod('POST')) {
|
if ($request->isMethod('get')) {
|
||||||
$type = false;
|
return view('admin.prices.edit', array_merge(
|
||||||
$requestAll = [
|
$this->getDataDropList(),
|
||||||
'price_parkplaceid' => $request->input('price_parkplaceid'),
|
[
|
||||||
'park_id' => $request->input('park_id'),
|
'record' => $price,
|
||||||
'prine_name' => $request->input('prine_name'),
|
'isEdit' => true,
|
||||||
'price_month' => $request->input('price_month',''),
|
]
|
||||||
'user_categoryid' => $request->input('user_categoryid'),
|
));
|
||||||
'price' => $request->input('price'),
|
|
||||||
'psection_id' => $request->input('psection_id'),
|
|
||||||
'price_ptypeid' => $request->input('price_ptypeid'),
|
|
||||||
'pplace_id' => $request->input('pplace_id'),
|
|
||||||
];
|
|
||||||
$data = array_merge($data, $requestAll);
|
|
||||||
|
|
||||||
\DB::transaction(function () use ($data, &$type, $price) {
|
|
||||||
$price->fill($data);
|
|
||||||
$price->save();
|
|
||||||
$type = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
if ($type) {
|
|
||||||
return redirect()->route('prices')->with('success', __('更新に成功しました。'));
|
|
||||||
} else {
|
|
||||||
return redirect()->route('prices')->with('error', __('更新に失敗しました。'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($view != '') {
|
$request->merge([
|
||||||
return view($view, $data);
|
'pplace_id' => mb_convert_kana($request->input('pplace_id'), 'n'),
|
||||||
}
|
]);
|
||||||
|
|
||||||
return view('admin.prices.edit', $data);
|
$validated = $this->validateRequest($request, $id);
|
||||||
|
|
||||||
|
$updated = false;
|
||||||
|
\DB::transaction(function () use ($validated, &$updated, $price) {
|
||||||
|
$price->fill($validated);
|
||||||
|
$updated = $price->save();
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect()->route('prices')
|
||||||
|
->with($updated ? 'success' : 'error', $updated ? '更新しました。' : '更新に失敗しました。');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function delete(Request $request)
|
|
||||||
|
public function delete(Request $request, $id = null)
|
||||||
{
|
{
|
||||||
$arr_pk = $request->get('pk');
|
// 一覧画面(checkbox で複数削除)
|
||||||
|
$ids = $request->input('pk');
|
||||||
|
|
||||||
if ($arr_pk) {
|
// 編集画面(単体削除)
|
||||||
$ids = is_array($arr_pk) ? $arr_pk : [$arr_pk];
|
if ($id) {
|
||||||
|
$ids = [$id];
|
||||||
if (Price::deleteByPk($ids)) {
|
|
||||||
return redirect()->route('prices')->with('success', __("削除成功しました。"));
|
|
||||||
} else {
|
|
||||||
return redirect()->route('prices')->with('error', __('削除に失敗しました。'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('prices')->with('error', __('削除するユーザーを選択してください。'));
|
// 削除対象が空
|
||||||
|
if (empty($ids)) {
|
||||||
|
return redirect()->route('prices')->with('error', '削除対象が選択されていません。');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 削除処理
|
||||||
|
Price::destroy($ids);
|
||||||
|
|
||||||
|
return redirect()->route('prices')->with('success', '削除しました。');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function deleteByPk($ids)
|
public static function deleteByPk($ids)
|
||||||
{
|
{
|
||||||
if (!is_array($ids)) {
|
if (!is_array($ids)) {
|
||||||
@ -324,8 +300,33 @@ class PriceController extends Controller
|
|||||||
$data['psections'] = Psection::getList() ;
|
$data['psections'] = Psection::getList() ;
|
||||||
$data['ptypes'] = Ptype::getList() ;
|
$data['ptypes'] = Ptype::getList() ;
|
||||||
$data['userTypes'] = Usertype::getList() ;
|
$data['userTypes'] = Usertype::getList() ;
|
||||||
|
$data['pplaces'] = Pplace::getList() ;
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Price バリデーション共通
|
||||||
|
*/
|
||||||
|
private function validateRequest(Request $request): array
|
||||||
|
{
|
||||||
|
return $request->validate([
|
||||||
|
'prine_name' => 'required|string|max:255',
|
||||||
|
'price_month' => 'required|int',
|
||||||
|
'park_id' => 'required|int',
|
||||||
|
'psection_id' => 'required|int',
|
||||||
|
'price_ptypeid' => 'required|int',
|
||||||
|
'user_categoryid' => 'required|int',
|
||||||
|
'pplace_id' => 'nullable|int',
|
||||||
|
'park_number' => 'nullable|int',
|
||||||
|
'park_standard' => 'nullable|int',
|
||||||
|
'park_limit' => 'nullable|int',
|
||||||
|
'price' => 'required|numeric',
|
||||||
|
'operator_id' => 'nullable|int',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -45,9 +45,13 @@ class Price extends Model
|
|||||||
$query = self::query()
|
$query = self::query()
|
||||||
->select(
|
->select(
|
||||||
'price_a.*',
|
'price_a.*',
|
||||||
\DB::raw("CONCAT_WS('/', usertype.usertype_subject1, usertype.usertype_subject2, usertype.usertype_subject3) as user_category_name")
|
\DB::raw("CONCAT_WS('/', usertype.usertype_subject1, usertype.usertype_subject2, usertype.usertype_subject3) as user_category_name"),
|
||||||
|
'psection.psection_subject',
|
||||||
|
'ptype.ptype_subject'
|
||||||
)
|
)
|
||||||
->leftJoin('usertype', 'price_a.user_categoryid', '=', 'usertype.user_categoryid');
|
->leftJoin('usertype', 'price_a.user_categoryid', '=', 'usertype.user_categoryid')
|
||||||
|
->leftJoin('psection', 'price_a.psection_id', '=', 'psection.psection_id')
|
||||||
|
->leftJoin('ptype', 'price_a.price_ptypeid', '=', 'ptype.ptype_id');
|
||||||
|
|
||||||
// ソート対象カラム
|
// ソート対象カラム
|
||||||
$allowedSortColumns = [
|
$allowedSortColumns = [
|
||||||
@ -111,4 +115,17 @@ class Price extends Model
|
|||||||
return $this->belongsTo(Usertype::class, 'user_categoryid', 'user_categoryid')->first();
|
return $this->belongsTo(Usertype::class, 'user_categoryid', 'user_categoryid')->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function psection()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Psection::class, 'psection_id'); // 外部キーが psection_id
|
||||||
|
|
||||||
|
}
|
||||||
|
public function ptype()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Ptype::class, 'price_ptypeid'); // 外部キーが price_ptypeid
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -419,6 +419,11 @@ return [
|
|||||||
'memo' => '備考',
|
'memo' => '備考',
|
||||||
'subject' => '件名',
|
'subject' => '件名',
|
||||||
'text' => '本文',
|
'text' => '本文',
|
||||||
|
//SWA-92
|
||||||
|
'edit_master' => 'マスタ編集',
|
||||||
|
'web_master' => 'ウェブ参照マスタ',
|
||||||
|
'auto_change_date' => 'ウェブ参照マスタ自動切り替え日時',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,24 +1,4 @@
|
|||||||
<!-- {{-- アラート --}}
|
{{-- ===== エラーメッセージ ===== --}}
|
||||||
@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 -->
|
|
||||||
|
|
||||||
{{-- アラート --}}
|
|
||||||
@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>
|
||||||
@ -29,7 +9,7 @@
|
|||||||
@if($errors->any())
|
@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>
|
||||||
<ul>
|
<ul>
|
||||||
@foreach($errors->all() as $error)
|
@foreach($errors->all() as $error)
|
||||||
<li>{{ $error }}</li>
|
<li>{{ $error }}</li>
|
||||||
|
|||||||
@ -12,16 +12,23 @@
|
|||||||
|
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
@if(session('success'))
|
@if(Session::has('success'))
|
||||||
<div class="alert alert-success">{{ session('success') }}</div>
|
<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>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($errors->any())
|
@if($errors->any())
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger alert-dismissible">
|
||||||
<ul>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
@foreach ($errors->all() as $e)<li>{{ $e }}</li>@endforeach
|
<h4><i class="icon fa fa-ban"></i> {{ __('入力内容に不備があります') }}:</h4>
|
||||||
</ul>
|
<ul>
|
||||||
</div>
|
@foreach($errors->all() as $error)
|
||||||
|
<li>{{ $error }}</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<form method="post" action="{{ route('inv_settings_save') }}" enctype="multipart/form-data">
|
<form method="post" action="{{ route('inv_settings_save') }}" enctype="multipart/form-data">
|
||||||
|
|||||||
@ -1,34 +1,27 @@
|
|||||||
@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="card-body">
|
<div class="card-body">
|
||||||
@if ($errors->any())
|
{{-- ===== エラーメッセージ ===== --}}
|
||||||
<div class="alert alert-danger">
|
@if(Session::has('success'))
|
||||||
<h4>入力内容に不備があります:</h4>
|
<div class="alert alert-success alert-dismissible" role="alert">
|
||||||
<ol>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
@foreach ($errors->all() as $error)
|
{{ Session::get('success') }}
|
||||||
<li>{{ $error }}</li>
|
</div>
|
||||||
@endforeach
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
@endif
|
@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="row">
|
<div class="row">
|
||||||
{{-- キューID(編集時のみ表示) --}}
|
{{-- キューID(編集時のみ表示) --}}
|
||||||
@if($isEdit)
|
@if($isEdit)
|
||||||
|
|||||||
@ -1,203 +1,213 @@
|
|||||||
|
{{-- アラート --}}
|
||||||
@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">
|
||||||
{{-- バリデーションエラー表示 --}}
|
<!-- {{-- バリデーションエラー表示 --}}
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<ul class="mb-0">
|
<ul class="mb-0">
|
||||||
@foreach ($errors->all() as $error)
|
@foreach ($errors->all() as $error)
|
||||||
<li>{{ $error }}</li>
|
<li>{{ $error }}</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif -->
|
||||||
|
|
||||||
|
{{-- ▼ 入力フィールド群 --}}
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
{{-- 駐車場所ID(※ 編集時のみ表示) --}}
|
||||||
|
@if($isEdit)
|
||||||
|
<div class="col-3 form-group">
|
||||||
|
<label>{{ __('駐車場所ID') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text"
|
||||||
|
name="price_parkplaceid"
|
||||||
|
value="{{ old('price_parkplaceid', $record->price_parkplaceid ?? '') }}"
|
||||||
|
class="form-control form-control-lg"
|
||||||
|
readonly
|
||||||
|
placeholder="{{ __('validation.attributes.price_parkplaceid') }}">
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="row">
|
{{-- 商品名 --}}
|
||||||
|
<div class="col-3 form-group">
|
||||||
<!-- 駐車場所ID -->
|
<label class="required">{{ __('商品名') }}</label>
|
||||||
<div class="col-3">
|
</div>
|
||||||
<label class="required">{{ __('駐車場所ID') }}</label>
|
<div class="col-9 form-group">
|
||||||
</div>
|
<div class="input-group">
|
||||||
<div class="form-group col-9">
|
<input type="text"
|
||||||
<div class="input-group">
|
name="prine_name"
|
||||||
<input type="text"
|
value="{{ old('prine_name', $record->prine_name ?? '') }}"
|
||||||
name="price_parkplaceid"
|
class="form-control form-control-lg"
|
||||||
value="{{ old('price_parkplaceid', $price_parkplaceid ?? '') }}"
|
placeholder="{{ __('validation.attributes.prine_name') }}">
|
||||||
class="form-control form-control-lg"
|
</div>
|
||||||
@if($isEdit) readonly @endif
|
|
||||||
placeholder="駐車場所ID" />
|
|
||||||
</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="prine_name"
|
|
||||||
value="{{ old('prine_name', $prine_name ?? '') }}"
|
|
||||||
class="form-control form-control-lg"
|
|
||||||
placeholder="商品名" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 期間 -->
|
|
||||||
<div class="form-group col-3">
|
|
||||||
<label class="required">{{ __('期間') }}</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-9">
|
|
||||||
<div class="input-group">
|
|
||||||
<select name="price_month" class="form-control form-control-lg">
|
|
||||||
<option value="">{{ __('期間') }}</option>
|
|
||||||
@foreach(\App\Models\Price::PRICE_MONTH as $key => $item)
|
|
||||||
<option value="{{ $key }}"
|
|
||||||
@if($key == old('price_month', $price_month ?? '')) selected @endif>
|
|
||||||
{{ $item }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 駐輪場ID -->
|
|
||||||
<div class="form-group col-3">
|
|
||||||
<label class="required">{{ __('駐輪場名') }}</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-9">
|
|
||||||
<div class="input-group">
|
|
||||||
<select name="park_id" class="form-control form-control-lg">
|
|
||||||
<option value="">{{ __('駐輪場名') }}</option>
|
|
||||||
@foreach($parks as $key => $item)
|
|
||||||
<option value="{{ $key }}"
|
|
||||||
@if($key == old('park_id', $park_id ?? '')) selected @endif>
|
|
||||||
{{ $item }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 車種区分名 -->
|
|
||||||
<div class="form-group col-3">
|
|
||||||
<label class="required">{{ __('車種区分名') }}</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-9">
|
|
||||||
<div class="input-group">
|
|
||||||
<select name="psection_id" class="form-control form-control-lg">
|
|
||||||
<option value="">{{ __('車種区分名') }}</option>
|
|
||||||
@foreach($psections as $key => $item)
|
|
||||||
<option value="{{ $key }}"
|
|
||||||
@if($key == old('psection_id', $psection_id ?? '')) selected @endif>
|
|
||||||
{{ $item }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 駐輪分類名 -->
|
|
||||||
<div class="form-group col-3">
|
|
||||||
<label class="required">{{ __('駐輪分類名') }}</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-9">
|
|
||||||
<div class="input-group">
|
|
||||||
<select name="price_ptypeid" class="form-control form-control-lg">
|
|
||||||
<option value="">{{ __('駐輪分類名') }}</option>
|
|
||||||
@foreach($ptypes as $key => $item)
|
|
||||||
<option value="{{ $key }}"
|
|
||||||
@if($key == old('price_ptypeid', $price_ptypeid ?? '')) selected @endif>
|
|
||||||
{{ $item }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 利用者分類 -->
|
|
||||||
<div class="form-group col-3">
|
|
||||||
<label class="required">{{ __('利用者分類') }}</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-9">
|
|
||||||
<div class="input-group">
|
|
||||||
<select name="user_categoryid" class="form-control form-control-lg">
|
|
||||||
<option value="">{{ __('利用者分類') }}</option>
|
|
||||||
@foreach($userTypes as $key => $item)
|
|
||||||
<option value="{{ $key }}"
|
|
||||||
@if($key == old('user_categoryid', $user_categoryid ?? '')) selected @endif>
|
|
||||||
{{ $item }}
|
|
||||||
</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 駐車車室ID -->
|
|
||||||
<div class="form-group col-3">
|
|
||||||
<label class="required">{{ __('駐車車室ID') }}</label>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-9">
|
|
||||||
<input type="text"
|
|
||||||
name="pplace_id"
|
|
||||||
value="{{ old('pplace_id', $pplace_id ?? '') }}"
|
|
||||||
class="form-control form-control-lg"
|
|
||||||
placeholder="駐車車室ID">
|
|
||||||
|
|
||||||
@error('pplace_id')
|
{{-- 期間 --}}
|
||||||
<div class="text-danger">{{ $message }}</div>
|
<div class="col-3 form-group">
|
||||||
@enderror
|
<label class="required">{{ __('期間') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<select name="price_month" class="form-control form-control-lg">
|
||||||
|
<option value="">{{ __('期間') }}</option>
|
||||||
|
@foreach(\App\Models\Price::PRICE_MONTH as $key => $item)
|
||||||
|
<option value="{{ $key }}" @if($key == old('price_month', $record->price_month ?? '')) selected @endif>
|
||||||
|
{{ $item }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- 駐輪場名 --}}
|
||||||
|
<div class="col-3 form-group">
|
||||||
|
<label class="required">{{ __('駐輪場名') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<select name="park_id" class="form-control form-control-lg">
|
||||||
|
<option value="">{{ __('駐輪場名') }}</option>
|
||||||
|
@foreach($parks as $key => $item)
|
||||||
|
<option value="{{ $key }}" @if($key == old('park_id', $record->park_id ?? '')) selected @endif>
|
||||||
|
{{ $item }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- 車種区分名 --}}
|
||||||
|
<div class="col-3 form-group">
|
||||||
|
<label class="required">{{ __('車種区分名') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<select name="psection_id" class="form-control form-control-lg">
|
||||||
|
<option value="">{{ __('車種区分名') }}</option>
|
||||||
|
@foreach($psections as $key => $item)
|
||||||
|
<option value="{{ $key }}" @if($key == old('psection_id', $record->psection_id ?? '')) selected @endif>
|
||||||
|
{{ $item }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- 駐輪分類名 --}}
|
||||||
|
<div class="col-3 form-group">
|
||||||
|
<label class="required">{{ __('駐輪分類名') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<select name="price_ptypeid" class="form-control form-control-lg">
|
||||||
|
<option value="">{{ __('駐輪分類名') }}</option>
|
||||||
|
@foreach($ptypes as $key => $item)
|
||||||
|
<option value="{{ $key }}" @if($key == old('price_ptypeid', $record->price_ptypeid ?? '')) selected @endif>
|
||||||
|
{{ $item }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- 利用者分類 --}}
|
||||||
|
<div class="col-3 form-group">
|
||||||
|
<label class="required">{{ __('利用者分類') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<select name="user_categoryid" class="form-control form-control-lg">
|
||||||
|
<option value="">{{ __('validation.attributes.user_categoryid') }}</option>
|
||||||
|
@foreach($userTypes as $key => $item)
|
||||||
|
<option value="{{ $key }}" @if($key == old('user_categoryid', $record->user_categoryid ?? '')) selected @endif>
|
||||||
|
{{ $item }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- 駐車車室ID --}}
|
||||||
|
<div class="col-3 form-group">
|
||||||
|
<label>{{ __('駐車車室ID') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<select name="pplace_id" class="form-control form-control-lg">
|
||||||
|
<option value="">{{ __('validation.attributes.pplace_id') }}</option>
|
||||||
|
@foreach($pplaces as $key => $item)
|
||||||
|
<option value="{{ $key }}" @if($key == old('pplace_id', $record->pplace_id ?? '')) selected @endif>
|
||||||
|
{{ $item }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- 駐輪料金(税込) --}}
|
||||||
|
<div class="col-3 form-group">
|
||||||
|
<label class="required">{{ __('駐輪料金(税込)') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9 form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="number"
|
||||||
|
step="0.01"
|
||||||
|
name="price"
|
||||||
|
value="{{ old('price', $record->price ?? '') }}"
|
||||||
|
class="form-control form-control-lg"
|
||||||
|
placeholder="{{ __('validation.attributes.price') }}">
|
||||||
|
</div>
|
||||||
</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="number"
|
|
||||||
name="price"
|
|
||||||
value="{{ old('price', $price ?? '') }}"
|
|
||||||
class="form-control form-control-lg"
|
|
||||||
placeholder="駐輪料金(税込)"
|
|
||||||
step="1" min="0" required>
|
|
||||||
</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>
|
|
||||||
|
|
||||||
{{-- 削除ボタン(編集画面のみ表示) --}}
|
</div> {{-- /.row --}}
|
||||||
@if(!empty($price_parkplaceid))
|
|
||||||
</form>
|
|
||||||
<form method="POST" action="{{ route('prices_delete') }}"
|
|
||||||
onsubmit="return confirm('本当に削除しますか?')" class="d-inline-block mr-2">
|
|
||||||
@csrf
|
|
||||||
<input type="hidden" name="pk" value="{{ $price_parkplaceid }}">
|
|
||||||
<button type="submit" class="btn btn-lg btn-danger mr-2">{{ __('削除') }}</button>
|
|
||||||
</form>
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
{{-- ▼ 下部ボタン --}}
|
||||||
<!-- /.card-body -->
|
<div class="row mt-4">
|
||||||
|
<div class="form-group col-md-10 d-flex align-items-center gap-2 justify-content-start">
|
||||||
|
|
||||||
|
{{-- 登録ボタン --}}
|
||||||
|
@if ($isEdit ?? false)
|
||||||
|
<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 ?? false)
|
||||||
|
<button type="button" id="delete_edit" class="btn btn-lg btn-danger">
|
||||||
|
{{ __('削除') }}
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div> {{-- /.card-body --}}
|
||||||
|
|||||||
@ -24,11 +24,25 @@
|
|||||||
<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('price_edit', ['id' => $price_parkplaceid]) }}" enctype="multipart/form-data">
|
{{-- 編集フォーム --}}
|
||||||
|
<form id="form_edit"
|
||||||
|
action="{{ route('price_edit', ['id' => $record->price_parkplaceid]) }}"
|
||||||
|
method="POST"
|
||||||
|
enctype="multipart/form-data">
|
||||||
@csrf
|
@csrf
|
||||||
|
@include('admin.prices._form', ['isEdit' => true, 'record' => $record])
|
||||||
@include('admin.prices._form', ['isEdit' => true])
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
{{-- 削除フォーム --}}
|
||||||
|
<form id="form_delete"
|
||||||
|
action="{{ route('prices_delete') }}"
|
||||||
|
method="POST"
|
||||||
|
style="display:none;">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="pk[]" value="{{ $record->price_parkplaceid }}">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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><!-- /.col -->
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<ol class="breadcrumb float-sm-right text-sm">
|
|
||||||
<li class="breadcrumb-item"><a href="./index2.html">ホーム</a></li>
|
|
||||||
<li class="breadcrumb-item"><a href="{{ route('prices') }}">駐輪場所、料金マスタ</a></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('price_info',['id'=>$price_parkplaceid])}}" enctype="multipart/form-data">
|
|
||||||
<!-- TOKEN FORM -->
|
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" >
|
|
||||||
<!-- / .TOKEN FORM -->
|
|
||||||
@include('admin.prices._form',['isEdit'=>0,'isInfo'=>1])
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<!-- /.content -->
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
@section('title', '[東京都|〇〇駐輪場] 駐輪場所、料金マスタ')
|
@section('title', '駐輪場所、料金マスタ')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
@ -39,17 +39,18 @@
|
|||||||
onclick="location.href='{{ route('price_add') }}'">新規</button>
|
onclick="location.href='{{ route('price_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>
|
|
||||||
|
|
||||||
{{-- CSV出力(全件 or ソート条件付き)--}}
|
{{-- CSV出力(全件 or ソート条件付き) --}}
|
||||||
<form id="form_export" method="POST" action="{{ route('prices_export') }}" class="d-inline">
|
<form id="form_export" method="POST" action="{{ route('prices_export') }}" class="d-inline">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="hidden" name="sort" value="{{ $sort ?? '' }}">
|
<input type="hidden" name="sort" value="{{ $sort ?? '' }}">
|
||||||
<input type="hidden" name="sort_type" value="{{ $sort_type ?? '' }}">
|
<input type="hidden" name="sort_type" value="{{ $sort_type ?? '' }}">
|
||||||
<button type="submit" class="btn btn-sm btn-default mr10">CSV出力</button>
|
<button type="button" class="btn btn-sm btn-default mr10" id="btn_export_csv">CSV出力</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{-- エクスポート(条件選択モーダル) --}}
|
{{-- エクスポート(条件選択モーダル) --}}
|
||||||
<button type="button" class="btn btn-sm btn-default mr10" data-toggle="modal" data-target="#exportModal">
|
<button type="button" class="btn btn-sm btn-default mr10" data-toggle="modal" data-target="#exportModal">
|
||||||
@ -134,13 +135,13 @@
|
|||||||
@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))
|
@elseif(isset($errorMsg))
|
||||||
<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>
|
||||||
{!! $errorMsg !!}
|
{!! $errorMsg !!}
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@ -182,7 +183,7 @@
|
|||||||
<th><span>利用者分類ID</span></th>
|
<th><span>利用者分類ID</span></th>
|
||||||
<th><span>駐輪料金(税込)</span></th>
|
<th><span>駐輪料金(税込)</span></th>
|
||||||
<th class="sorting {{ ($sort=='psection_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="psection_id"><span>車種区分ID</span></th>
|
<th class="sorting {{ ($sort=='psection_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="psection_id"><span>車種区分ID</span></th>
|
||||||
<th class="sorting {{ ($sort=='price_ptypeid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="price_ptypeid"><span>駐輪分類</span></th>
|
<th class="sorting {{ ($sort=='price_ptypeid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="price_ptypeid"><span>駐輪分類ID</span></th>
|
||||||
<th class="sorting {{ ($sort=='pplace_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="pplace_id"><span>駐車車室ID</span></th>
|
<th class="sorting {{ ($sort=='pplace_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="pplace_id"><span>駐車車室ID</span></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -207,8 +208,9 @@
|
|||||||
<td class="sm-item text-left align-middle">{{ $item->price_month }}ヶ月</td>
|
<td class="sm-item text-left align-middle">{{ $item->price_month }}ヶ月</td>
|
||||||
<td class="sm-item text-left align-middle">{{ $item->user_category_name }}</td>
|
<td class="sm-item text-left align-middle">{{ $item->user_category_name }}</td>
|
||||||
<td class="sm-item text-left align-middle">{{ $item->price }}</td>
|
<td class="sm-item text-left align-middle">{{ $item->price }}</td>
|
||||||
<td class="sm-item text-left align-middle">{{ $item->psection_id }}</td>
|
<td class="sm-item text-left align-middle">{{ $item->psection_subject?? '' }}</td>
|
||||||
<td class="sm-item text-left align-middle">{{ $item->price_ptypeid }}</td>
|
|
||||||
|
<td class="sm-item text-left align-middle">{{ $item->ptype_subject?? '' }}</td>
|
||||||
<td class="sm-item text-left align-middle">{{ $item->pplace_id }}</td>
|
<td class="sm-item text-left align-middle">{{ $item->pplace_id }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
@ -221,34 +223,67 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{-- ▼ 全選択/全解除(name="pk[]" を対象) --}}
|
|
||||||
<script>
|
|
||||||
document.getElementById('checkbox_all')?.addEventListener('change', function(e){
|
|
||||||
document.querySelectorAll('input[name="pk[]"]').forEach(function(el){
|
|
||||||
el.checked = e.target.checked;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
@section('scripts')
|
@section('scripts')
|
||||||
<script>
|
<!-- 载入 jQuery 和 jquery-confirm 工具包(从 CDN) -->
|
||||||
$(function(){
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
$('.sorting').click(function(){
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.4/jquery-confirm.min.css">
|
||||||
let sort = $(this).attr('sort');
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.4/jquery-confirm.min.js"></script>
|
||||||
let currentSort = $('input[name="sort"]').val();
|
|
||||||
let currentType = $('input[name="sort_type"]').val();
|
|
||||||
let newType = 'asc';
|
|
||||||
|
|
||||||
if (sort === currentSort) {
|
<!-- CSV 出力脚本 -->
|
||||||
newType = (currentType === 'asc') ? 'desc' : 'asc';
|
<script>
|
||||||
|
$(function() {
|
||||||
|
// ▼ CSV出力ボタン押下
|
||||||
|
$('#btn_export_csv').on('click', function () {
|
||||||
|
const _action = $(this).closest('form').attr('action') || '';
|
||||||
|
|
||||||
|
const park_id = $('#park_id').val() || '';
|
||||||
|
const user_category_id = $('#user_category_id').val() || '';
|
||||||
|
const price_parkplaceid = $('#price_parkplaceid').val() || '';
|
||||||
|
const prine_name = $('#prine_name').val() || '';
|
||||||
|
const ptype_id = $('#ptype_id').val() || '';
|
||||||
|
const psection_id = $('#psection_id').val() || '';
|
||||||
|
const pplace_id = $('#pplace_id').val() || '';
|
||||||
|
const sort = $('input[name="sort"]').val() || '';
|
||||||
|
const sort_type = $('input[name="sort_type"]').val() || '';
|
||||||
|
|
||||||
|
$.confirm({
|
||||||
|
title: '確認ダイアログ',
|
||||||
|
content: 'CSVファイルを出力します。よろしいですか?',
|
||||||
|
buttons: {
|
||||||
|
ok: {
|
||||||
|
text: 'はい',
|
||||||
|
btnClass: 'btn-primary',
|
||||||
|
keys: ['enter'],
|
||||||
|
action: function() {
|
||||||
|
const url =
|
||||||
|
`${_action}?` +
|
||||||
|
`park_id=${encodeURIComponent(park_id)}` +
|
||||||
|
`&user_category_id=${encodeURIComponent(user_category_id)}` +
|
||||||
|
`&price_parkplaceid=${encodeURIComponent(price_parkplaceid)}` +
|
||||||
|
`&prine_name=${encodeURIComponent(prine_name)}` +
|
||||||
|
`&ptype_id=${encodeURIComponent(ptype_id)}` +
|
||||||
|
`&psection_id=${encodeURIComponent(psection_id)}` +
|
||||||
|
`&pplace_id=${encodeURIComponent(pplace_id)}` +
|
||||||
|
`&sort=${encodeURIComponent(sort)}` +
|
||||||
|
`&sort_type=${encodeURIComponent(sort_type)}` +
|
||||||
|
`&isExport=1`;
|
||||||
|
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancel: {
|
||||||
|
text: 'いいえ'
|
||||||
}
|
}
|
||||||
$('input[name="sort"]').val(sort);
|
}
|
||||||
$('input[name="sort_type"]').val(newType);
|
|
||||||
$('#list-form').submit();
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,4 @@
|
|||||||
<!-- {{-- フラッシュメッセージ --}}
|
{{-- アラート --}}
|
||||||
@if(session('success'))
|
|
||||||
<div class="alert alert-success alert-dismissible">
|
|
||||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
|
||||||
{{ session('success') }}
|
|
||||||
</div>
|
|
||||||
@elseif(session('error'))
|
|
||||||
<div class="alert alert-danger alert-dismissible">
|
|
||||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
|
||||||
{!! session('error') !!}
|
|
||||||
</div>
|
|
||||||
@endif -->
|
|
||||||
|
|
||||||
|
|
||||||
{{-- アラート --}}
|
|
||||||
@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>
|
||||||
@ -47,7 +33,7 @@
|
|||||||
|
|
||||||
{{-- 編集マスタ --}}
|
{{-- 編集マスタ --}}
|
||||||
<div class="form-group col-3">
|
<div class="form-group col-3">
|
||||||
<label>編集マスタ</label>
|
<label class="required">編集マスタ</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-9 d-flex align-items-center">
|
<div class="form-group col-9 d-flex align-items-center">
|
||||||
@php
|
@php
|
||||||
@ -77,7 +63,7 @@
|
|||||||
|
|
||||||
{{-- ウェブ参照マスタ --}}
|
{{-- ウェブ参照マスタ --}}
|
||||||
<div class="form-group col-3">
|
<div class="form-group col-3">
|
||||||
<label>ウェブ参照マスタ</label>
|
<label class="required">ウェブ参照マスタ</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-9 d-flex align-items-center">
|
<div class="form-group col-9 d-flex align-items-center">
|
||||||
@php
|
@php
|
||||||
@ -104,12 +90,12 @@
|
|||||||
|
|
||||||
{{-- ウェブ参照マスタ自動切り替え日時 --}}
|
{{-- ウェブ参照マスタ自動切り替え日時 --}}
|
||||||
<div class="form-group col-3">
|
<div class="form-group col-3">
|
||||||
<label>ウェブ参照マスタ自動切り替え日時</label>
|
<label class="required">ウェブ参照マスタ自動切り替え日時</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-9">
|
<div class="form-group col-9">
|
||||||
<input type="datetime-local" name="auto_change_date"
|
<input type="datetime-local" name="auto_change_date"
|
||||||
value="{{ old('auto_change_date', optional($setting->auto_change_date ?? null)->format('Y-m-d\TH:i')) }}"
|
value="{{ old('auto_change_date', optional($setting->auto_change_date ?? null)->format('Y-m-d\TH:i')) }}"
|
||||||
class="form-control form-control-lg">
|
class="form-control form-control-lg" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- 自動切換えウェブ参照マスタ --}}
|
{{-- 自動切換えウェブ参照マスタ --}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user