From 5e00cbc99a5a05c2ca0cd6309e68da26f1fc4844 Mon Sep 17 00:00:00 2001 From: Yuka Higashide Date: Fri, 12 Sep 2025 17:40:49 +0900 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=A6=8F=E5=AE=9A=E6=9C=9F=E5=A5=91?= =?UTF-8?q?=E7=B4=84=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ParkDetailController.php | 87 ++ .../Controllers/RegularContractController.php | 2 - .../RegularContractCreateController.php | 793 ++++++++++++++++++ public/assets/js/commons.js | 195 +++-- resources/views/layouts/app.blade.php | 10 +- resources/views/partials/paging.blade.php | 35 + .../views/regular_contract/create.blade.php | 184 ++++ .../regular_contract/create_confirm.blade.php | 157 ++++ .../create_idcard_checking.blade.php | 23 + .../create_select_period.blade.php | 81 ++ .../views/regular_contract/input.blade.php | 478 +++++++++++ .../regular_contract/park_detail.blade.php | 109 +++ .../regular_contract/regulation.blade.php | 62 ++ .../upload_identity_create.blade.php | 72 ++ routes/web.php | 18 +- 15 files changed, 2223 insertions(+), 83 deletions(-) create mode 100644 app/Http/Controllers/ParkDetailController.php create mode 100644 app/Http/Controllers/RegularContractCreateController.php create mode 100644 resources/views/partials/paging.blade.php create mode 100644 resources/views/regular_contract/create.blade.php create mode 100644 resources/views/regular_contract/create_confirm.blade.php create mode 100644 resources/views/regular_contract/create_idcard_checking.blade.php create mode 100644 resources/views/regular_contract/create_select_period.blade.php create mode 100644 resources/views/regular_contract/input.blade.php create mode 100644 resources/views/regular_contract/park_detail.blade.php create mode 100644 resources/views/regular_contract/regulation.blade.php create mode 100644 resources/views/regular_contract/upload_identity_create.blade.php diff --git a/app/Http/Controllers/ParkDetailController.php b/app/Http/Controllers/ParkDetailController.php new file mode 100644 index 0000000..bde4c8e --- /dev/null +++ b/app/Http/Controllers/ParkDetailController.php @@ -0,0 +1,87 @@ +where('park_id', $park_id)->first(); + Log::debug('park:', (array)$park); + $zones = DB::table('zone') + ->leftJoin('psection', 'zone.psection_id', '=', 'psection.psection_id') + ->leftJoin('ptype', 'zone.ptype_id', '=', 'ptype.ptype_id') + ->select('zone.*', 'psection.psection_subject', 'ptype.ptype_subject') + ->where('zone.park_id', $park_id) + ->get(); + Log::debug('zones:', $zones->toArray()); + $reserves = DB::table('reserve') + ->join('zone', function ($join) { + $join->on('reserve.psection_id', '=', 'zone.psection_id') + ->on('reserve.ptype_id', '=', 'zone.ptype_id'); + }) + ->join('ptype', 'zone.ptype_id', '=', 'ptype.ptype_id') + ->where('reserve.park_id', $park_id) + ->where('reserve.valid_flag', 1) + ->select('reserve.*', 'ptype.ptype_subject') + ->get(); + Log::debug('reserves:', $reserves->toArray()); + + $zoneStandardSum = []; + /*foreach ($zones as $zone) { + $psectionId = $zone->psection_id; + if (!isset($zoneStandardSum[$psectionId])) { + $zoneStandardSum[$psectionId] = 0; + } + $zoneStandardSum[$psectionId] += $zone->zone_standard; + }*/ + $zoneStandardSum = []; + foreach ($zones as $zone) { + $key = $zone->psection_subject; // 「自転車」「原付」など + if (!isset($zoneStandardSum[$key])) { + $zoneStandardSum[$key] = 0; + } + $zoneStandardSum[$key] += $zone->zone_standard; + } + Log::debug('zoneStandardSum:', $zoneStandardSum); + + // 空き台数集計用配列 + $vacancyData = []; + foreach ($zones as $zone) { + $key = $zone->psection_id . '_' . $zone->ptype_subject; + if (!isset($vacancyData[$key])) { + $vacancyData[$key] = 0; + } + // zone_tolerance - zone_number を合計 + $vacancyData[$key] += ($zone->zone_tolerance - $zone->zone_number); + } + Log::debug('vacancyData:', $vacancyData); + + // reserve件数分を減算 + foreach ($reserves as $reserve) { + $key = $reserve->psection_id . '_' . $reserve->ptype_subject; + if (isset($vacancyData[$key])) { + $vacancyData[$key] -= 1; // 1件分減算 + } + } + + // 更新期間取得 + $city_grace_periods = DB::table('city') + ->select('city_id', 'update_grace_period_start_date', 'update_grace_period_start_time', 'update_grace_period_end_date', 'update_grace_period_end_time') + ->whereIn('city_id', function ($query) { + $query->select('city_id')->from('park'); + }) + ->get() + ->keyBy('city_id'); + Log::debug('city_grace_periods:', $city_grace_periods->toArray()); + + // 必要なら他テーブルJOINや追加情報も取得 + return response()->json([ + 'html' => view('regular_contract.park_detail', compact('park', 'zones', 'reserves', 'zoneStandardSum', 'vacancyData', 'city_grace_periods'))->render() + ]); + } +} diff --git a/app/Http/Controllers/RegularContractController.php b/app/Http/Controllers/RegularContractController.php index e22f916..5d650aa 100644 --- a/app/Http/Controllers/RegularContractController.php +++ b/app/Http/Controllers/RegularContractController.php @@ -396,8 +396,6 @@ class RegularContractController extends Controller // 必要な各マスタ情報を取得 $user = DB::table('user')->where('user_id', $user_id)->first(); $contract = DB::table('regular_contract')->where('contract_id', $contract_id)->first(); - // $city_id = DB::table('park')->where('park_id', $contract->park_id)->value('city_id'); - //$city_name = DB::table('city')->where('city_id', $city_id)->value('city_name'); $park = DB::table('park')->where('park_id', $contract->park_id)->first(); $city = DB::table('city')->where('city_id', $park->city_id)->first(); $regular_type = DB::table('regular_type')->where('city_id', $city->city_id)->first(); diff --git a/app/Http/Controllers/RegularContractCreateController.php b/app/Http/Controllers/RegularContractCreateController.php new file mode 100644 index 0000000..13850a4 --- /dev/null +++ b/app/Http/Controllers/RegularContractCreateController.php @@ -0,0 +1,793 @@ +where('user_id', $user_id)->first(); + + // 市町村名(park→city JOINで重複排除) + $cities = DB::table('park') + ->join('city', 'park.city_id', '=', 'city.city_id') + ->select('city.city_id', 'city.city_name') + ->distinct() + ->get(); + + // city_idごとの更新可能期間情報を取得 + $city_grace_periods = DB::table('city') + ->select('city_id', 'update_grace_period_start_date', 'update_grace_period_start_time', 'update_grace_period_end_date', 'update_grace_period_end_time') + ->get() + ->keyBy('city_id'); + + // 駅名(stationテーブルのstation_neighbor_station全件) + $stations = DB::table('station') + ->select('station_neighbor_station') + ->distinct() + ->get(); + + // 駐輪場名(parkテーブルのpark_name全件) + $parks = DB::table('park') + ->select('park_id', 'park_name') + ->distinct() + ->get(); + + // テーブル表示用データ(park/city/station JOIN, park_id昇順, 10件ずつページング) + $page = request()->input('page', 1); + $perPage = 10; + $city_id = request()->input('city_id'); + $station_name = request()->input('station_neighbor_station'); + $park_id = request()->input('park_id'); + + $query = DB::table('park') + ->join('city', 'park.city_id', '=', 'city.city_id') + ->leftJoin('station', 'park.park_id', '=', 'station.park_id') + ->select( + 'park.park_id', + 'park.park_name', + 'park.park_ruby', + 'city.city_name', + 'city.city_id', + 'station.station_neighbor_station', + 'station.station_name_ruby' + ); + + if ($city_id) { + $query->where('city.city_id', $city_id); + } + if ($station_name) { + $query->where('station.station_neighbor_station', $station_name); + } + if ($park_id) { + $query->where('park.park_id', $park_id); + } + + // 並び替えパラメータ取得 + $sort = request()->input('sort', 'park_id'); + $order = request()->input('order', 'asc'); + $sortable = [ + 'park_ruby' => 'park.park_ruby', + 'city_id' => 'city.city_id', + 'station_name_ruby' => 'station.station_name_ruby', + 'park_id' => 'park.park_id', + ]; + if (isset($sortable[$sort])) { + $query->orderBy($sortable[$sort], $order); + } else { + $query->orderBy('park.park_id', 'asc'); + } + + $total = $query->count(); + $parks_table = $query->skip(($page - 1) * $perPage)->take($perPage)->get(); + + // zoneテーブルデータを取得(psectionテーブルとJOINしてpsection_subjectも取得) + $zones = DB::table('zone') + ->leftJoin('psection', 'zone.psection_id', '=', 'psection.psection_id') + ->select('zone.zone_id', 'zone.park_id', 'zone.psection_id', 'zone.zone_number', 'zone.zone_tolerance', 'psection.psection_subject') + ->get() + ->groupBy('park_id'); + + // 空き予約マスタデータを取得 + $reserve = DB::table('reserve') + ->select('reserve_id', 'park_id', 'psection_id') + ->where('valid_flag', 1) + ->get() + ->groupBy('park_id'); + + \Log::info('新規定期契約-駐輪場選択画面にアクセス', [ + 'user_id' => $user_id, + ]); + + return view('regular_contract.create', [ + 'active_menu' => 'SWC-8-1', // この画面のID + 'user_name' => $user ? $user->user_name : '', // ユーザー名(ヘッダー用) + 'cities' => $cities, + 'stations' => $stations, + 'parks' => $parks, + 'parks_table' => $parks_table, + 'parks_table_total' => $total, + 'parks_table_page' => $page, + 'parks_table_perPage' => $perPage, + 'zones' => $zones, + 'city_grace_periods' => $city_grace_periods, + 'reserve' => $reserve, + ]); + } + + public function regulationCheck(Request $request) + { + // GETパラメータを取得 + $parkId = $request->query('park_id'); + $psectionId = $request->query('psection_id'); + $ptypeId = $request->query('ptype_id'); + + // 必要なDB処理やロジック + $park_regulation = DB::table('park')->where('park_id', $parkId)->value('parking_regulations_flag'); + + if ($park_regulation == 1) { + // 駐輪規定画面へ + return redirect()->route('regular_contract.regulation', [ + 'park_id' => $parkId, + 'psection_id' => $psectionId, + 'ptype_id' => $ptypeId, + ]); + } else { + // 契約情報入力画面へ + return redirect()->route('regular_contract.input', [ + 'park_id' => $parkId, + 'psection_id' => $psectionId, + 'ptype_id' => $ptypeId, + ]); + } + } + + public function showRegulation(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'); + + // 必要なパラメータ取得 + $parkId = $request->query('park_id'); + $psectionId = $request->query('psection_id'); + $ptypeId = $request->query('ptype_id'); + + $park_name = DB::table('park')->where('park_id', $parkId)->value('park_name'); + $psection_subject = DB::table('psection')->where('psection_id', $psectionId)->value('psection_subject'); + $ptype_subject = DB::table('ptype')->where('ptype_id', $ptypeId)->value('ptype_subject'); + $regulations_text = DB::table('parking_regulations') + ->where('park_id', $parkId) + ->where('psection_id', $psectionId) + ->where('ptype_id', $ptypeId) + ->value('regulations_text'); + + \Log::info('駐輪規定確認画面にアクセス', [ + 'user_id' => $user_id, + ]); + + return view('regular_contract.regulation', [ + 'park_id' => $parkId, + 'park_name' => $park_name, + 'psection_id' => $psectionId, + 'psection_subject' => $psection_subject, + 'ptype_id' => $ptypeId, + 'ptype_subject' => $ptype_subject, + 'regulations_text' => $regulations_text, + 'active_menu' => 'SWC-8-1', // この画面のID + 'user_name' => $user_name, // ユーザー名(ヘッダー用) + ]); + } + + public function insertRegulation(Request $request) + { + $user_id = session('user_id'); + if (!$user_id) { + return redirect('/login'); + } + $park_id = $request->input('park_id'); + $psection_id = $request->input('psection_id'); + $ptype_id = $request->input('ptype_id'); + + DB::table('parking_regulations_read')->insert([ + 'park_id' => $park_id, + 'psection_id' => $psection_id, + 'ptype_id' => $ptype_id, + 'user_id' => $user_id, + 'created_at' => now(), + ]); + + // 契約入力画面へリダイレクト + return redirect()->route('regular_contract.input', [ + 'park_id' => $park_id, + 'psection_id' => $psection_id, + 'ptype_id' => $ptype_id, + ]); + } + + // 契約入力画面表示 + public function showContractForm(Request $request) + { + $user_id = session('user_id'); + if (!$user_id) { + return redirect('/login'); + } + $user = DB::table('user')->where('user_id', $user_id)->first(); + $park_id = $request->query('park_id'); + $park = DB::table('park')->where('park_id', $park_id)->first(); + $psection_id = $request->query('psection_id'); + $ptype_id = $request->query('ptype_id'); + $city_id = DB::table('park')->where('park_id', $park_id)->value('city_id'); + $terms_text = DB::table('terms')->where('city_id', $city_id)->value('terms_text'); + // 利用者区分をusertypeテーブルから取得 + $user_category = ''; + if (isset($user->user_categoryid)) { + $usertype = DB::table('usertype') + ->where('user_categoryid', $user->user_categoryid) + ->first(); + if ($usertype && isset($usertype->usertype_subject1)) { + $user_category = $usertype->usertype_subject1; + } + } + $user->user_homephone = explode('-', $user->user_homephone ?? ''); + $user->user_mobile = explode('-', $user->user_mobile ?? ''); + $user->user_regident_zip_1 = substr($user->user_regident_zip ?? '', 0, 3); + $user->user_regident_zip_2 = substr($user->user_regident_zip ?? '', 3, 4); + $user->user_relate_zip_1 = substr($user->user_relate_zip ?? '', 0, 3); + $user->user_relate_zip_2 = substr($user->user_relate_zip ?? '', 3, 4); + + \Log::info('新規定期契約-契約情報入力画面にアクセス', [ + 'user_id' => $user_id, + ]); + + session()->forget('show_terms_modal'); + + return view('regular_contract.input', [ + 'park' => $park, + 'psection_id' => $psection_id, + 'ptype_id' => $ptype_id, + 'terms_text' => $terms_text, + 'user' => $user, + 'user_name' => $user->user_name, // ユーザー名(ヘッダー用) + 'active_menu' => 'SWC-8-1', // この画面のID + 'user_category' => $user_category, + 'show_terms_modal' => true, + ]); + } + public function inputCheck(Request $request) + { + $user_id = session('user_id'); + if (!$user_id) { + return redirect('/login'); + } + $user = DB::table('user')->where('user_id', $user_id)->first(); + + $park_id = $request->input('park_id'); + $park = DB::table('park')->where('park_id', $park_id)->first(); + + // バリデーションルール + $rules = [ + 'user_phonetic' => ['required', 'regex:/^[ァ-ヶー \s]+$/u'], + 'user_regident_zip_1' => 'required|digits:3', + 'user_regident_zip_2' => 'required|digits:4', + 'user_regident_pre' => [ + 'required', + Rule::in([ + '北海道', + '青森県', + '岩手県', + '宮城県', + '秋田県', + '山形県', + '福島県', + '茨城県', + '栃木県', + '群馬県', + '埼玉県', + '千葉県', + '東京都', + '神奈川県', + '新潟県', + '富山県', + '石川県', + '福井県', + '山梨県', + '長野県', + '岐阜県', + '静岡県', + '愛知県', + '三重県', + '滋賀県', + '京都府', + '大阪府', + '兵庫県', + '奈良県', + '和歌山県', + '鳥取県', + '島根県', + '岡山県', + '広島県', + '山口県', + '徳島県', + '香川県', + '愛媛県', + '高知県', + '福岡県', + '佐賀県', + '長崎県', + '熊本県', + '大分県', + '宮崎県', + '鹿児島県', + '沖縄県' + ]), + ], + 'user_regident_city' => ['required', 'string', 'max:20', 'regex:/^(?:(?![\xF0-\xF7][\x80-\xBF]{3}).)*$/'], + 'user_regident_add' => ['required', 'string', 'max:50', 'regex:/^(?:(?![\xF0-\xF7][\x80-\xBF]{3}).)*$/'], + 'user_homephone.*' => 'nullable|digits_between:1,5', + 'user_mobile.*' => 'nullable|digits_between:1,5', + 'user_submail' => 'nullable|email|different:user_primemail|max:80', + 'user_category' => ['required', Rule::in(['一般', '学生'])], + 'contract_reduction' => ['required', Rule::in(['はい', 'いいえ'])], + 'user_relate_zip_1' => 'nullable|digits:3', + 'user_relate_zip_2' => 'nullable|digits:4', + 'user_relate_pre' => [ + 'nullable', + Rule::in([ + '北海道', + '青森県', + '岩手県', + '宮城県', + '秋田県', + '山形県', + '福島県', + '茨城県', + '栃木県', + '群馬県', + '埼玉県', + '千葉県', + '東京都', + '神奈川県', + '新潟県', + '富山県', + '石川県', + '福井県', + '山梨県', + '長野県', + '岐阜県', + '静岡県', + '愛知県', + '三重県', + '滋賀県', + '京都府', + '大阪府', + '兵庫県', + '奈良県', + '和歌山県', + '鳥取県', + '島根県', + '岡山県', + '広島県', + '山口県', + '徳島県', + '香川県', + '愛媛県', + '高知県', + '福岡県', + '佐賀県', + '長崎県', + '熊本県', + '大分県', + '宮崎県', + '鹿児島県', + '沖縄県' + ]), + ], + 'user_relate_city' => ['nullable', 'string', 'max:20', 'regex:/^(?:(?![\xF0-\xF7][\x80-\xBF]{3}).)*$/'], + 'user_relate_add' => ['nullable', 'string', 'max:50', 'regex:/^(?:(?![\xF0-\xF7][\x80-\xBF]{3}).)*$/'], + ]; + // 性別欄が表示されている場合のみ必須 + if ((int)$park->gender_display_flag === 1) { + $rules['user_gender'] = ['required', Rule::in(['男性', '女性'])]; + } + // 生年月日欄が表示されている場合のみ必須 + if ((int)$park->bd_display_flag === 1) { + $rules['user_birthdate'] = ['required', 'date']; + } + // 防犯登録番号欄が表示されている場合のみ必須 + if ((int)$park->securityreg_display_flag === 1) { + $rules['user_securitynum'] = ['required', 'max:50', 'regex:/^[a-zA-Z0-9]+$/']; + } + // 利用者区分ごとの追加バリデーション + if ($request->input('user_category') === '学生') { + $rules['user_school'] = ['required', 'string', 'max:50', 'regex:/^(?:(?![\xF0-\xF7][\x80-\xBF]{3}).)*$/']; + $rules['user_graduate'] = ['required', 'date']; + } else { + $rules['user_workplace'] = ['nullable', 'string', 'max:50', 'regex:/^(?:(?![\xF0-\xF7][\x80-\xBF]{3}).)*$/']; + } + $messages = [ + 'user_phonetic.required' => 'フリガナが入力されていません。', + 'user_phonetic.regex' => 'フリガナはカタカナでご入力ください。', + 'user_gender.required' => '性別が入力されていません。', + 'user_gender.in' => '性別は「男性」または「女性」を選択してください。', + 'user_regident_zip_1.required' => '居住所の郵便番号(前半3桁)が入力されていません。', + 'user_regident_zip_2.required' => '居住所の郵便番号(後半4桁)が入力されていません。', + 'user_regident_zip_1.digits' => '居住所の郵便番号(前半3桁)は3桁の数字で入力してください。', + 'user_regident_zip_2.digits' => '居住所の郵便番号(後半4桁)は4桁の数字で入力してください。', + 'user_regident_pre.required' => '居住所の都道府県が選択されていません。', + 'user_regident_pre.in' => '都道府県は選択肢から選んでください。', + 'user_regident_city.required' => '居住所の市区町村が入力されていません。', + 'user_regident_city.max' => '居住所の市区町村は20文字以内で入力してください。', + 'user_regident_city.regex' => '居住所の市区町村に絵文字などの特殊文字は使用できません。', + 'user_regident_add.required' => '居住所の住所が入力されていません。', + 'user_regident_add.max' => '居住所の住所は50文字以内で入力してください。', + 'user_regident_add.regex' => '居住所の住所に絵文字などの特殊文字は使用できません。', + 'user_birthdate.required' => '生年月日が入力されていません。', + 'user_birthdate.date' => '生年月日は正しい日付で入力してください。', + 'user_homephone.*.digits_between' => '自宅電話番号はそれぞれ1~5桁の数字で入力してください。', + 'user_mobile.*.digits_between' => '携帯電話番号はそれぞれ1~5桁の数字で入力してください。', + 'user_submail.email' => '予備メールアドレスは正しい形式で入力してください。', + 'user_submail.max' => '予備メールアドレスは80文字以内で入力してください。', + 'user_submail.different' => 'メールアドレスと予備メールアドレスに同じアドレスを入力できません。', + 'user_category.required' => '利用者区分は必須です。', + 'user_category.in' => '利用者区分の値が不正です。', + 'contract_reduction.required' => '減免が選択されていません。', + 'contract_reduction.in' => '減免の値が不正です。', + 'user_workplace.max' => '勤務先は50文字以内で入力してください。', + 'user_workplace.regex' => '勤務先に絵文字などの特殊文字は使用できません。', + 'user_school.required' => '学校名が入力されていません。', + 'user_school.max' => '学校名は50文字以内で入力してください。', + 'user_school.regex' => '学校名に絵文字などの特殊文字は使用できません。', + 'user_graduate.required' => '卒業年月日が入力されていません。', + 'user_graduate.date' => '卒業年月日は正しい日付で入力してください。', + 'user_relate_zip_1.digits' => '住所の郵便番号(前半3桁)は3桁の数字で入力してください。', + 'user_relate_zip_2.digits' => '住所の郵便番号(後半4桁)は4桁の数字で入力してください。', + 'user_relate_pre.in' => '住所の都道府県は選択肢から選んでください。', + 'user_relate_city.max' => '住所の市区町村は20文字以内で入力してください。', + 'user_relate_city.regex' => '住所の市区町村に絵文字などの特殊文字は使用できません。', + 'user_relate_add.max' => '住所は50文字以内で入力してください。', + 'user_relate_add.regex' => '住所に絵文字などの特殊文字は使用できません。', + 'user_securitynum.required' => '防犯登録番号が入力されていません。', + 'user_securitynum.max' => '防犯登録番号は50文字以内で入力してください。', + 'user_securitynum.regex' => '防犯登録番号は英数字のみで入力してください。', + ]; + try { + $validated = $request->validate($rules, $messages); + } catch (ValidationException $e) { + return Redirect()->back() + ->withErrors($e->validator) + ->withInput($request->except('_token') + ['show_terms_modal' => false]); + } + + if (empty(implode('', $request->input('user_homephone', []))) && empty(implode('', $request->input('user_mobile', [])))) { + return redirect()->back() + ->withErrors(['user_homephone' => '自宅電話番号または携帯電話番号のいずれかは必須です']) + ->withInput($request->except('_token') + ['show_terms_modal' => false]); + } + + $city = DB::table('city')->where('city_id', $park->city_id)->first(); + $matched = (mb_strpos($request->user_regident_city, $city->city_name) !== false); + if ($matched === true) { + $ward_residents = 1; + DB::table('user') + ->where('user_id', $user->user_id) + ->update(['ward_residents' => $ward_residents]); + } else { + $contract_allowable_city_name = DB::table('contract_allowable_city')->where('city_id', $city->city_id)->value('contract_allowable_city_name'); + $matched_allowable = (mb_strpos($request->user_regident_city, $contract_allowable_city_name) !== false); + if ($matched_allowable) { + $ward_residents = 0; + DB::table('user') + ->where('user_id', $user->user_id) + ->update(['ward_residents' => $ward_residents]); + } else { + return redirect()->back()->withErrors(['契約対象地域にお住まいでないためお申込みできません'])->withInput()->with(['show_terms_modal' => false]); + } + } + if ($ward_residents == 1) { + $usertype_subject2 = '区民'; + } else { + $usertype_subject2 = '区民外'; + } + + $user_categoryid = DB::table('usertype') + ->where('usertype_subject1', $request->user_category) + ->where('usertype_subject2', $usertype_subject2) + ->value('user_categoryid'); + + $updateData = [ + 'user_categoryid' => $user_categoryid, + 'user_phonetic' => $request->user_phonetic, + 'user_mobile' => implode('-', $request->input('user_mobile', [])), + 'user_homephone' => implode('-', $request->input('user_homephone', [])), + 'user_submail' => $request->filled('user_submail') ? $request->user_submail : null, + 'user_regident_zip' => $request->user_regident_zip_1 . $request->user_regident_zip_2, + 'user_regident_pre' => $request->user_regident_pre, + 'user_regident_city' => $request->user_regident_city, + 'user_regident_add' => $request->user_regident_add, + 'user_relate_zip' => ($request->filled('user_relate_zip_1') && $request->filled('user_relate_zip_2')) ? ($request->user_relate_zip_1 . $request->user_relate_zip_2) : null, + 'user_relate_pre' => $request->filled('user_relate_pre') ? $request->user_relate_pre : null, + 'user_relate_city' => $request->filled('user_relate_city') ? $request->user_relate_city : null, + 'user_relate_add' => $request->filled('user_relate_add') ? $request->user_relate_add : null, + 'ward_residents' => $ward_residents, + 'user_workplace' => $request->user_category === '一般' ? $request->user_workplace : null, + 'user_school' => $request->user_category === '学生' ? $request->user_school : null, + 'user_graduate' => $request->user_category === '学生' ? $request->user_graduate : null, + 'updated_at' => now() + ]; + + // 性別欄が表示されている場合のみ追加 + if (!empty($park->gender_display_flag) && $park->gender_display_flag == 1) { + $updateData['user_gender'] = $request->user_gender; + } + + // 生年月日欄が表示されている場合のみ追加 + if (!empty($park->bd_display_flag) && $park->bd_display_flag == 1) { + $updateData['user_birthdate'] = $request->user_birthdate; + $updateData['user_age'] = $request->user_age; + } + + DB::table('user') + ->where('user_id', $user->user_id) + ->update($updateData); + + $zone_id = DB::table('zone') + ->where('park_id', $request->park_id) + ->where('ptype_id', $request->ptype_id) + ->where('psection_id', $request->psection_id) + ->orderBy('zone_sort', 'asc') + ->value('zone_id'); + + $contract_id = DB::table('regular_contract')->insertGetId([ + 'created_at' => now(), + 'updated_at' => now(), + 'user_id' => $user->user_id, + 'user_categoryid' => $user_categoryid, + 'park_id' => $park->park_id, + 'contract_created_at' => now(), + 'contract_reduction' => $ward_residents, + 'update_flag' => 2, + 'contract_cancel_flag' => 0, + 'psection_id' => $request->psection_id, + 'ptype_id' => $request->ptype_id, + 'zone_id' => $zone_id + ]); + + $contractUpdateData = [ + 'contract_qr_id' => DB::raw("TO_BASE64(AES_ENCRYPT($contract_id, 'LJLASR4FAS34SAADFA72ASDFALLSDRGT'))") + ]; + // 防犯登録番号が表示されている場合のみ追加 + if (!empty($park->securityreg_display_flag) && $park->securityreg_display_flag == 1) { + $contractUpdateData['user_securitynum'] = $request->user_securitynum; + } + + DB::table('regular_contract') + ->where('contract_id', $contract_id) + ->update($contractUpdateData); + + return redirect()->route('regular_contract.upload_identity_create', [ + 'contract_id' => $contract_id, + ]); + } + + public function showUploadIdentityCreate(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'); + $contract = DB::table('regular_contract')->where('contract_id', $request->contract_id)->first(); + + \Log::info('新規定期契約-本人確認書類アップロード画面にアクセス', [ + 'user_id' => $user_id, + ]); + + return view('regular_contract.upload_identity_create', [ + 'contract_id' => $request->contract_id, + 'park_id' => $contract->park_id, + 'psection_id' => $contract->psection_id, + 'ptype_id' => $contract->ptype_id, + 'user_name' => $user_name, + 'active_menu' => 'SWC-8-1' + ]); + } + public function confirmUploadIdentity(Request $request, $contract_id) + { + $user_id = session('user_id'); + if (!$user_id) { + return redirect('/login'); + } + + $validator = Validator::make($request->all(), [ + 'idcard_type' => 'required', + 'user_idcard' => 'required|file|mimes:jpg,jpeg,png,pdf', + ], [ + 'idcard_type.required' => '本人確認書類の種類を選択してください。', + 'user_idcard.required' => '本人確認書類のおもて画像をアップロードしてください。', + 'user_idcard.file' => '本人確認書類のおもて画像はファイルで指定してください。', + 'user_idcard.mimes' => 'アップロードできるファイル形式はjpg、jpeg、png、pdfのみです。', + ]); + if ($validator->fails()) { + return redirect()->route('regular_contract.upload_identity_create', [ + 'contract_id' => $contract_id, + ]) + ->withErrors($validator) + ->withInput(); + } + + // おもて画像保存 + $front = $request->file('user_idcard'); + $filename_front = uniqid('photo1_') . '.' . $front->getClientOriginalExtension(); + $front->storeAs('photo', $filename_front, 'public'); + // userテーブルに保存 本人確認書類チェック済フラグや更新日時も更新項目に追加 + $updateData = [ + 'photo_filename1' => $filename_front, + 'user_idcard' => $request->idcard_type, + 'user_idcard_chk_flag' => 1, + 'updated_at' => now(), + ]; + // ウラ画像がある場合保存し更新項目に追加 + if ($request->hasFile('user_idcard2')) { + $back = $request->file('user_idcard2'); + $filename_back = uniqid('photo2_') . '.' . $back->getClientOriginalExtension(); + $back->storeAs('photo', $filename_back, 'public'); + $updateData['photo_filename2'] = $filename_back; + } + DB::table('user')->where('user_id', $user_id)->update($updateData); + $user = DB::table('user')->where('user_id', $user_id)->first(); + $park = DB::table('park')->where('park_id', $request->park_id)->first(); + $psection = DB::table('psection')->where('psection_id', $request->psection_id)->first(); + $usertype = DB::table('usertype')->where('user_categoryid', $user->user_categoryid)->first(); + + \Log::info('新規定期契約-契約情報確認画面にアクセス', [ + 'user_id' => $user_id, + ]); + + return view('regular_contract.create_confirm', [ + 'contract_id' => $request->contract_id, + 'user' => $user, + 'park' => $park, + 'psection' => $psection, + 'usertype' => $usertype, + 'user_name' => $user->user_name, + 'active_menu' => 'SWC-8-1' + ]); + } + + public function createConfirmNext($contract_id) + { + $user_id = session('user_id'); + if (!$user_id) { + return redirect('/login'); + } + $user = DB::table('user')->where('user_id', $user_id)->first(); + + // 本人確認自動処理結果を取得 + if ($user && $user->user_idcard_chk_flag == 2) { + // 本人確認OKの場合は利用期間選択画面へ + // 必要な各マスタ情報を取得 + $contract = DB::table('regular_contract')->where('contract_id', $contract_id)->first(); + $park = DB::table('park')->where('park_id', $contract->park_id)->first(); + $city = DB::table('city')->where('city_id', $park->city_id)->first(); + $regular_type = DB::table('regular_type')->where('city_id', $city->city_id)->first(); + $usertype = DB::table('usertype')->where('user_categoryid', $contract->user_categoryid)->first(); + + // 2重化しているマスタのため現在のテーブル名を取得 + $master_setting = DB::table('setting')->value('web_master'); + $tableName = 'price' . $master_setting; + + // 利用者区分に応じた逆利用フラグを取得 + $inverse_use_flag_column = ($usertype->usertype_subject1 == '一般') ? 'inverse_use_flag1' : 'inverse_use_flag2'; + $inverse_use_flag = $park->$inverse_use_flag_column; + + if ($inverse_use_flag == 0) { + // regident_cityまたはrelate_cityが一致するか + $is_same = ( + strpos($user->user_regident_city, $city->city_name) !== false || + strpos($user->user_relate_city, $city->city_name) !== false + ); + } else { + // regident_cityのみ一致するか + $is_same = (strpos($user->user_regident_city, $city->city_name) !== false); + } + + $target_subject2 = $is_same ? '区民' : '区民外'; + $user_categoryid = DB::table('usertype') + ->where('usertype_subject1', $usertype->usertype_subject1) + ->where('usertype_subject2', $target_subject2) + ->where('usertype_subject3', $usertype->usertype_subject3) + ->value('user_categoryid'); + + // 駐輪場所マスタから料金を取得 + $prices = DB::table($tableName) + ->where('park_id', $contract->park_id) + ->where('psection_id', $contract->psection_id) + ->where('ptype_id', $contract->ptype_id) + ->where('user_categoryid', $user_categoryid) + ->get(); + + \Log::info('利用期間選択画面にアクセス', [ + 'user_id' => $user_id, + ]); + + // 利用期間選択画面へ遷移 + return view('regular_contract.create_select_period', [ + 'active_menu' => 'SWC-4-1', // マイページメニューの選択状態用 + 'user_name' => $user->user_name, // ユーザー名(ヘッダー用) + 'contract_id' => $contract_id, + 'regular_type' => $regular_type, + 'prices' => $prices, + ]); + } else { + // NGの場合は本人確認書類確認中画面へ + \Log::info('本人確認書類確認中画面にアクセス', [ + 'user_id' => $user_id, + ]); + return view('regular_contract.create_idcard_checking', [ + 'active_menu' => 'SWC-8-1', // マイページメニューの選択状態用 + 'user_name' => $user->user_name, // ユーザー名(ヘッダー用) + ]); + } + } + + public function selectPeriod(Request $request) + { + $user_id = session('user_id'); + if (!$user_id) { + return redirect('/login'); + } + + // 期間選択チェック + $request->validate([ + 'month' => 'required', + ], [ + 'month.required' => '契約期間が選択されていません。', + ]); + + $contract_id = $request->input('contract_id'); + $month = $request->input('month'); + $price = $request->input('price_' . $month); + + \Log::info('契約期間更新処理', [ + 'month' => $month, + 'price' => $price, + ]); + $today = now(); + $day = $today->day; + if ($day <= 19) { + // 今月の1日 + $contract_periods = $today->copy()->startOfMonth()->format('Y-m-d'); + } else { + // 翌月の1日 + $contract_periods = $today->copy()->addMonth()->startOfMonth()->format('Y-m-d'); + } + $contract_periode = Carbon::parse($contract_periods)->addMonths($month - 1)->endOfMonth()->format('Y-m-d'); + // 契約更新 + DB::table('regular_contract')->where('contract_id', $contract_id)->update([ + 'enable_months' => $month, + 'billing_amount' => $price, + 'contract_periods' => $contract_periods, + 'contract_periode' => $contract_periode, + 'updated_at' => now(), + ]); + + // 完了後はウェルネット決済画面(仮)へリダイレクト + return redirect()->route('wellnet.payment'); + } +} diff --git a/public/assets/js/commons.js b/public/assets/js/commons.js index baee260..ef0a3b2 100644 --- a/public/assets/js/commons.js +++ b/public/assets/js/commons.js @@ -1,88 +1,87 @@ /* ハンバーガーメニュー開閉 ============================*/ -$(function() { - //ナビメニューボタンの開く・閉じる - $('#nav-menu-btn').on('click', function() { +$(function () { + //ナビメニューボタンの開く・閉じる + $('#nav-menu-btn').on('click', function () { $('#nav-menu-btn span').toggleClass('typcn-th-menu'); $('#nav-menu-btn span').toggleClass('typcn-times'); }); - //ナビメニューボタンの「開く・閉じる」文字変更 - var flg = "default"; - $('#my-menu-btn').click(function(){ - if(flg == "default"){ - $(this).text("マイメニューを閉じる"); - flg = "changed"; - }else{ - $(this).text("マイメニューを開く"); - flg = "default"; - } - }); + //ナビメニューボタンの「開く・閉じる」文字変更 + var flg = "default"; + $('#my-menu-btn').click(function () { + if (flg == "default") { + $(this).text("マイメニューを閉じる"); + flg = "changed"; + } else { + $(this).text("マイメニューを開く"); + flg = "default"; + } + }); }); /* slick slider ============================*/ -$(function() { +$(function () { $('.slider_1-1').slick({ - infinite: true, - dots:true, - arrows: true, - slidesToShow: 1, - slidesToScroll: 1, - responsive: [{ - breakpoint: 992, - settings: { - slidesToShow: 1, - slidesToScroll: 1, - } - }] - }); + infinite: true, + dots: true, + arrows: true, + slidesToShow: 1, + slidesToScroll: 1, + responsive: [{ + breakpoint: 992, + settings: { + slidesToShow: 1, + slidesToScroll: 1, + } + }] + }); $('.slider_2-1').slick({ - infinite: true, - dots:true, - arrows: true, - slidesToShow: 2, - slidesToScroll: 2, - responsive: [{ - breakpoint: 992, - settings: { - slidesToShow: 1, - slidesToScroll: 1, - } - }] - }); + infinite: true, + dots: true, + arrows: true, + slidesToShow: 2, + slidesToScroll: 2, + responsive: [{ + breakpoint: 992, + settings: { + slidesToShow: 1, + slidesToScroll: 1, + } + }] + }); $('.info-slider_1-1').slick({ - infinite: true, - dots: false, - arrows: true, - slidesToShow: 1, - slidesToScroll: 1, - responsive: [{ - breakpoint: 992, - settings: { - slidesToShow: 1, - slidesToScroll: 1, - } - }] - }); + infinite: true, + dots: false, + arrows: true, + slidesToShow: 1, + slidesToScroll: 1, + responsive: [{ + breakpoint: 992, + settings: { + slidesToShow: 1, + slidesToScroll: 1, + } + }] + }); }); /* jquery.tablesorter(空き駐輪場検索) ============================*/ - $(document).ready(function() - { - $("#searchTable").tablesorter({ - sortList: [[0,0]] - }); - } - ); +$(document).ready(function () { + $("#searchTable").tablesorter({ + sortList: [[0, 0]] + }); +} +); /* 文字の拡大・縮小 ============================*/ -$(function() { - //文字サイズ・大きく - $('#scale-control-area .btn-success').on('click', function() { +$(function () { + //文字サイズ・大きく + $('#scale-control-area .btn-success').on('click', function () { $(this).toggleClass('d-none'); $('#scale-control-area .btn-submit').toggleClass('d-none'); $('#scale-control-area .btn-secondary').addClass('d-none'); @@ -91,26 +90,80 @@ $(function() { $('#font-scale').removeClass('f-bigger'); $('#font-scale').removeClass('f-small'); }); - //文字サイズ・さらに大きく - $('#scale-control-area .btn-submit').on('click', function() { + //文字サイズ・さらに大きく + $('#scale-control-area .btn-submit').on('click', function () { $('#scale-control-area .btn-success').toggleClass('d-none'); $('#font-scale').addClass('f-bigger'); $('#font-scale').removeClass('f-big'); $('#font-scale').removeClass('f-small'); }); - //文字サイズ・小さく - $('#scale-control-area .btn-secondary').on('click', function() { + //文字サイズ・小さく + $('#scale-control-area .btn-secondary').on('click', function () { $(this).toggleClass('d-none'); $('#scale-control-area .btn-cancel').toggleClass('d-none'); $('#font-scale').addClass('f-small'); $('#font-scale').removeClass('f-bigger'); $('#font-scale').removeClass('f-big'); }); - //文字サイズ・元のサイズへ - $('#scale-control-area .btn-cancel').on('click', function() { + //文字サイズ・元のサイズへ + $('#scale-control-area .btn-cancel').on('click', function () { $('#scale-control-area .btn-secondary').toggleClass('d-none'); $('#font-scale').removeClass('f-bigger'); $('#font-scale').removeClass('f-big'); $('#font-scale').removeClass('f-small'); }); -}); \ No newline at end of file +}); + +// 駐輪場詳細ポップアップ +$(document).on('click', '.btn-popup', function () { + var parkId = $(this).data('park-id'); + $.ajax({ + url: '/api/park-detail/' + parkId, + method: 'GET', + success: function (data) { + $('#modalArea').html(data.html); // モーダル全体を挿入 + $('#parkDetailModal').modal('show'); // モーダルを表示 + }, + error: function () { + alert('詳細情報の取得に失敗しました'); + } + }); +}); + +$(document).on('click', '.btn-reserve', function (e) { + e.preventDefault(); + var parkId = $(this).data('park-id'); + var psectionId = $(this).data('psection-id'); + var ptypeId = $(this).data('ptype-id'); + + $.confirm({ + title: '確認', + content: 'こちらの駐輪場を予約しますか?
お申込みいただく各自治体の条例等によって、駐輪場までの距離制限等によりご契約いただけない場合がございます。
予めご了承くださいますようお願いいたします。', + buttons: { + OK: function () { + // GETパラメータでregulationメソッドに遷移 + location.href = '/park-waitlist/create?park_id=' + parkId + '&psection_id=' + psectionId + '&ptype_id=' + ptypeId; + }, + キャンセル: function () { } + } + }); +}); + +$(document).on('click', '.btn-contract', function (e) { + e.preventDefault(); + var parkId = $(this).data('park-id'); + var psectionId = $(this).data('psection-id'); + var ptypeId = $(this).data('ptype-id'); + + $.confirm({ + title: '確認', + content: 'こちらの駐輪場で定期契約を申し込みますか?', + buttons: { + OK: function () { + // GETパラメータでregulationCheckメソッドに遷移 + location.href = '/regular-contract/regulationCheck?park_id=' + parkId + '&psection_id=' + psectionId + '&ptype_id=' + ptypeId; + }, + キャンセル: function () { } + } + }); +}); diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index a02655b..6aed38d 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -46,18 +46,12 @@ {{-- フッター --}} @include('partials.footer') - - + - - - + @yield('scripts') diff --git a/resources/views/partials/paging.blade.php b/resources/views/partials/paging.blade.php new file mode 100644 index 0000000..8d1350d --- /dev/null +++ b/resources/views/partials/paging.blade.php @@ -0,0 +1,35 @@ +@if ($paginator->hasPages()) + +@endif \ No newline at end of file diff --git a/resources/views/regular_contract/create.blade.php b/resources/views/regular_contract/create.blade.php new file mode 100644 index 0000000..662276b --- /dev/null +++ b/resources/views/regular_contract/create.blade.php @@ -0,0 +1,184 @@ +@extends('layouts.app') +@section('content') +
+
+

新規定期契約 > 空き駐輪場を確認する

+
+
+
+
+
+
+
駐輪場をお選びください。
+
+
+
+
+
+
+
市町村名
+
+ +
+
駅名
+
+ +
+
駐輪場名
+
+ +
+
+
+
+ + + + + + + + + + + + + + @forelse($parks_table as $row) + + + + + {{-- 自転車・原付・自動二輪・自動車列 --}} + @foreach(['自転車', '原付', '自動二輪', '自動車'] as $vehicle) + + @endforeach + + @empty + + + + @endforelse + +
+ 駐輪場名 + + + + 市町村名 + + + + 駅名 + + + 自転車原付自動二輪自動車
+ {{ $row->park_name }} + {{ $row->city_name }}{{ $row->station_neighbor_station }} + @php + $zonesForType = ($zones[$row->park_id] ?? collect())->where('psection_subject', $vehicle); + @endphp + @forelse ($zonesForType as $zone) + @php + $reserveCount = ($reserve[$row->park_id] ?? collect()) + ->where('psection_id', $zone->psection_id) + ->count(); + $vacancy = $zone->zone_tolerance - $zone->zone_number - $reserveCount; + // 猶予期間判定 + $grace = $city_grace_periods[$row->city_id] ?? null; + $now = \Carbon\Carbon::now(); + $inGrace = false; + if ($grace && $grace->update_grace_period_start_date && $grace->update_grace_period_start_time && $grace->update_grace_period_end_date && $grace->update_grace_period_end_time) { + $year = $now->year; + $month = $now->month; + $startDay = (int)$grace->update_grace_period_start_date; + $endDay = (int)$grace->update_grace_period_end_date; + if ($startDay > $endDay) { + // 月またぎ + // 前月の開始日~今月の終了日 + $prevMonth = $now->copy()->subMonth(); + $startPrev = \Carbon\Carbon::createFromFormat('Y-m-d H:i', sprintf('%04d-%02d-%02d %s', $prevMonth->year, $prevMonth->month, $startDay, $grace->update_grace_period_start_time)); + $endCurr = \Carbon\Carbon::createFromFormat('Y-m-d H:i', sprintf('%04d-%02d-%02d %s', $year, $month, $endDay, $grace->update_grace_period_end_time)); + // 今月の開始日~翌月の終了日 + $startCurr = \Carbon\Carbon::createFromFormat('Y-m-d H:i', sprintf('%04d-%02d-%02d %s', $year, $month, $startDay, $grace->update_grace_period_start_time)); + $nextMonth = $month == 12 ? 1 : $month + 1; + $nextYear = $month == 12 ? $year + 1 : $year; + $endNext = \Carbon\Carbon::createFromFormat('Y-m-d H:i', sprintf('%04d-%02d-%02d %s', $nextYear, $nextMonth, $endDay, $grace->update_grace_period_end_time)); + $inGrace = $now->between($startPrev, $endCurr) || $now->between($startCurr, $endNext); + } else { + // 同月 + $start = \Carbon\Carbon::createFromFormat('Y-m-d H:i', sprintf('%04d-%02d-%02d %s', $year, $month, $startDay, $grace->update_grace_period_start_time)); + $end = \Carbon\Carbon::createFromFormat('Y-m-d H:i', sprintf('%04d-%02d-%02d %s', $year, $month, $endDay, $grace->update_grace_period_end_time)); + $inGrace = $now->between($start, $end); + } + } + @endphp + @if ($vacancy > 0 && $inGrace) + + @elseif ($vacancy > 0 && !$inGrace) + + @else + + @endif + @empty + + @endforelse +
該当する駐輪場はありません。
+ + @php + $totalPages = ceil($parks_table_total / $parks_table_perPage); + $currentPage = $parks_table_page; + @endphp + + +
+
+
+
+
+
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/regular_contract/create_confirm.blade.php b/resources/views/regular_contract/create_confirm.blade.php new file mode 100644 index 0000000..e41c083 --- /dev/null +++ b/resources/views/regular_contract/create_confirm.blade.php @@ -0,0 +1,157 @@ +@extends('layouts.app') +@section('content') +
+
+

新規定期契約 > 入力内容の確認

+
+
+

ご入力内容をご確認ください。

+
+ @csrf + +
+ +
+ +
+ @if(isset($user->photo_filename2) && $user->photo_filename2 !== '') + + @endif +
+ +
+ +
+
+

{{ $park->park_name }}

+
+ +
+ +
+
+

{{ $psection->psection_subject }}

+
+ +
+ +
+
+

{{ $user->user_name }}

+
+ + @if (!empty($park->gender_display_flag) && $park->gender_display_flag == 1) +
+ +
+
+

{{ $user->user_gender }}

+
+ @endif + +
+ +
+
+

+ @php + $pre = $user->user_regident_pre; + $city = $user->user_regident_city; + $add = $user->user_regident_add; + @endphp + {{ $pre }}{{ $city }}{{ $add }} +

+
+ + @if (!empty($park->bd_display_flag) && $park->bd_display_flag == 1) +
+ +
+
+

+ @if(!empty($user->user_birthdate)) + {{ \Carbon\Carbon::parse($user->user_birthdate)->format('Y年m月d日') }} + @endif +

+
+ @endif + +
+ +
+
+

+ {{ $user->user_homephone }} +

+
+ +
+ +
+
+

+ {{ $user->user_mobile }} +

+
+ +
+ +
+
+

{{ $user->user_primemail }}

+
+ +
+ +
+
+

{{ $user->user_submail }}

+
+ +
+ +
+
+

{{ $usertype->usertype_subject1 }}

+
+ @if ($usertype->usertype_subject1 === '学生') + +
+ +
+
+

{{ $user->user_school }}

+
+ @else + +
+ +
+
+

{{ $user->user_workplace }}

+
+ @endif + +
+ +
+
+

+ @php + $pre = $user->user_relate_pre ?? ''; + $city = $user->user_relate_city ?? ''; + $add = $user->user_relate_add ?? ''; + @endphp + {{ $pre }}{{ $city }}{{ $add }} +

+
+
+ +
+ +
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/regular_contract/create_idcard_checking.blade.php b/resources/views/regular_contract/create_idcard_checking.blade.php new file mode 100644 index 0000000..0e83223 --- /dev/null +++ b/resources/views/regular_contract/create_idcard_checking.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
+
+

新規定期契約 > 本人確認書類確認中

+
+
+
+

ただいま書類確認中です。

+
+
+

+ ご利用者本人確認に最大3営業日お時間を頂戴したく存じます。
+ 完了次第、メールにてご連絡いたしますので、しばらくお待ちください。

+

+
+ + +
+
+@endsection \ No newline at end of file diff --git a/resources/views/regular_contract/create_select_period.blade.php b/resources/views/regular_contract/create_select_period.blade.php new file mode 100644 index 0000000..8b3064f --- /dev/null +++ b/resources/views/regular_contract/create_select_period.blade.php @@ -0,0 +1,81 @@ +@extends('layouts.app') +@section('content') +
+
+

新規定期契約 > 契約期間を選択する

+
+
+ @if ($errors->has('month')) +
+ {{ $errors->first('month') }} +
+ @endif +
+ @csrf + +
+

契約期間を選択してください。

+
+ @if ($regular_type->regular_class_1 == 1) +
+ + + + + {{ optional($prices->where('price_month', 1)->first())->price ? number_format(optional($prices->where('price_month', 1)->first())->price) . '円' : '価格未設定' }} + +
+ @endif + @if ($regular_type->regular_class_2 == 1) +
+ + + + + {{ optional($prices->where('price_month', 2)->first())->price ? number_format(optional($prices->where('price_month', 2)->first())->price) . '円' : '価格未設定' }} + +
+ @endif + @if ($regular_type->regular_class_3 == 1) +
+ + + + + {{ optional($prices->where('price_month', 3)->first())->price ? number_format(optional($prices->where('price_month', 3)->first())->price) . '円' : '価格未設定' }} + +
+ @endif + @if ($regular_type->regular_class_6 == 1) +
+ + + + + {{ optional($prices->where('price_month', 6)->first())->price ? number_format(optional($prices->where('price_month', 6)->first())->price) . '円' : '価格未設定' }} + +
+ @endif + @if ($regular_type->regular_class_12 == 1) +
+ + + + + {{ optional($prices->where('price_month', 12)->first())->price ? number_format(optional($prices->where('price_month', 12)->first())->price) . '円' : '価格未設定' }} + +
+ @endif +
+
+
+ +
+ + +
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/regular_contract/input.blade.php b/resources/views/regular_contract/input.blade.php new file mode 100644 index 0000000..f970ea8 --- /dev/null +++ b/resources/views/regular_contract/input.blade.php @@ -0,0 +1,478 @@ +@extends('layouts.app') + +@section('content') +
+ + +
+

新規定期契約 > 情報を入力する

+
+
+ {{-- サーバーサイドエラー表示 --}} + @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif +
+ @csrf + + + + {{-- お名前(編集不可) --}} +
+ +
+
+ {{ $user->user_name }} +
+ {{-- フリガナ --}} +
+ +
+
+ +
+ {{-- 性別(駐輪場マスタの設定により表示/非表示) --}} + @if (!empty($park->gender_display_flag) && $park->gender_display_flag == 1) +
+ +
+
+ +
+ @endif + {{-- 居住所 --}} +
+ +
+
+ - +
+
+
+ +
+ {{-- 生年月日 --}} + @if (!empty($park->bd_display_flag) && $park->bd_display_flag == 1) +
+ +
+
+ +
+ {{-- 年齢(自動計算 かつ 表示のみ) --}} +
+ +
+
+ +
+ @endif + {{-- 自宅電話番号 --}} +
+ +
+
+ + - + + - + +
+ {{-- 携帯電話番号 --}} +
+ +
+
+ + - + + - + +
+ {{-- メールアドレス --}} +
+ +
+
+ +
+ {{-- 予備メールアドレス --}} +
+ +
+
+ +
+ {{-- 利用者区分 --}} +
+ + +
+
+
+ + +
+
+ + +
+
+ {{-- 減免 --}} +
+ + +
+
+
+ + +
+
+ + +
+
+ {{-- 勤務先名(一般のみ表示) --}} +
+ +
+
+ +
+ {{-- 学校名(学生のみ表示) --}} +
+ +
+
+ +
+ {{-- 卒業予定(学生のみ表示) --}} +
+ +
+
+ +
+ {{-- 住所(関連) --}} +
+ +
+
+ - +
+ + + +
+ {{-- 防犯登録番号 --}} + @if (!empty($park->securityreg_display_flag) && $park->securityreg_display_flag == 1) +
+ +
+
+ +
+ @endif + {{-- 確認ボタン --}} +
+ +
+ +
+
+ {{-- 利用者区分説明モーダル --}} + + @php + $showTerms = old('show_terms_modal', session('show_terms_modal', $show_terms_modal ?? true)); + @endphp + +
+ +@endsection \ No newline at end of file diff --git a/resources/views/regular_contract/park_detail.blade.php b/resources/views/regular_contract/park_detail.blade.php new file mode 100644 index 0000000..ac46287 --- /dev/null +++ b/resources/views/regular_contract/park_detail.blade.php @@ -0,0 +1,109 @@ + + + + + \ No newline at end of file diff --git a/resources/views/regular_contract/regulation.blade.php b/resources/views/regular_contract/regulation.blade.php new file mode 100644 index 0000000..fa2342d --- /dev/null +++ b/resources/views/regular_contract/regulation.blade.php @@ -0,0 +1,62 @@ +@extends('layouts.app') +@section('content') +
+
+

新規定期契約 > 利用可能な車種の確認

+
+
+
+ @csrf + + + +
+
駐輪場名:{{ $park_name }} +
+

+

車両区分:{{ $psection_subject }}
+

+

+

駐輪分類:{{ $ptype_subject }}
+

+

+
{{ $regulations_text }} +

+
+ + +
+
+ +
+ +
+ +
+ +
+
+@endsection \ No newline at end of file diff --git a/resources/views/regular_contract/upload_identity_create.blade.php b/resources/views/regular_contract/upload_identity_create.blade.php new file mode 100644 index 0000000..957e11e --- /dev/null +++ b/resources/views/regular_contract/upload_identity_create.blade.php @@ -0,0 +1,72 @@ +@extends('layouts.app') +@section('content') +
+
+

新規定期契約 >本人確認書類のアップロード

+
+ @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif +
+
+ @csrf + + + +
+

下記のいずれかの写真をアップロードしてください。

+

+ 免許証・旅券(パスポート)・在留カード・特別永住者証明書
+ 外国人登録証明書(特別永住者のみ)・学生証
+ 身体障害者手帳・生活保護受給者証・保険証

+ 上記いずれかの住所記載のあるもの
+ ※特別永住者の方は特別永住者証明書と外国人登録証明書の両方が必要となります。 +

+
+
+

ご注意ください

+

+ ご入力の内容で、本人確認を行います。本人確認書類の内容によってはお時間を頂く場合がございます。
+ その場合は、メールにてご連絡いたしますので、しばらくお待ちください。 +

+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ おもて* +
+ ウ ラ* + +
+
+ +
+ +
+
+
+@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index bced782..650023e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -21,6 +21,7 @@ use App\Http\Controllers\RegularContractCreateController; use App\Http\Controllers\ParkingSearchController; use App\Http\Controllers\ParkWaitlistController; use App\Http\Controllers\ReceiptController; +use App\Http\Controllers\ParkDetailController; // 画面遷移のみ Route::get('/', function () { return view('general.swo1_1'); })->name('swo1_1'); @@ -67,7 +68,7 @@ Route::get('/login', function () { // マイページ画面へのリダイレクト Route::get('/mypage', function () { return 'マイページ(仮)'; -})->name('mypage'); +})->name('mypage'); // ユーザー情報確認画面 Route::get('/user/info', [UserInfoController::class, 'show']) @@ -114,7 +115,20 @@ Route::post('receipt/issue/{contract_id}', [ReceiptController::class, 'issue']); // 新規定期契約画面 Route::get('regular_contract/create', [RegularContractCreateController::class, 'show']) ->name('regular_contract.create'); +Route::get('/api/park-detail/{park_id}', [ParkDetailController::class, 'show']); +Route::get('/regular-contract/regulationCheck', [RegularContractCreateController::class, 'regulationCheck']); +Route::get('/regular-contract/regulation', [RegularContractCreateController::class, 'showRegulation']) + ->name('regular_contract.regulation'); +Route::post('/regular-contract/insertRegulation', [RegularContractCreateController::class, 'insertRegulation']); +Route::get('/regular-contract/input', [RegularContractCreateController::class, 'showContractForm'])->name('regular_contract.input'); +Route::post('/regular_contract/input/check', [RegularContractCreateController::class, 'inputCheck'])->name('regular_contract.input.check'); +Route::get('/regular-contract/upload_identity_create', [RegularContractCreateController::class, 'showUploadIdentityCreate'])->name('regular_contract.upload_identity_create'); +Route::post('regular_contract/confirm_upload_identity/{contract_id}', [RegularContractCreateController::class, 'confirmUploadIdentity'])->name('regular_contract.confirm_upload_identity'); +Route::get('regular_contract/create_confirm', [RegularContractCreateController::class, 'createConfirm'])->name('regular_contract.create_confirm'); +Route::post('/regular_contract/create_confirm_next/{contract_id}', [RegularContractCreateController::class, 'createConfirmNext'])->name('regular_contract.create_confirm_next'); +Route::post('regular_contract/create_select_period', [RegularContractCreateController::class, 'selectPeriod']) + ->name('regular_contract.create_select_period'); // 定期契約更新 Route::get('regular_contract/update', [RegularContractController::class, 'showInfo']) ->name('regular_contract.update'); @@ -133,7 +147,7 @@ Route::post('regular_contract/upload_identity/{contract_id}', [RegularContractCo // 利用期間選択 Route::get('regular_contract/select_period/{contract_id}', [RegularContractController::class, 'selectPeriod']) ->name('regular_contract.select_period'); -Route::post('regular_contract/update_period', [App\Http\Controllers\RegularContractController::class, 'updatePeriod']) +Route::post('regular_contract/update_period', [RegularContractController::class, 'updatePeriod']) ->name('regular_contract.update_period'); // 定期契約履歴 -- 2.47.3