krgm.so-manager-dev.com/resources/views/admin/users/add.blade.php
你的名字 a17960f61c
All checks were successful
Deploy main / deploy (push) Successful in 22s
【利用者マスタ】共通取り込み
2025-10-30 16:29:14 +09:00

578 lines
25 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.app')
@section('title', '利用者マスタ|新規')
@section('content')
{{-- パンくず --}}
<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>
<div class="col-lg-6">
<ol class="breadcrumb float-sm-right text-sm">
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
<li class="breadcrumb-item"><a href="{{ route('users') }}">利用者マスタ</a></li>
<li class="breadcrumb-item active">新規</li>
</ol>
</div>
</div>
</div>
</div>
<section class="content">
<div class="container-fluid">
{{-- 成功/エラー表示 --}}
@if ($errors->any())
<div class="alert alert-danger">
<ul class="mb-0">
@foreach ($errors->all() as $e)
<li>{{ $e }}</li>
@endforeach
</ul>
</div>
@endif
<form method="post" action="{{ route('users_add') }}" enctype="multipart/form-data">
@csrf
<div class="card">
<div class="card-header">
<h3 class="card-title">基本情報</h3>
</div>
<div class="card-body">
{{-- 1列レイアウト(ラベル左 / 入力右) --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">会員ID <span class="text-danger">*</span></label>
<div class="col-md-10">
<input type="text" name="user_id" value="{{ old('user_id') }}" class="form-control"
placeholder="会員ID">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">パスワード</label>
<div class="col-md-10">
<input type="password" name="user_pass" class="form-control"
placeholder="パスワード">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">パスワード確認</label>
<div class="col-md-10">
<input type="password" name="user_pass_confirmation" class="form-control" autocomplete="new-password"
placeholder="パスワード確認">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">
手動登録フラグ <span class="text-danger">*</span>
</label>
<div class="col-md-10 d-flex align-items-center">
<div class="form-check mr-3">
<input
class="form-check-input"
type="radio"
name="user_manual_regist_flag"
id="user_manual_regist_flag_1"
value="1"
{{ old('user_manual_regist_flag', '0') == '1' ? 'checked' : '' }}
>
<label for="user_manual_regist_flag_1" class="form-check-label">はい</label>
</div>
<div class="form-check">
<input
class="form-check-input"
type="radio"
name="user_manual_regist_flag"
id="user_manual_regist_flag_0"
value="0"
{{ old('user_manual_regist_flag', '0') == '0' ? 'checked' : '' }}
>
<label for="user_manual_regist_flag_0" class="form-check-label">いいえ</label>
</div>
</div>
{{-- バリデーションエラー表示(任意) --}}
@error('user_manual_regist_flag')
<div class="col-md-10 offset-md-2">
<small class="text-danger">{{ $message }}</small>
</div>
@enderror
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">
郵送必要フラグ <span class="text-danger">*</span>
</label>
<div class="col-md-10 d-flex align-items-center">
<div class="form-check mr-3">
<input
class="form-check-input"
type="radio"
name="user_mailing_flag"
id="user_mailing_flag_1"
value="1"
{{ old('user_mailing_flag', '0') == '1' ? 'checked' : '' }}
>
<label for="user_mailing_flag_1" class="form-check-label">はい</label>
</div>
<div class="form-check">
<input
class="form-check-input"
type="radio"
name="user_mailing_flag"
id="user_mailing_flag_0"
value="0"
{{ old('user_mailing_flag', '0') == '0' ? 'checked' : '' }}
>
<label for="user_mailing_flag_0" class="form-check-label">いいえ</label>
</div>
</div>
{{-- バリデーションエラー表示(任意) --}}
@error('user_mailing_flag')
<div class="col-md-10 offset-md-2">
<small class="text-danger">{{ $message }}</small>
</div>
@enderror
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">旧定期契約番号</label>
<div class="col-md-10">
<input type="text" name="user_tag_serial" value="{{ old('user_tag_serial') }}" class="form-control"
placeholder="旧定期契約番号">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">タグシリアル</label>
<div class="col-md-10">
<input type="text" name="user_tag_serial" value="{{ old('user_tag_serial') }}" class="form-control"
placeholder="タグシリアル">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">タグシリアル(64)</label>
<div class="col-md-10">
<input type="text" name="user_tag_serial_64" value="{{ old('user_tag_serial_64') }}" class="form-control"
placeholder="タグシリアル(64)">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">QRコード</label>
<div class="col-md-10">
<input type="text" name="qr_code" value="{{ old('qr_code') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">タグ/QRフラグ<span class="text-danger">*</span></label>
<div class="col-md-10 d-flex align-items-center">
<div class="form-check mr-3">
<input class="form-check-input" type="radio" name="tag_qr_flag" id="tag_qr_tag" value="0" {{ old('tag_qr_flag', '0') == '0' ? 'checked' : '' }}>
<label for="tag_qr_tag" class="form-check-label">QR</label>
</div>
<div class="form-check mr-3">
<input class="form-check-input" type="radio" name="tag_qr_flag" id="tag_qr_qr" value="1" {{ old('tag_qr_flag', '0') == '1' ? 'checked' : '' }}>
<label for="tag_qr_qr" class="form-check-label">タグ</label>
</div>
</div>
</div>
{{-- AID / 設置場所QR --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">AID</label>
<div class="col-md-10">
<input type="text" name="user_aid" value="{{ old('user_aid') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">居場所通知用QRID</label>
<div class="col-md-10">
<input type="text" name="user_place_qrid" value="{{ old('user_place_qrid') }}" class="form-control">
</div>
</div>
{{-- 利用者属性 --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">利用者分類ID</label>
<div class="col-md-10">
<input type="text" name="user_categoryid" value="{{ old('user_categoryid') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">利用者名 <span class="text-danger">*</span></label>
<div class="col-md-10">
<input type="text" name="user_name" value="{{ old('user_name') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">フリガナ</label>
<div class="col-md-10">
<input type="text" name="user_phonetic" value="{{ old('user_phonetic') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">性別</label>
<div class="col-md-10">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="user_gender" id="gender_male" value="男性" {{ old('user_gender') == '男性' ? 'checked' : '' }}>
<label class="form-check-label" for="gender_male">男性</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="user_gender" id="gender_female" value="女性" {{ old('user_gender') == '女性' ? 'checked' : '' }}>
<label class="form-check-label" for="gender_female">女性</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="user_gender" id="gender_unknown" value="未入力" {{ old('user_gender') == '未入力' ? 'checked' : '' }}>
<label class="form-check-label" for="gender_unknown">未入力</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">生年月日</label>
<div class="col-md-4">
<input type="date" name="user_birthdate" value="{{ old('user_birthdate') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">年齢</label>
<div class="col-md-4">
<input type="number" name="user_age" value="{{ old('user_age') }}" class="form-control">
</div>
</div>
{{-- 連絡先 --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">自宅電話番号</label>
<div class="col-md-10">
<input type="text" name="user_homephone" value="{{ old('user_homephone') }}" class="form-control"
placeholder="000-0000-0000">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">携帯電話番号</label>
<div class="col-md-10">
<input type="text" name="user_mobile" value="{{ old('user_mobile') }}" class="form-control"
placeholder="080-0000-0000">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">メールアドレス</label>
<div class="col-md-10">
<input type="email" name="user_primemail" value="{{ old('user_primemail') }}" class="form-control"
placeholder="name@example.com">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">予備メールアドレス</label>
<div class="col-md-10">
<input type="email" name="user_submail" value="{{ old('user_submail') }}" class="form-control"
placeholder="name@example.com">
</div>
</div>
{{-- 居住所 --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">居住所:郵便番号</label>
<div class="col-md-10">
<input type="text" name="user_regident_zip" value="{{ old('user_regident_zip') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">居住所:都道府県</label>
<div class="col-md-10">
<input type="text" name="user_regident_pre" value="{{ old('user_regident_pre') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">居住所:市区町村</label>
<div class="col-md-10">
<input type="text" name="user_regident_city" value="{{ old('user_regident_city') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">居住所:住所</label>
<div class="col-md-10">
<input type="text" name="user_regident_add" value="{{ old('user_regident_add') }}" class="form-control">
</div>
</div>
{{-- 関連住所 --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">関連住所:郵便番号</label>
<div class="col-md-10">
<input type="text" name="user_relate_zip" value="{{ old('user_relate_zip') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">関連住所:都道府県</label>
<div class="col-md-10">
<input type="text" name="user_relate_pre" value="{{ old('user_relate_pre') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">関連住所:市区町村</label>
<div class="col-md-10">
<input type="text" name="user_relate_city" value="{{ old('user_relate_city') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">関連住所:住所</label>
<div class="col-md-10">
<input type="text" name="user_relate_add" value="{{ old('user_relate_add') }}" class="form-control">
</div>
</div>
{{-- その他属性 --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">区民</label>
<div class="col-md-10">
<input type="text" name="ward_residents" value="{{ old('ward_residents') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">勤務先</label>
<div class="col-md-10">
<input type="text" name="user_workplace" value="{{ old('user_workplace') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">学校</label>
<div class="col-md-10">
<input type="text" name="user_school" value="{{ old('user_school') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">卒業予定</label>
<div class="col-md-10">
<input type="date" name="user_graduate" value="{{ old('user_graduate') }}" class="form-control">
</div>
</div>
{{-- 本人確認 --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">本人確認書類</label>
<div class="col-md-10">
<input type="text" name="user_idcard" value="{{ old('user_idcard') }}" class="form-control"
placeholder="運転免許証 など">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">
本人確認チェック済 <span class="text-danger">*</span>
</label>
<div class="col-md-10">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio"
name="user_idcard_chk_flag" id="chk_none" value="0"
{{ old('user_idcard_chk_flag','0')=='0' ? 'checked' : '' }}>
<label class="form-check-label" for="chk_none">未チェック</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio"
name="user_idcard_chk_flag" id="chk_auto_ok" value="1"
{{ old('user_idcard_chk_flag')=='1' ? 'checked' : '' }}>
<label class="form-check-label" for="chk_auto_ok">自動チェックOK</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio"
name="user_idcard_chk_flag" id="chk_manual_ok" value="2"
{{ old('user_idcard_chk_flag')=='2' ? 'checked' : '' }}>
<label class="form-check-label" for="chk_manual_ok">手動チェックOK</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio"
name="user_idcard_chk_flag" id="chk_manual_ng" value="3"
{{ old('user_idcard_chk_flag')=='3' ? 'checked' : '' }}>
<label class="form-check-label" for="chk_manual_ng">手動チェックNG</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio"
name="user_idcard_chk_flag" id="chk_auto_ng" value="4"
{{ old('user_idcard_chk_flag')=='4' ? 'checked' : '' }}>
<label class="form-check-label" for="chk_auto_ng">自動チェックNG</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">本人確認日時</label>
<div class="col-md-10">
<input type="date" name="user_chk_day" value="{{ old('user_chk_day') }}" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">本人確認オペレータID</label>
<div class="col-md-10">
<input type="text" name="user_chk_opeid" value="{{ old('user_chk_opeid') }}" class="form-control">
</div>
</div>
{{-- タグ発行 / 発行可否 / 退会 --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">タグ発行数</label>
<div class="col-md-10">
<input type="number" name="user_tag_issue" value="{{ old('user_tag_issue') }}" class="form-control">
</div>
</div>
<!-- タグ発行許可 -->
<div class="form-group row">
<label class="col-md-2 col-form-label">
タグ発行許可 <span class="text-danger">*</span>
</label>
<div class="col-md-10 d-flex flex-wrap">
<!-- 発行可 -->
<div class="form-check mr-3">
<!-- old の既定値は '0'= 発行不可) -->
<input class="form-check-input" type="radio"
name="issue_permission" id="issue_perm_yes" value="1"
{{ old('issue_permission') == '1' ? 'checked' : '' }}>
<label class="form-check-label" for="issue_perm_yes">発行許可</label>
</div>
<!-- 発行不可 -->
<div class="form-check mr-3">
<input class="form-check-input" type="radio"
name="issue_permission" id="issue_perm_no" value="0"
{{ old('issue_permission','0') == '0' ? 'checked' : '' }}>
<label class="form-check-label" for="issue_perm_no">発行済</label>
</div>
</div>
</div>
<!-- 退会フラグ -->
<div class="form-group row">
<label class="col-md-2 col-form-label">
退会フラグ <span class="text-danger">*</span>
</label>
<div class="col-md-10 d-flex flex-wrap">
<!-- はい(= 退会済) -->
<div class="form-check mr-3">
<input class="form-check-input" type="radio"
name="user_quit_flag" id="quit_yes" value="1"
{{ old('user_quit_flag') == '1' ? 'checked' : '' }}>
<label class="form-check-label" for="quit_yes">はい</label>
</div>
<!-- いいえ(= 現在利用中) -->
<div class="form-check mr-3">
<input class="form-check-input" type="radio"
name="user_quit_flag" id="quit_no" value="0"
{{ old('user_quit_flag','0') == '0' ? 'checked' : '' }}>
<label class="form-check-label" for="quit_no">いいえ</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">退会日</label>
<div class="col-md-10">
<input type="date" name="user_quitday" value="{{ old('user_quitday') }}" class="form-control">
</div>
</div>
{{-- 本人確認写真(ダミー:実装は後日) --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">本人確認写真ファイル1</label>
<div class="col-md-10">
<input type="file" name="id_photo1" class="form-control-file">
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">本人確認写真ファイル2</label>
<div class="col-md-10">
<input type="file" name="id_photo2" class="form-control-file">
</div>
</div>
{{-- 備考 --}}
<div class="form-group row">
<label class="col-md-2 col-form-label">備考</label>
<div class="col-md-10">
<textarea name="user_remarks" rows="4" class="form-control">{{ old('user_remarks') }}</textarea>
</div>
</div>
<button type="submit" class="btn btn-success register">登録</button>
<a href="{{ route('users') }}" class="btn btn-secondary ml-2">戻る</a>
</div>
</div>
</form>
</div>
</section>
<script>
/**
* 登録ボタン押下時の確認ダイアログ表示処理
* 対象のフォーム送信を一時停止し、ユーザーに確認メッセージを表示する
*/
$(document).on('click', '.register', function (e) {
e.preventDefault(); // デフォルトの送信動作を一旦停止
const $form = $(this).closest('form'); // 押下されたボタンが属するフォームを取得
$.confirm({
title: '確認ダイアログ',
content: '登録してよろしいですか?',
buttons: {
ok: {
text: 'はい',
btnClass: 'btn-primary',
keys: ['enter'],
/**
* 「はい」ボタン押下時の処理
* 対象フォームを送信
*/
action: function () {
$form.trigger('submit'); // 対象フォームのみ送信
}
},
/**
* 「いいえ」ボタン押下時の処理
* 何も実行せずダイアログを閉じる
*/
いいえ: function () {}
}
});
});
</script>
{{-- 見た目の微調整(間隔を広げる) --}}
<style>
.card .form-group {
margin-bottom: .85rem;
}
</style>
@endsection