main_watanabe #40

Merged
y.watanabe merged 4 commits from main_watanabe into main 2025-10-03 17:47:11 +09:00
6 changed files with 53 additions and 50 deletions

View File

@ -11,9 +11,9 @@ class InquiryConfirmController extends Controller
{
// 初期表示内容
public $form_data = [
["name", "text", "氏名*", ""],
["email", "email", "メールアドレス*", ""],
["tel", "text", "電話番号*", ""],
["name", "text", "氏名*", "山田 太郎"],
["email", "email", "メールアドレス*", "info@so-manager.com"],
["tel", "text", "電話番号*", "000-0000-0000"],
["subject", "checkbox", "お問い合わせ概要*", ["定期契約について", "操作方法について", "支払方法について", "その他お問合せ"]],
["parking", "text", "お問い合わせ駐輪場名", ""],
["detail", "textarea", "お問い合わせ詳細*", ""],
@ -40,11 +40,11 @@ class InquiryConfirmController extends Controller
// エラーメッセージ
$message = [
'name.required' => '名前を入力してください',
'email.required' => 'メールアドレスを入力してください',
'tel.required' => '電話番号を入力してください',
'subject.required' => 'お問い合わせ概要を選択してください',
'detail.required' => 'お問い合わせ詳細を入力してください',
'name.required' => '氏名は必ず入力してください。',
'email.required' => 'メールアドレスは必ず入力してください。',
'tel.required' => '電話番号は必ず入力してください。',
'subject.required' => 'お問い合わせ概要が選択されていません。',
'detail.required' => 'お問い合わせの詳細が入力されていません。',
];
// バリデーションチェック

View File

@ -51,7 +51,7 @@ class MemberRegistrationController extends Controller
return view('general.swo2_2');
}
// 入力画面表示
// メールのURLからアクセス
public function index()
{
// 署名付きURLの有効期限チェック
@ -59,32 +59,39 @@ class MemberRegistrationController extends Controller
return redirect('error')->withErrors(['error' => '署名の有効期限が切れています']);
}
// 初回遷移(GETアクセス)時のリクエストパラメータチェック
if (!session()->has('email')) {
// パラメータ存在チェック
$encryptedEmail = request()->query('email');
if (!$encryptedEmail) {
return redirect('error')->withErrors(['error' => 'メールアドレスが指定されていません']);
}
// パラメータ存在チェック
$encryptedEmail = request()->query('email');
if (!$encryptedEmail) {
return redirect('error')->withErrors(['error' => 'メールアドレスが指定されていません']);
// パラメータ整合性チェック
try {
$email = decrypt($encryptedEmail);
} catch (\Exception $e) {
return redirect('error')->withErrors(['error' => 'メールアドレスの情報が不正です']);
}
// 二重登録防止チェック
$existingMember = User::where('user_primemail', $email)->get();
foreach ($existingMember as $member) {
if ($member->user_quit_flag != 1) {
return redirect('error')->withErrors(['error' => '既に登録済みです']);
}
}
// パラメータ整合性チェック
try {
$email = decrypt($encryptedEmail);
} catch (\Exception $e) {
return redirect('error')->withErrors(['error' => 'メールアドレスの情報が不正です']);
}
// メールアドレスをセッションに保存
session(['email' => $email]);
// 二重登録防止チェック
$existingMember = User::where('user_primemail', $email)->get();
foreach ($existingMember as $member) {
if ($member->user_quit_flag != 1) {
return redirect('error')->withErrors(['error' => '既に登録済みです']);
}
}
// 入力画面に遷移
return view('general.swo2_3');
}
// メールアドレスをセッションに保存
session(['email' => $email]);
// リダイレクト用
public function indexBack(Request $request)
{
if (!session('email')) {
return redirect('error')->withErrors(['error' => '不正なアクセスです']);
}
// 入力画面に遷移
@ -119,9 +126,7 @@ class MemberRegistrationController extends Controller
// バリデーションチェック
$validator = Validator::make($request->all(), $rules, $message);
if ($validator->fails()) {
return redirect('swo2_3')
->withErrors($validator)
->withInput();
return redirect('swo2_3B')->withErrors($validator)->withInput();
}
// 画面返却値
@ -142,7 +147,7 @@ class MemberRegistrationController extends Controller
{
// 前の画面に戻る
if($request->input('back') == 'back'){
return redirect('swo2_3')->withInput();
return redirect('swo2_3B')->withInput();
}
// 登録完了後のブラウザバックによる二重登録対策

View File

@ -66,10 +66,10 @@
<thead>
<tr>
<th width="20%">駐輪場名</th>
<th width="15%">市町村名</th>
<th width="5%">駅名</th>
<th width="30%">市町村名</th>
<th width="20%">駅名</th>
@foreach($psections as $psection)
<th width="15%">{{ $psection->psection_subject }}</th>
<th width="10%">{{ $psection->psection_subject }}</th>
@endforeach
</tr>
</thead>
@ -207,7 +207,7 @@
html += '<div class="d-flex align-items-center mb-2">';
html += '<span>' + zone.psection_subject + ':空き' + zone.zone_vacant + '台</span>';
if (zone.status == 1) {
html += '<a href="{{route('user.info')}}" class="btn btn-sm btn-outline-success ml-2">定期契約</a>';
html += '<a href="{{route('regular_contract.create')}}" class="btn btn-sm btn-outline-success ml-2">定期契約</a>';
} else if (zone.status == 2) {
html += '<a href="{{route('park_waitlist.index')}}" class="btn btn-sm btn-outline-primary ml-2">空き待ち予約</a>';
} else if (zone.status == 3) {

View File

@ -5,13 +5,18 @@
<div class="col-12 col-lg-10 offset-0 offset-lg-1 mt20 mb20">
<h2 class="text-success text-center">お問い合わせ</h2>
<p>株式会社ソーリンへのご訪問ありがとうございます。
お問い合わせいただくお客さまは、当社のホームページにおける<a href="{{ route('swo14_1') }}">個人情報の取り扱い</a>について、あらかじめご確認いただき、ご同意いただいた上でお問い合わせください。個人情報の開示、訂正、削除、利用停止については、<a href="{{ asset('assets/privacy_disclosure.pdf') }}">こちら</a>をご覧下さい。<br>
お問い合わせいただくお客さまは、当社のホームページにおける<a href="{{ route('swo14_1') }}">個人情報の取り扱い</a>について、あらかじめご確認いただき、ご同意いただいた上でお問い合わせください。個人情報の開示、訂正、削除、利用停止については、<a href="{{ route('swo15_1') }}">こちら</a>をご覧下さい。<br>
また、メールから送信ができないお客様はお手数ですが、下記電話までご連絡をお願い致します。
携帯・スマートフォンからメールでのお問い合わせの際に、確実にご返信をさせていただくために、ドメイン (so-manager.com) の受信許可設定をお願い致します。</p>
<form class="form-contact form mt50" method="post" action="{{ route('swo7_2') }}">
@if($errors->any())
<div class="alert alert-danger error-message" role="alert">
@foreach ($errors->all() as $error){{ $error }}<br /> @endforeach
</div>
@endif
<div class="row">
@foreach($form_data as $value)
<div class="col-lg-3">{{ $value[2] }}</div>
<div class="col-lg-3">{!! preg_replace('/\*$/', '<span style="color:red;">*</span>', e($value[2])) !!}</div>
@if($value[1] == 'textarea')
<div class="col-lg-9"><textarea name="{{ $value[0] }}" cols="6" class="form-control">{{ old($value[0]) }}</textarea></div>
@elseif($value[1] == 'checkbox')
@ -25,18 +30,10 @@
@endforeach
</div>
@else
<div class="col-lg-9"><input name="{{ $value[0] }}" type="{{ $value[1] }}" value="{{ old($value[0]) }}" class="form-control mb10"></div>
<div class="col-lg-9"><input name="{{ $value[0] }}" type="{{ $value[1] }}" value="{{ old($value[0]) }}" class="form-control mb10" placeholder="{{ $value[3] }}"></div>
@endif
@endforeach
</div>
<p style="color: red;">
@foreach($form_data as $value)
@if($errors->has($value[0]))
{{ $errors->first($value[0]) }}
@break;
@endif
@endforeach
</p>
<div class="col-lg-12 mt50 mb50 text-center"><button type="submit" class="btn btn-lg btn-success mb10">入力内容を確認する</button></div>
@csrf
</form>

View File

@ -16,7 +16,7 @@
</div>
<div class="col-12 col-lg-3 text-lg-center offset-0 offset-lg-1"><label>パスワード</label></div>
<div class="col-12 col-lg-7 mb10">
<input type="text" name="password" class="form-control form-control-lg" value="" />
<input type="password" name="password" class="form-control form-control-lg" value="" />
</div>
<div class="col-12 col-lg-6 text-lg-center offset-0 offset-lg-3 mt30 mb50">
<div class="text-danger">@if ($errors->any()) @foreach ($errors->all() as $error) {{ $error }} @endforeach @endif</div><br />

View File

@ -52,6 +52,7 @@ Route::get('/error', function () { return view('general.error'); })->name('error
// コントローラー経由
Route::post('/swo2_2', [MemberRegistrationController::class, 'sendMail'])->name('swo2_2');
Route::get('/swo2_3', [MemberRegistrationController::class, 'index'])->name('swo2_3')->middleware('signed');
Route::get('/swo2_3B', [MemberRegistrationController::class, 'indexBack'])->name('swo2_3B');
Route::post('/swo2_4', [MemberRegistrationController::class, 'confirm'])->name('swo2_4');
Route::post('/swo2_5', [MemberRegistrationController::class, 'complete'])->name('swo2_5');
Route::get('/swo4_1', [LoginController::class, 'login'])->name('swo4_1');