Compare commits
5 Commits
ebaca49f30
...
53b6c8ea73
| Author | SHA1 | Date | |
|---|---|---|---|
| 53b6c8ea73 | |||
| fd0bdfff51 | |||
| c784f64e1e | |||
| 179a5ca27c | |||
| 1c555a0a18 |
@ -76,6 +76,57 @@ class RegularContractController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function showHistory(Request $request)
|
||||
{
|
||||
$user_id = session('user_id');
|
||||
if (!$user_id) {
|
||||
return redirect('/login');
|
||||
}
|
||||
$user_name = DB::table('user')->where('user_id', $user_id)->value('user_name');
|
||||
|
||||
// 定期契約情報を取得(ページネーション付き)
|
||||
$contracts_query = DB::table('regular_contract')
|
||||
->join('park', 'regular_contract.park_id', '=', 'park.park_id')
|
||||
->join('usertype', 'regular_contract.user_categoryid', '=', 'usertype.user_categoryid')
|
||||
->leftJoin('city', 'park.city_id', '=', 'city.city_id')
|
||||
->where('regular_contract.user_id', $user_id)
|
||||
->whereNotNull('regular_contract.contract_periods')
|
||||
->select(
|
||||
'regular_contract.contract_id',
|
||||
'park.park_name',
|
||||
'usertype.usertype_subject1',
|
||||
'regular_contract.contract_periods',
|
||||
'regular_contract.contract_periode',
|
||||
'regular_contract.enable_months',
|
||||
'regular_contract.park_id',
|
||||
'city.update_grace_period_start_date',
|
||||
)
|
||||
->orderBy('regular_contract.contract_id', 'desc');
|
||||
|
||||
// ページネーション(4件ずつ)
|
||||
$contracts = $contracts_query->paginate(4);
|
||||
|
||||
// grace日付加工
|
||||
$contracts->getCollection()->transform(function ($contract) {
|
||||
$periode = $contract->contract_periode;
|
||||
$grace_day = $contract->update_grace_period_start_date;
|
||||
$ym = date('Y/m', strtotime($periode));
|
||||
$day = str_pad($grace_day, 2, '0', STR_PAD_LEFT);
|
||||
$contract->periode_with_grace = $ym . '/' . $day;
|
||||
return $contract;
|
||||
});
|
||||
|
||||
\Log::info('契約履歴表示画面にアクセス', [
|
||||
'user_id' => $user_id,
|
||||
]);
|
||||
|
||||
return view('regular_contract.history', [
|
||||
'active_menu' => 'SWC-6-1', // マイページメニューの選択状態用
|
||||
'user_name' => $user_name, // ユーザー名(ヘッダー用)
|
||||
'contracts' => $contracts,
|
||||
]);
|
||||
}
|
||||
|
||||
public function update($contract_id)
|
||||
{
|
||||
$user_id = session('user_id');
|
||||
|
||||
@ -17,7 +17,17 @@
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/mypage/tablesorter-blue.css') }}" type="text/css" media="print, projection, screen">
|
||||
<link href="{{ asset('assets/css/mypage/style.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('assets/css/mypage/jquery-confirm.min.css') }}" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
@yield('head')
|
||||
<style>
|
||||
#main-news.jumbotron {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
footer.jumbotron {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -31,14 +41,15 @@
|
||||
</main>
|
||||
{{-- フッターメニュー --}}
|
||||
@include('partials.mypagefootermenu')
|
||||
{{-- ニュース・フッターiframe --}}
|
||||
<iframe src="{{ asset('news.html') }}" width="100%" height="450" scrolling="no" style="border:none; display:block; margin:0; padding:0;"></iframe>
|
||||
<iframe src="{{ asset('footer.html') }}" width="100%" height="200" style="border:none; display:block; margin:0; padding:0;"></iframe>
|
||||
{{-- ニュース --}}
|
||||
@include('partials.news')
|
||||
{{-- フッター --}}
|
||||
@include('partials.footer')
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
window.jQuery || document.write('<script src="{{ asset('
|
||||
assets / js / vendor / jquery.min.js ') }}"><\/script>')
|
||||
var jqueryPath = "{{ asset('assets/js/vendor/jquery.min.js') }}";
|
||||
window.jQuery || document.write('<script src="' + jqueryPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="{{ asset('assets/js/vendor/popper.min.js') }}"></script>
|
||||
<script src="{{ asset('bootstrap/js/bootstrap.min.js') }}"></script>
|
||||
|
||||
@ -19,7 +19,7 @@ if (!isset($active_menu)) $active_menu = '';
|
||||
<li class="nav-item {{ $active_menu == 'SWC-1-1' ? 'active' : '' }}"><a class="nav-link" href="{{ url('/user/info') }}">ユーザー情報確認</a></li>
|
||||
<li class="nav-item {{ $active_menu == 'SWC-3-1' ? 'active' : '' }}"><a class="nav-link" href="{{ url('/regular_contract/info') }}">定期契約情報</a></li>
|
||||
<li class="nav-item {{ $active_menu == 'SWC-4-1' ? 'active' : '' }}"><a class="nav-link" href="{{ url('/regular_contract/update') }}">契約更新</a></li>
|
||||
<li class="nav-item {{ $active_menu == 'SWC-6-1' ? 'active' : '' }}"><a class="nav-link" href="{{ url('SWC-6-1.html') }}">契約履歴</a></li>
|
||||
<li class="nav-item {{ $active_menu == 'SWC-6-1' ? 'active' : '' }}"><a class="nav-link" href="{{ url('/regular_contract/history') }}">契約履歴</a></li>
|
||||
<li class="nav-item {{ $active_menu == 'SWC-8-1' ? 'active' : '' }}"><a class="nav-link" href="{{ url('/regular_contract/create') }}">新規定期契約</a></li>
|
||||
<li class="nav-item {{ $active_menu == 'SWC-11-1' ? 'active' : '' }}"><a class="nav-link" href="{{ url('/park_waitlist') }}">空き待ち状況確認</a></li>
|
||||
<li class="nav-item {{ $active_menu == 'SWC-10-1' ? 'active' : '' }}"><a class="nav-link" href="{{ url('SWC-10-1.html') }}">駐輪場検索</a></li>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<div class="col-6 col-md-2 mb20">
|
||||
<div class="card text-center border-success">
|
||||
<a href="{{ url('SWC-6-1.html') }}" target="_top">
|
||||
<a href="{{ url('regular_contract/history') }}" target="_top">
|
||||
<figure><img src="{{ asset('assets/img/menu-rireki.png') }}" alt="" class="w-75 mt10"></figure>
|
||||
<p class="text-success">定期契約履歴を<br>見る</p>
|
||||
</a>
|
||||
|
||||
92
resources/views/regular_contract/history.blade.php
Normal file
92
resources/views/regular_contract/history.blade.php
Normal file
@ -0,0 +1,92 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<main>
|
||||
<header class="alert alert-success">
|
||||
<h4 class="container">契約履歴 > 定期契約履歴を見る</h4>
|
||||
</header>
|
||||
<section class="container mt30 mb50">
|
||||
@if(count($contracts) > 0)
|
||||
@foreach($contracts as $i => $contract)
|
||||
@if($i % 2 == 0)
|
||||
<div class="row">
|
||||
@endif
|
||||
<article class="col-12 col-lg-6 mb20">
|
||||
<div class="card border-success">
|
||||
<table class="table text-center table-no-margin bg-white border-white">
|
||||
<tr>
|
||||
<th>定期契約ID</th>
|
||||
<td>{{ $contract->contract_id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>駐輪場名</th>
|
||||
<td>{{ $contract->park_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>利用者区分</th>
|
||||
<td>{{ $contract->usertype_subject1 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>開始日</th>
|
||||
<td>{{ \Carbon\Carbon::parse($contract->contract_periods)->format('Y/m/d') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>月数</th>
|
||||
<td>{{ $contract->enable_months }}ヶ月</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>更新時期</th>
|
||||
<td>{{ $contract->periode_with_grace }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="text-center">
|
||||
@php
|
||||
$has_receipt = DB::table('inv_publish')->where('contract_id', $contract->contract_id)->exists();
|
||||
@endphp
|
||||
@if($has_receipt)
|
||||
<a href="{{ url('receipt/download/' . $contract->contract_id) }}" class="btn btn-outline-secondary badge-pill custom-rounded-btn" style="background: transparent;">領収書再発行</a>
|
||||
@else
|
||||
<a href="{{ url('receipt/input/' . $contract->contract_id) }}" class="btn btn-outline-secondary badge-pill custom-rounded-btn" style="background: transparent;">領収書発行</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</article>
|
||||
@if($i % 2 == 1 || $i == count($contracts) - 1)
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
<div class="d-flex justify-content-center mt-4">
|
||||
{{ $contracts->links('partials.paging') }}
|
||||
</div>
|
||||
@else
|
||||
<div class="col-12 col-lg-12 mb20">
|
||||
<p>定期契約情報はありません。</p>
|
||||
</div>
|
||||
@endif
|
||||
<form class="row form">
|
||||
<div class="col-12 col-md-4 offset-0 offset-md-4 mt50 mb50">
|
||||
<a href="{{ url('mypage') }}" class="btn btn-lg btn-block btn-outline-success">マイページへ戻る</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
@endsection
|
||||
<style>
|
||||
.custom-rounded-btn {
|
||||
border-radius: 2rem !important;
|
||||
padding-left: 2rem !important;
|
||||
padding-right: 2rem !important;
|
||||
font-weight: 500;
|
||||
min-width: 140px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.table.text-center {
|
||||
border-radius: 0.25rem !important;
|
||||
border-collapse: separate !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
@ -135,6 +135,11 @@ Route::get('regular_contract/select_period/{contract_id}', [RegularContractContr
|
||||
->name('regular_contract.select_period');
|
||||
Route::post('regular_contract/update_period', [App\Http\Controllers\RegularContractController::class, 'updatePeriod'])
|
||||
->name('regular_contract.update_period');
|
||||
|
||||
// 定期契約履歴
|
||||
Route::get('regular_contract/history', [RegularContractController::class, 'showHistory'])
|
||||
->name('regular_contract.history');
|
||||
|
||||
// 空き待ち状況確認画面
|
||||
Route::get('park_waitlist', [ParkWaitlistController::class, 'index'])
|
||||
->name('park_waitlist.index');
|
||||
@ -147,5 +152,56 @@ Route::post('/login', function (Request $request) {
|
||||
|
||||
// ウェルネット決済画面(仮)
|
||||
Route::get('/wellnet/payment', function (): mixed {
|
||||
return '<h1>ウェルネット決済画面</h1>';
|
||||
$html = <<<HTML
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ウェルネット決済画面(仮)</title>
|
||||
<style>
|
||||
body { background:#f7f7f7; font-family:sans-serif; }
|
||||
.pay-container {
|
||||
max-width:500px; margin:40px auto; background:#fff; border-radius:10px;
|
||||
box-shadow:0 2px 8px rgba(0,0,0,0.08); padding:32px 24px;
|
||||
}
|
||||
.pay-title { font-size:1.2em; font-weight:bold; margin-bottom:12px; }
|
||||
.pay-section { margin-bottom:24px; }
|
||||
.pay-row { display:flex; align-items:center; margin-bottom:8px; }
|
||||
.pay-label { width:140px; font-weight:bold; }
|
||||
.pay-icons img { height:22px; margin-right:6px; vertical-align:middle; }
|
||||
.pay-bank-icons img { height:18px; margin-right:4px; vertical-align:middle; }
|
||||
.pay-box { background:#e6f7e6; border:1px solid #7ed957; border-radius:6px; padding:8px 12px; margin-bottom:8px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="pay-container">
|
||||
<div class="pay-section">
|
||||
<div class="pay-title">クレジットでのお支払い</div>
|
||||
<div class="pay-box">
|
||||
<span class="pay-label">クレジット</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pay-section">
|
||||
<div class="pay-title">コンビニでのお支払い</div>
|
||||
<div class="pay-box"><span class="pay-label">ローソン</span><span class="pay-icons"></span></div>
|
||||
<div class="pay-box"><span class="pay-label">ファミリーマート</span><span class="pay-icons"></span></div>
|
||||
<div class="pay-box"><span class="pay-label">サークルKサンクス</span><span class="pay-icons"></span></div>
|
||||
<div class="pay-box"><span class="pay-label">ミニストップ</span><span class="pay-icons"></span></div>
|
||||
<div class="pay-box"><span class="pay-label">セイコーマート</span><span class="pay-icons"></span></div>
|
||||
<div class="pay-box"><span class="pay-label">デイリーヤマザキ</span><span class="pay-icons"></span></div>
|
||||
</div>
|
||||
<div class="pay-section">
|
||||
<div class="pay-title">銀行でのお支払い</div>
|
||||
<div class="pay-box">
|
||||
<span class="pay-label">ATM</span>
|
||||
</div>
|
||||
<div class="pay-box">
|
||||
<span class="pay-label">ネットバンキング</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
return $html;
|
||||
})->name('wellnet.payment');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user