This commit is contained in:
parent
b74d8fd4a8
commit
ed7d4482b8
@ -32,16 +32,26 @@ class PriceListController extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
if ($parkId) {
|
if ($parkId) {
|
||||||
// parkとprice_aをJOIN
|
// price_a に必要なマスタを JOIN
|
||||||
$aRows = \DB::table('price_a')
|
$aRows = \DB::table('price_a')
|
||||||
->join('park', 'park.park_id', '=', 'price_a.park_id')
|
->join('park', 'park.park_id', '=', 'price_a.park_id')
|
||||||
|
->leftJoin('ptype', 'price_a.ptype_id', '=', 'ptype.ptype_id')
|
||||||
|
->leftJoin('usertype', 'price_a.user_categoryid', '=', 'usertype.user_categoryid')
|
||||||
|
->leftJoin('pplace', 'price_a.pplace_id', '=', 'pplace.pplace_id')
|
||||||
->where('price_a.park_id', $parkId)
|
->where('price_a.park_id', $parkId)
|
||||||
->select('price_a.*') // 必要ならpark.*も
|
->select([
|
||||||
|
'price_a.*',
|
||||||
|
'ptype.ptype_subject',
|
||||||
|
'usertype.usertype_subject1',
|
||||||
|
'usertype.usertype_subject2',
|
||||||
|
'usertype.usertype_subject3',
|
||||||
|
'pplace.pplace_number'
|
||||||
|
])
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$aGrouped = $this->groupPriceRows($aRows);
|
$aGrouped = $this->groupPriceRows($aRows);
|
||||||
|
|
||||||
$masterList[0]['groups'] = $aGrouped;
|
$masterList[0]['groups'] = $aGrouped;
|
||||||
|
|
||||||
// マスターBも同様に取得・整形する場合はここに追加
|
// マスターBも同様に取得・整形する場合はここに追加
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,85 +70,103 @@ class PriceListController extends Controller
|
|||||||
$result = [];
|
$result = [];
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
// グループキーは分類ID+ユーザ分類ID+駐輪場ID
|
// グループキーは分類ID+ユーザ分類ID+駐輪場ID
|
||||||
$key = $row->price_ptypeid . '-' . $row->user_categoryid . '-' . $row->park_id;
|
$key = $row->ptype_id . '-' . $row->user_categoryid . '-' . $row->park_id;
|
||||||
|
|
||||||
if (!isset($result[$key])) {
|
if (!isset($result[$key])) {
|
||||||
$result[$key] = [
|
$result[$key] = [
|
||||||
'id' => $row->price_parkplaceid,
|
'id' => $row->price_parkplaceid,
|
||||||
'classification' => $row->price_ptypeid,
|
'classification' => $row->ptype_subject ?? '',
|
||||||
'room_number' => '', // 必要ならpplace_id等をセット
|
'room_number' => $row->pplace_number ?? '',
|
||||||
'category1' => $row->prine_name ?? '',
|
'category1' => $row->usertype_subject1 ?? '',
|
||||||
'category2' => '',
|
'category2' => $row->usertype_subject2 ?? '',
|
||||||
'category3' => '',
|
'category3' => $row->usertype_subject3 ?? '',
|
||||||
'bike_1m' => '',
|
'bike_1m' => '', 'bike_2m' => '', 'bike_3m' => '', 'bike_6m' => '', 'bike_12m' => '',
|
||||||
'bike_2m' => '',
|
'moped_1m' => '', 'moped_2m' => '', 'moped_3m' => '', 'moped_6m' => '', 'moped_12m' => '',
|
||||||
'bike_3m' => '',
|
'motorcycle_1m' => '', 'motorcycle_2m' => '', 'motorcycle_3m' => '', 'motorcycle_6m' => '', 'motorcycle_12m' => '',
|
||||||
'bike_6m' => '',
|
'car_1m' => '', 'car_2m' => '', 'car_3m' => '', 'car_6m' => '', 'car_12m' => '',
|
||||||
'bike_12m' => '',
|
|
||||||
// 必要なら原付・自動二輪も同様に追加
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 月数ごとに金額をセット
|
$month = $row->price_month;
|
||||||
if ($row->price_month == 1) {
|
$price = $row->price;
|
||||||
$result[$key]['bike_1m'] = $row->price;
|
switch ($row->psection_id) {
|
||||||
} elseif ($row->price_month == 2) {
|
case 1:
|
||||||
$result[$key]['bike_2m'] = $row->price;
|
$result[$key]["bike_{$month}m"] = $price;
|
||||||
} elseif ($row->price_month == 3) {
|
break;
|
||||||
$result[$key]['bike_3m'] = $row->price;
|
case 2:
|
||||||
} elseif ($row->price_month == 6) {
|
$result[$key]["moped_{$month}m"] = $price;
|
||||||
$result[$key]['bike_6m'] = $row->price;
|
break;
|
||||||
} elseif ($row->price_month == 12) {
|
case 3:
|
||||||
$result[$key]['bike_12m'] = $row->price;
|
$result[$key]["motorcycle_{$month}m"] = $price;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$result[$key]["car_{$month}m"] = $price;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return array_values($result);
|
return array_values($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request $request)
|
public function update(Request $request)
|
||||||
{
|
{
|
||||||
foreach ($request->input('rows', []) as $row) {
|
foreach ($request->input('rows', []) as $row) {
|
||||||
$id = $row['id'] ?? null;
|
$id = $row['id'] ?? null;
|
||||||
if (!$id) continue;
|
if (!$id) continue;
|
||||||
|
|
||||||
// 更新対象の月リスト
|
$vehicleTypes = [
|
||||||
$months = [
|
'bike' => 1,
|
||||||
'bike_1m' => 1,
|
'moped' => 2,
|
||||||
'bike_2m' => 2,
|
'motorcycle' => 3,
|
||||||
'bike_3m' => 3,
|
'car' => 4,
|
||||||
'bike_6m' => 6,
|
];
|
||||||
'bike_12m' => 12,
|
|
||||||
];
|
|
||||||
|
|
||||||
foreach ($months as $field => $month) {
|
$months = [1, 2, 3, 6, 12];
|
||||||
|
|
||||||
|
foreach ($vehicleTypes as $prefix => $psectionId) {
|
||||||
|
foreach ($months as $month) {
|
||||||
|
$field = "{$prefix}_{$month}m";
|
||||||
if (isset($row[$field])) {
|
if (isset($row[$field])) {
|
||||||
// price_aから該当レコードを取得
|
$value = $row[$field];
|
||||||
$item = \App\Models\PriceA::where('price_parkplaceid', $id)
|
|
||||||
|
// バリデーション:空欄はスキップ
|
||||||
|
if (!ctype_digit((string)$value)) {
|
||||||
|
return back()->withErrors([
|
||||||
|
"{$field}" => "金額は整数で入力してください。"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// バリデーション:最大値を超えないこと
|
||||||
|
if ((int)$value > 9999999999) {
|
||||||
|
return back()->withErrors([
|
||||||
|
"{$field}" => "金額は最大 9,999,999,999 までです。"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = PriceA::where('price_parkplaceid', $id)
|
||||||
->where('price_month', $month)
|
->where('price_month', $month)
|
||||||
|
->where('psection_id', $psectionId)
|
||||||
->first();
|
->first();
|
||||||
if ($item) {
|
if ($item) {
|
||||||
$item->price = $row[$field];
|
$item->price = $value;
|
||||||
$item->save();
|
$item->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 原付・自動二輪も同様に必要なら追加
|
|
||||||
}
|
}
|
||||||
return back()->with('success', '金額を更新しました');
|
|
||||||
}
|
}
|
||||||
|
return back()->with('success', '金額を更新しました');
|
||||||
|
}
|
||||||
|
|
||||||
public function insert(Request $request)
|
public function insert(Request $request)
|
||||||
{
|
{
|
||||||
// 例:bike_2m(2ヶ月)だけ新規追加する場合
|
|
||||||
if ($request->filled('bike_2m')) {
|
if ($request->filled('bike_2m')) {
|
||||||
$row = new \App\Models\PriceA();
|
$row = new PriceA();
|
||||||
$row->park_id = $request->input('park_id'); // 必要に応じて
|
$row->park_id = $request->input('park_id');
|
||||||
$row->price = $request->input('bike_2m');
|
$row->price = $request->input('bike_2m');
|
||||||
$row->price_month = 2;
|
$row->price_month = 2;
|
||||||
// 他の必要なカラムもセット
|
$row->psection_id = 1; // 自転車
|
||||||
$row->save();
|
$row->save();
|
||||||
}
|
}
|
||||||
// 他の月も同様に必要なら追加
|
|
||||||
return back()->with('success', '金額を追加しました');
|
return back()->with('success', '金額を追加しました');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,129 +1,177 @@
|
|||||||
@extends('layouts.app')
|
@extends('layouts.app')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
{{-- ログインボタン --}}
|
{{-- ログインボタン --}}
|
||||||
<div style="position:absolute; right:32px; top:24px; z-index:2;">
|
<div style="position:absolute; right:32px; top:24px; z-index:2;">
|
||||||
<a href="{{ route('login') }}" class="btn btn-outline-primary btn-sm">ログイン</a>
|
<a href="{{ route('login') }}" class="btn btn-outline-primary btn-sm">ログイン</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="mb-4">料金一覧表</h3>
|
<h3 class="mb-4">料金一覧表</h3>
|
||||||
|
|
||||||
{{-- 上部ツールバー:左=駐輪場セレクト、右(同列)=登録 --}}
|
{{-- 上部ツールバー:左=駐輪場セレクト、右(同列)=登録 --}}
|
||||||
<div class="d-flex align-items-center mb-3">
|
<div class="d-flex align-items-center mb-3">
|
||||||
{{-- 駐輪場選択(GET) --}}
|
{{-- 駐輪場選択(GET) --}}
|
||||||
<form method="GET" action="{{ route('pricelist') }}" class="form-inline mb-0">
|
<form method="GET" action="{{ route('pricelist') }}" class="form-inline mb-0">
|
||||||
<label for="park_id" class="mr-2">駐輪場</label>
|
<label for="park_id" class="mr-2">駐輪場</label>
|
||||||
<select name="park_id" id="park_id" class="form-control mr-2 select-park" style="min-width:220px;"
|
<select name="park_id" id="park_id" class="form-control mr-2 select-park" style="min-width:220px;"
|
||||||
onchange="this.form.submit()">
|
onchange="this.form.submit()">
|
||||||
<option value="" @if(empty($parkId)) selected @endif></option>
|
<option value="" @if(empty($parkId)) selected @endif></option>
|
||||||
@foreach($parkList as $park)
|
@foreach($parkList as $park)
|
||||||
<option value="{{ $park->park_id }}" @if((string)$parkId === (string)$park->park_id) selected @endif>
|
<option value="{{ $park->park_id }}" @if((string) $parkId === (string) $park->park_id) selected @endif>
|
||||||
{{ $park->park_name }}
|
{{ $park->park_name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{{-- 登録(POST フォームを指定して送信) --}}
|
{{-- 登録(POST フォームを指定して送信) --}}
|
||||||
<button type="submit"
|
<button type="submit" class="btn btn-default btn-sm ml-3 register" form="bulkUpdateForm">登録</button>
|
||||||
class="btn btn-primary btn-sm ml-3"
|
</div>
|
||||||
form="bulkUpdateForm">登録</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- 一括更新フォーム(POST) --}}
|
@if ($errors->any())
|
||||||
<form id="bulkUpdateForm"
|
<div class="alert alert-danger">
|
||||||
method="POST"
|
<ul class="mb-0">
|
||||||
action="{{ route('pricelist_update') }}"
|
@foreach ($errors->all() as $error)
|
||||||
onsubmit="return confirm('登録してよろしいですか?');">
|
<li>{{ $error }}</li>
|
||||||
@csrf
|
@endforeach
|
||||||
{{-- 必要なら park_id を一緒に送る --}}
|
</ul>
|
||||||
<input type="hidden" name="park_id" value="{{ $parkId }}">
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if(isset($masterList) && count($masterList))
|
{{-- 一括更新フォーム(POST) --}}
|
||||||
@foreach($masterList as $master)
|
<form id="bulkUpdateForm" method="POST" action="{{ route('pricelist_update') }}" onsubmit="return;">
|
||||||
<div class="mb-4">
|
@csrf
|
||||||
<div style="font-weight:bold;font-size:1.1em;">
|
{{-- 必要なら park_id を一緒に送る --}}
|
||||||
{{ $master['name'] }}
|
<input type="hidden" name="park_id" value="{{ $parkId }}">
|
||||||
<button type="button" class="btn btn-warning btn-sm ml-2" disabled>{{ $master['status'] }}</button>
|
|
||||||
|
@if(isset($masterList) && count($masterList))
|
||||||
|
@foreach($masterList as $master)
|
||||||
|
<div class="mb-4">
|
||||||
|
<div class="text-center fw-bold" style="font-size:1.1em;">
|
||||||
|
{{ $master['name'] }}
|
||||||
|
<button type="button" class="btn btn-warning btn-sm ml-2" disabled>{{ $master['status'] }}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table-responsive" style="overflow-x:auto; min-width:1300px;">
|
||||||
|
<table class="table table-bordered table-sm bg-white mt-2" style="min-width:1300px;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">駐輪分類</th>
|
||||||
|
<th rowspan="2">駐輪車室番号</th>
|
||||||
|
<th rowspan="2">分類1</th>
|
||||||
|
<th rowspan="2">分類2</th>
|
||||||
|
<th rowspan="2">分類3</th>
|
||||||
|
<th colspan="5">自転車</th>
|
||||||
|
<th colspan="5">原付</th>
|
||||||
|
<th colspan="5">自動二輪</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>1ヶ月</th>
|
||||||
|
<th>2ヶ月</th>
|
||||||
|
<th>3ヶ月</th>
|
||||||
|
<th>6ヶ月</th>
|
||||||
|
<th>12ヶ月</th>
|
||||||
|
<th>1ヶ月</th>
|
||||||
|
<th>2ヶ月</th>
|
||||||
|
<th>3ヶ月</th>
|
||||||
|
<th>6ヶ月</th>
|
||||||
|
<th>12ヶ月</th>
|
||||||
|
<th>1ヶ月</th>
|
||||||
|
<th>2ヶ月</th>
|
||||||
|
<th>3ヶ月</th>
|
||||||
|
<th>6ヶ月</th>
|
||||||
|
<th>12ヶ月</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@forelse($master['groups'] as $group)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $group['classification'] ?? '' }}</td>
|
||||||
|
<td>{{ $group['room_number'] ?? '' }}</td>
|
||||||
|
<td>{{ $group['category1'] ?? '' }}</td>
|
||||||
|
<td>{{ $group['category2'] ?? '' }}</td>
|
||||||
|
<td>{{ $group['category3'] ?? '' }}</td>
|
||||||
|
<input type="hidden" name="rows[{{ $group['id'] }}][id]" value="{{ $group['id'] }}">
|
||||||
|
|
||||||
|
{{-- 自転車 --}}
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][bike_1m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['bike_1m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][bike_2m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['bike_2m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][bike_3m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['bike_3m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][bike_6m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['bike_6m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][bike_12m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['bike_12m'] ?? '' }}"></td>
|
||||||
|
|
||||||
|
{{-- 原付 --}}
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][moped_1m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['moped_1m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][moped_2m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['moped_2m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][moped_3m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['moped_3m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][moped_6m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['moped_6m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][moped_12m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['moped_12m'] ?? '' }}"></td>
|
||||||
|
|
||||||
|
{{-- 自動二輪 --}}
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_1m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['motorcycle_1m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_2m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['motorcycle_2m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_3m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['motorcycle_3m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_6m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['motorcycle_6m'] ?? '' }}"></td>
|
||||||
|
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_12m]"
|
||||||
|
class="form-control form-control-sm price-input" value="{{ $group['motorcycle_12m'] ?? '' }}"></td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td colspan="21" class="text-center">データがありません。</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
<div class="mb-4">
|
||||||
<div class="table-responsive" style="overflow-x:auto; min-width:1300px;">
|
<div class="table-responsive" style="overflow-x:auto; min-width:1300px;">
|
||||||
<table class="table table-bordered table-sm bg-white mt-2" style="min-width:1300px;">
|
<table class="table table-bordered table-sm bg-white mt-2" style="min-width:1300px;">
|
||||||
<thead>
|
<thead> …(省略:空表のヘッダは従来どおり)… </thead>
|
||||||
<tr>
|
|
||||||
<th rowspan="2">駐輪分類</th>
|
|
||||||
<th rowspan="2">駐輪車室番号</th>
|
|
||||||
<th rowspan="2">分類1</th>
|
|
||||||
<th rowspan="2">分類2</th>
|
|
||||||
<th rowspan="2">分類3</th>
|
|
||||||
<th colspan="5">自転車</th>
|
|
||||||
<th colspan="5">原付</th>
|
|
||||||
<th colspan="5">自動二輪</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>1ヶ月</th><th>2ヶ月</th><th>3ヶ月</th><th>6ヶ月</th><th>12ヶ月</th>
|
|
||||||
<th>1ヶ月</th><th>2ヶ月</th><th>3ヶ月</th><th>6ヶ月</th><th>12ヶ月</th>
|
|
||||||
<th>1ヶ月</th><th>2ヶ月</th><th>3ヶ月</th><th>6ヶ月</th><th>12ヶ月</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
@forelse($master['groups'] as $group)
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $group['classification'] ?? '' }}</td>
|
<td colspan="21" class="text-center">データがありません。</td>
|
||||||
<td>{{ $group['room_number'] ?? '' }}</td>
|
|
||||||
<td>{{ $group['category1'] ?? '' }}</td>
|
|
||||||
<td>{{ $group['category2'] ?? '' }}</td>
|
|
||||||
<td>{{ $group['category3'] ?? '' }}</td>
|
|
||||||
|
|
||||||
<input type="hidden" name="rows[{{ $group['id'] }}][id]" value="{{ $group['id'] }}">
|
|
||||||
|
|
||||||
{{-- 自転車 --}}
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][bike_1m]" class="form-control form-control-sm price-input" value="{{ $group['bike_1m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][bike_2m]" class="form-control form-control-sm price-input" value="{{ $group['bike_2m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][bike_3m]" class="form-control form-control-sm price-input" value="{{ $group['bike_3m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][bike_6m]" class="form-control form-control-sm price-input" value="{{ $group['bike_6m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][bike_12m]" class="form-control form-control-sm price-input" value="{{ $group['bike_12m'] ?? '' }}"></td>
|
|
||||||
|
|
||||||
{{-- 原付 --}}
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][moped_1m]" class="form-control form-control-sm price-input" value="{{ $group['moped_1m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][moped_2m]" class="form-control form-control-sm price-input" value="{{ $group['moped_2m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][moped_3m]" class="form-control form-control-sm price-input" value="{{ $group['moped_3m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][moped_6m]" class="form-control form-control-sm price-input" value="{{ $group['moped_6m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][moped_12m]" class="form-control form-control-sm price-input" value="{{ $group['moped_12m'] ?? '' }}"></td>
|
|
||||||
|
|
||||||
{{-- 自動二輪 --}}
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_1m]" class="form-control form-control-sm price-input" value="{{ $group['motorcycle_1m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_2m]" class="form-control form-control-sm price-input" value="{{ $group['motorcycle_2m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_3m]" class="form-control form-control-sm price-input" value="{{ $group['motorcycle_3m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_6m]" class="form-control form-control-sm price-input" value="{{ $group['motorcycle_6m'] ?? '' }}"></td>
|
|
||||||
<td><input type="text" name="rows[{{ $group['id'] }}][motorcycle_12m]" class="form-control form-control-sm price-input" value="{{ $group['motorcycle_12m'] ?? '' }}"></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
@empty
|
|
||||||
<tr><td colspan="21" class="text-center">データがありません。</td></tr>
|
|
||||||
@endforelse
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endif
|
||||||
@else
|
</form>
|
||||||
<div class="mb-4">
|
</div>
|
||||||
<div class="table-responsive" style="overflow-x:auto; min-width:1300px;">
|
|
||||||
<table class="table table-bordered table-sm bg-white mt-2" style="min-width:1300px;">
|
|
||||||
<thead> …(省略:空表のヘッダは従来どおり)… </thead>
|
|
||||||
<tbody>
|
|
||||||
<tr><td colspan="21" class="text-center">データがありません。</td></tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.price-input:read-only{ background:#fff700!important; color:#222!important; border:1px solid #ccc; }
|
.price-input:read-only {
|
||||||
th{ white-space:nowrap!important; word-break:keep-all!important; font-size:13px; text-align:center; vertical-align:middle; min-width:50px; }
|
background: #fff700 !important;
|
||||||
</style>
|
color: #222 !important;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
white-space: nowrap !important;
|
||||||
|
word-break: keep-all !important;
|
||||||
|
font-size: 13px;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
min-width: 50px;
|
||||||
|
background: #efefef !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@endsection
|
@endsection
|
||||||
Loading…
Reference in New Issue
Block a user