市区マスタ関連のビューファイルを修正
This commit is contained in:
parent
43be1d5ba7
commit
f850707848
@ -1,53 +0,0 @@
|
|||||||
@php
|
|
||||||
$city = $city ?? null;
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
<div class="rv-city-form-fields">
|
|
||||||
<div class="form-group row rv-city-field align-items-center">
|
|
||||||
<div class="form-group col-12 col-md-3 mb-2 mb-md-0">
|
|
||||||
<label for="city_name" class="col-form-label fw-semibold rv-city-label mb-0">
|
|
||||||
{{ __('市区名') }}<span class="text-danger">*</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-12 col-md-9 mb-0">
|
|
||||||
<input type="text" name="city_name" id="city_name" class="form-control"
|
|
||||||
value="{{ old('city_name', optional($city)->city_name) }}" maxlength="50" placeholder="市区名">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group row rv-city-field align-items-center">
|
|
||||||
<div class="form-group col-12 col-md-3 mb-2 mb-md-0">
|
|
||||||
<label for="print_layout" class="col-form-label fw-semibold rv-city-label mb-0">
|
|
||||||
{{ __('印字レイアウトファイル') }}<span class="text-danger">*</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-12 col-md-9 mb-0">
|
|
||||||
<input type="text" name="print_layout" id="print_layout" class="form-control"
|
|
||||||
value="{{ old('print_layout', optional($city)->print_layout) }}" maxlength="100" placeholder="印字レイアウトファイル">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group row rv-city-field align-items-center">
|
|
||||||
<div class="form-group col-12 col-md-3 mb-2 mb-md-0">
|
|
||||||
<label for="city_user" class="col-form-label fw-semibold rv-city-label mb-0">
|
|
||||||
{{ __('顧客M入力不要フィールドID') }}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-12 col-md-9 mb-0">
|
|
||||||
<input type="text" name="city_user" id="city_user" class="form-control"
|
|
||||||
value="{{ old('city_user', optional($city)->city_user) }}" maxlength="50" placeholder="顧客M入力不要フィールドID">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group row rv-city-field align-items-center">
|
|
||||||
<div class="form-group col-12 col-md-3 mb-2 mb-md-0">
|
|
||||||
<label for="city_remarks" class="col-form-label fw-semibold rv-city-label mb-0">
|
|
||||||
{{ __('備考') }}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-12 col-md-9 mb-0">
|
|
||||||
<textarea name="city_remarks" id="city_remarks" rows="3" class="form-control"
|
|
||||||
maxlength="200" placeholder="備考">{{ old('city_remarks', optional($city)->city_remarks) }}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,120 +0,0 @@
|
|||||||
{{-- filepath: c:\xampp82\htdocs\somanager-git_main\resources\views\admin\CityMaster\add.blade.php --}}
|
|
||||||
@extends('layouts.app')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="d-flex flex-column flex-md-row align-items-md-center justify-content-between mb-3 gap-2">
|
|
||||||
<h2 class="mb-0 fw-bold">{{ __('新規') }}</h2>
|
|
||||||
<ol class="breadcrumb float-md-right text-sm mb-0 bg-transparent">
|
|
||||||
<li class="breadcrumb-item"><a href="{{ url('/home') }}">ホーム</a></li>
|
|
||||||
<li class="breadcrumb-item"><a href="{{ route('city') }}">市区マスタ</a></li>
|
|
||||||
<li class="breadcrumb-item active">新規</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@php($errorMessages = $errorMsg ?? [])
|
|
||||||
@if(!empty($errorMessages))
|
|
||||||
<div class="alert alert-danger">
|
|
||||||
<ul class="mb-0">
|
|
||||||
@foreach($errorMessages as $message)
|
|
||||||
<li>{{ $message }}</li>
|
|
||||||
@endforeach
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="card shadow-sm">
|
|
||||||
<div class="card-header bg-white py-3 d-flex justify-content-start">
|
|
||||||
<button type="submit" form="city-form" class="btn btn-lg btn-default mr-2 register">{{ __('登録') }}</button>
|
|
||||||
</div>
|
|
||||||
<div class="card-body py-4">
|
|
||||||
<form id="city-form" class="city-form" method="POST" action="{{ route('city_add') }}">
|
|
||||||
@csrf
|
|
||||||
|
|
||||||
@include('admin.CityMaster._form', ['isEdit' => 0, 'isInfo' => 0])
|
|
||||||
|
|
||||||
<div class="d-flex flex-column flex-md-row align-items-md-center gap-3 mt-4">
|
|
||||||
<button type="submit" class="btn btn-lg btn-default mr-2 register">{{ __('登録') }}</button>
|
|
||||||
<a href="{{ route('city') }}" class="btn btn-lg btn-default">{{ __('戻る') }}</a>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@push('styles')
|
|
||||||
<style>
|
|
||||||
.city-form .form-group {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 1.5rem;
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
}
|
|
||||||
.city-form .form-group .form-label {
|
|
||||||
flex: 0 0 180px;
|
|
||||||
margin-bottom: 0;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.city-form .form-group .form-control {
|
|
||||||
flex: 1 1 auto;
|
|
||||||
}
|
|
||||||
@media (max-width: 767.98px) {
|
|
||||||
.city-form .form-group {
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: stretch;
|
|
||||||
}
|
|
||||||
.city-form .form-group .form-label {
|
|
||||||
flex: none;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@endpush
|
|
||||||
|
|
||||||
@push('scripts')
|
|
||||||
<script>
|
|
||||||
(function ($) {
|
|
||||||
$(function () {
|
|
||||||
var validationErrors = @json($errorMessages);
|
|
||||||
if (validationErrors.length) {
|
|
||||||
var message = validationErrors.join('\n');
|
|
||||||
if ($.alert) {
|
|
||||||
$.alert({ title: 'エラー', content: message });
|
|
||||||
} else {
|
|
||||||
window.alert(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.register').off('click.cityConfirm').on('click.cityConfirm', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
const formId = this.getAttribute('form');
|
|
||||||
const $form = formId ? $('#' + formId) : $('#city-form');
|
|
||||||
if (!$form.length) { return; }
|
|
||||||
|
|
||||||
const submit = function () {
|
|
||||||
if (typeof $form[0].requestSubmit === 'function') {
|
|
||||||
$form[0].requestSubmit();
|
|
||||||
} else {
|
|
||||||
$form.trigger('submit');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($.confirm) {
|
|
||||||
$.confirm({
|
|
||||||
title: '確認ダイアログ',
|
|
||||||
content: '登録してよろしいですか? はい/いいえ',
|
|
||||||
buttons: {
|
|
||||||
ok: { text: 'はい', btnClass: 'btn-primary', action: submit },
|
|
||||||
いいえ: function () {}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (window.confirm('登録してよろしいですか?')) {
|
|
||||||
submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})(window.jQuery);
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
@extends('layouts.app')
|
|
||||||
|
|
||||||
@section('title', '市区マスタ編集')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
<section class="content">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
||||||
<h3 class="mb-0">編集</h3>
|
|
||||||
<ol class="breadcrumb float-sm-right text-sm mb-0" style="background: #f8f9fa;">
|
|
||||||
<li class="breadcrumb-item"><a href="{{ url('/home') }}">ホーム</a></li>
|
|
||||||
<li class="breadcrumb-item"><a href="{{ route('city') }}">市区マスタ</a></li>
|
|
||||||
<li class="breadcrumb-item active">編集</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@includeIf('common.flash')
|
|
||||||
|
|
||||||
<div class="card shadow mb-4">
|
|
||||||
<div class="card-body">
|
|
||||||
<form method="POST" action="{{ route('city_edit', ['id' => $city->city_id]) }}" enctype="multipart/form-data">
|
|
||||||
@csrf
|
|
||||||
@method('POST')
|
|
||||||
|
|
||||||
@include('admin.CityMaster._form', [
|
|
||||||
'isEdit' => 1,
|
|
||||||
'isInfo' => 0,
|
|
||||||
'city' => $city,
|
|
||||||
])
|
|
||||||
|
|
||||||
<div class="mt-3">
|
|
||||||
<button type="button" class="btn btn-default register">登録</button>
|
|
||||||
<a href="{{ route('city') }}" class="btn btn-default">戻る</a>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@push('scripts')
|
|
||||||
<script>
|
|
||||||
(function ($) {
|
|
||||||
$(function () {
|
|
||||||
var $form = $('form[action="{{ route('city_edit', ['id' => $city->city_id]) }}"]');
|
|
||||||
$('.register').off('click.cityConfirm').on('click.cityConfirm', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
if (!$form.length) { return; }
|
|
||||||
var submit = function () {
|
|
||||||
if (typeof $form[0].requestSubmit === 'function') {
|
|
||||||
$form[0].requestSubmit();
|
|
||||||
} else {
|
|
||||||
$form.trigger('submit');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if ($.confirm) {
|
|
||||||
$.confirm({
|
|
||||||
title: '確認ダイアログ',
|
|
||||||
content: '登録してよろしいですか? はい/いいえ',
|
|
||||||
buttons: {
|
|
||||||
ok: { text: 'はい', btnClass: 'btn-primary', action: submit },
|
|
||||||
いいえ: function () {}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (window.confirm('登録してよろしいですか?')) {
|
|
||||||
submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})(window.jQuery);
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
@extends('layouts.app')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
<!-- Content Header (Page header) -->
|
|
||||||
<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><!-- /.col -->
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<ol class="breadcrumb float-sm-right text-sm">
|
|
||||||
<li class="breadcrumb-item"><a href="./index2.html">XX様info(ホーム)</a></li>
|
|
||||||
<li class="breadcrumb-item"><a href="./index3.html">[東京都|〇〇駐輪場]</a></li>
|
|
||||||
<li class="breadcrumb-item">マスタ管理</li>
|
|
||||||
<li class="breadcrumb-item active">市区マスタ</li>
|
|
||||||
</ol>
|
|
||||||
</div><!-- /.col -->
|
|
||||||
</div><!-- /.row -->
|
|
||||||
</div><!-- /.container-fluid -->
|
|
||||||
</div>
|
|
||||||
<!-- /.content-header -->
|
|
||||||
|
|
||||||
<!-- Main content -->
|
|
||||||
<section class="content">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<!-- SELECT2 EXAMPLE -->
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-12">
|
|
||||||
<div class="card">
|
|
||||||
<form method="post" action="{{ route('user_edit',['seq'=>$user_seq]) }}" enctype="multipart/form-data">
|
|
||||||
<!-- TOKEN FORM -->
|
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" >
|
|
||||||
<!-- / .TOKEN FORM -->
|
|
||||||
@include('admin.users._form',['isEdit'=>0,'isInfo'=>1])
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="container-fluid mb20">
|
|
||||||
<button type="submit" class="btn btn-sm btn-default mr10">新規</button>
|
|
||||||
<button type="submit" class="btn btn-sm btn-default mr10">削除</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<!-- /.content -->
|
|
||||||
|
|
||||||
@endsection
|
|
||||||
@ -1,155 +0,0 @@
|
|||||||
@extends('layouts.app')
|
|
||||||
|
|
||||||
@section('title', '市区マスタ')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
{{-- ▼ フラッシュメッセージ --}}
|
|
||||||
@if(session('success'))
|
|
||||||
<div class="alert alert-success">{{ session('success') }}</div>
|
|
||||||
@endif
|
|
||||||
@if(session('error'))
|
|
||||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<!-- Content Header (Page header) -->
|
|
||||||
<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="{{ url('/home') }}">ホーム</a></li>
|
|
||||||
<li class="breadcrumb-item active">市区マスタ</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main content -->
|
|
||||||
<section class="content">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<form id="list-form" method="GET" action="{{ route('city') }}">
|
|
||||||
<input type="hidden" name="sort" value="{{ $sort }}">
|
|
||||||
<input type="hidden" name="sort_type" value="{{ $sort_type }}">
|
|
||||||
|
|
||||||
</form>
|
|
||||||
<div class="d-flex flex-column flex-md-row align-items-md-center justify-content-between mb-3 gap-2">
|
|
||||||
<div>
|
|
||||||
<a href="{{ route('city_add') }}" class="btn btn-sm btn-default">新規</a>
|
|
||||||
<button type="button" id="delete" class="btn btn-sm btn-default">削除</button>
|
|
||||||
</div>
|
|
||||||
@if ($list->count() > 0)
|
|
||||||
<div class="mt-2 mt-md-0 ms-md-3">
|
|
||||||
{{ $list->appends([
|
|
||||||
'sort' => $sort,
|
|
||||||
'sort_type' => $sort_type,
|
|
||||||
] + request()->except('page'))->links('pagination::bootstrap-4') }}
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if ($list->count() > 0)
|
|
||||||
<form id="form_delete" method="POST" action="{{ route('city_delete') }}">
|
|
||||||
@csrf
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-bordered table-hover">
|
|
||||||
<thead class="thead-light">
|
|
||||||
<tr>
|
|
||||||
<th><input type="checkbox" class="js-check-all"></th>
|
|
||||||
<th class="sorting{{ $sort === 'city_id' ? ($sort_type === 'asc' ? '_asc' : '_desc') : '' }}"
|
|
||||||
sort="city_id">
|
|
||||||
市区ID
|
|
||||||
|
|
||||||
@if($sort === 'city_id')
|
|
||||||
<i class="fa fa-arrow-up ms-1" style="font-size: 0.7em; color: {{ $sort && $sort_type ? 'black' : '#ccc' }}"></i>
|
|
||||||
<i class="fa fa-arrow-down ms-1" style="font-size: 0.7em; color: {{ $sort && !$sort_type ? 'black' : '#ccc' }}"></i>
|
|
||||||
@endif
|
|
||||||
</th>
|
|
||||||
<th class="sorting{{ $sort === 'city_name' ? ($sort_type === 'asc' ? '_asc' : '_desc') : '' }}"
|
|
||||||
sort="city_name">
|
|
||||||
市区名
|
|
||||||
@if($sort === 'city_name')
|
|
||||||
<i class="fa fa-arrow-up ms-1" style="font-size: 0.7em; color: {{ $sort && $sort_type ? 'black' : '#ccc' }}"></i>
|
|
||||||
<i class="fa fa-arrow-down ms-1" style="font-size: 0.7em; color: {{ $sort && !$sort_type ? 'black' : '#ccc' }}"></i>
|
|
||||||
@endif
|
|
||||||
</th>
|
|
||||||
<th>印字レイアウトファイル</th>
|
|
||||||
<th>顧客M入力不要フィールドID</th>
|
|
||||||
<th>備考</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($list as $city)
|
|
||||||
<tr>
|
|
||||||
<td style="background: #faebd7; width: 110px; padding: 0 4px;">
|
|
||||||
<input type="checkbox" name="pk[]" value="{{ $city->city_id }}">
|
|
||||||
<a href="{{ route('city_edit', ['id' => $city->city_id]) }}"
|
|
||||||
class="btn btn-sm btn-default ms-1">編集</a>
|
|
||||||
</td>
|
|
||||||
<td>{{ $city->city_id }}</td>
|
|
||||||
<td>{{ $city->city_name }}</td>
|
|
||||||
<td>{{ $city->print_layout }}</td>
|
|
||||||
<td>{{ $city->city_user }}</td>
|
|
||||||
<td>{{ $city->city_remarks }}</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
@else
|
|
||||||
<div class="alert alert-info mt-4">表示する市区データがありません。</div>
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
@endsection
|
|
||||||
|
|
||||||
@push('scripts')
|
|
||||||
<script>
|
|
||||||
(function ($) {
|
|
||||||
$(function () {
|
|
||||||
var $form = $('#form_delete');
|
|
||||||
if (!$form.length) { return; }
|
|
||||||
|
|
||||||
$(document)
|
|
||||||
.off('change.cityCheckAll', '.js-check-all')
|
|
||||||
.on('change.cityCheckAll', '.js-check-all', function () {
|
|
||||||
var checked = $(this).prop('checked');
|
|
||||||
$form.find('input[name="pk[]"]').prop('checked', checked);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document)
|
|
||||||
.off('click.cityDeleteGuard', '#delete')
|
|
||||||
.on('click.cityDeleteGuard', '#delete', function (event) {
|
|
||||||
if (!$form.find('input[name="pk[]"]:checked').length) {
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopImmediatePropagation();
|
|
||||||
window.alert('削除対象を選択してください。');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})(window.jQuery);
|
|
||||||
|
|
||||||
$(document).on('click', 'th[sort]', function () {
|
|
||||||
const $form = $('#list-form');
|
|
||||||
const sortKey = $(this).attr('sort');
|
|
||||||
const currentSort = $form.find('input[name="sort"]').val();
|
|
||||||
const currentType = $form.find('input[name="sort_type"]').val();
|
|
||||||
|
|
||||||
if (currentSort === sortKey) {
|
|
||||||
// 切换方向
|
|
||||||
const newType = currentType === 'asc' ? 'desc' : 'asc';
|
|
||||||
$form.find('input[name="sort_type"]').val(newType);
|
|
||||||
} else {
|
|
||||||
// 新字段,默认升序
|
|
||||||
$form.find('input[name="sort"]').val(sortKey);
|
|
||||||
$form.find('input[name="sort_type"]').val('asc');
|
|
||||||
}
|
|
||||||
|
|
||||||
$form.submit();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
154
resources/views/admin/cities/_form.blade.php
Normal file
154
resources/views/admin/cities/_form.blade.php
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
{{-- アラート(成功) --}}
|
||||||
|
@if(Session::has('success'))
|
||||||
|
<div class="alert alert-success alert-dismissible" role="alert">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
{{ Session::get('success') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- アラート(エラー:Session) --}}
|
||||||
|
@if(Session::has('error'))
|
||||||
|
<div class="alert alert-danger alert-dismissible" role="alert">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
{!! Session::get('error') !!}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- アラート(任意エラー) --}}
|
||||||
|
@if(isset($errorMsg))
|
||||||
|
<div class="alert alert-danger alert-dismissible" role="alert">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
@if(is_array($errorMsg))
|
||||||
|
<ul class="mb-0">
|
||||||
|
@foreach($errorMsg as $msg)
|
||||||
|
<li>{{ $msg }}</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@else
|
||||||
|
{!! $errorMsg !!}
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- バリデーションエラー --}}
|
||||||
|
@if($errors->any())
|
||||||
|
<div class="alert alert-danger alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
<h4><i class="icon fa fa-ban"></i> {{ __('入力内容に不備があります:') }}</h4>
|
||||||
|
<ul>
|
||||||
|
@foreach($errors->all() as $error)
|
||||||
|
<li>{{ $error }}</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
{{-- ▼ 市区ID(編集時のみ表示) --}}
|
||||||
|
@if(!empty($isEdit))
|
||||||
|
<div class="form-group col-3">
|
||||||
|
<label>{{ __('市区ID') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-9">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text"
|
||||||
|
class="form-control form-control-lg bg-light"
|
||||||
|
value="{{ old('city_id', $record->city_id ?? '') }}"
|
||||||
|
readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- ▼ 市区名 --}}
|
||||||
|
<div class="form-group col-3">
|
||||||
|
<label class="form-label required">{{ __('市区名') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-9">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text"
|
||||||
|
name="city_name"
|
||||||
|
class="form-control form-control-lg"
|
||||||
|
placeholder="{{ __('市区名') }}"
|
||||||
|
value="{{ old('city_name', $record->city_name ?? ($city_name ?? '')) }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 印字レイアウトファイル --}}
|
||||||
|
<div class="form-group col-3">
|
||||||
|
<label class="form-label required">{{ __('印字レイアウトファイル') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-9">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text"
|
||||||
|
name="print_layout"
|
||||||
|
class="form-control form-control-lg"
|
||||||
|
placeholder="{{ __('印字レイアウトファイル') }}"
|
||||||
|
value="{{ old('print_layout', $record->print_layout ?? ($print_layout ?? '')) }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- {{-- ▼ 顧客M入力不要フィールドID --}}
|
||||||
|
<div class="form-group col-3">
|
||||||
|
<label class="form-label required">{{ __('顧客M入力不要フィールドID') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-9">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text"
|
||||||
|
name="city_user"
|
||||||
|
class="form-control form-control-lg"
|
||||||
|
placeholder="{{ __('顧客M入力不要フィールドID') }}"
|
||||||
|
value="{{ old('city_user', $record->city_user ?? ($city_user ?? '')) }}">
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
{{-- ▼ 備考 --}}
|
||||||
|
<div class="form-group col-3">
|
||||||
|
<label>{{ __('備考') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-9">
|
||||||
|
<div class="input-group">
|
||||||
|
<textarea class="form-control form-control-lg"
|
||||||
|
rows="5"
|
||||||
|
placeholder="{{ __('備考') }}"
|
||||||
|
name="city_remarks">{{ old('city_remarks', $record->city_remarks ?? ($city_remarks ?? '')) }}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ 下部ボタン --}}
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="form-group col-md-10 d-flex align-items-center gap-2 justify-content-start">
|
||||||
|
|
||||||
|
{{-- 登録/更新ボタン --}}
|
||||||
|
@if(!empty($isEdit))
|
||||||
|
<button type="button" id="register_edit" class="btn btn-lg btn-success mr-2">
|
||||||
|
{{ __('登録') }}
|
||||||
|
</button>
|
||||||
|
@else
|
||||||
|
<button type="button" id="register" class="btn btn-lg btn-success mr-2 register">
|
||||||
|
{{ __('登録') }}
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- 削除ボタン(編集時のみ表示) --}}
|
||||||
|
@if(!empty($isEdit))
|
||||||
|
<button type="button" id="delete_edit" class="btn btn-lg btn-danger js-inline-delete mr-2">
|
||||||
|
{{ __('削除') }}
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- 戻るボタン(一覧状態保持) --}}
|
||||||
|
<button type="button"
|
||||||
|
id="btn_back"
|
||||||
|
class="btn btn-lg btn-secondary mr-2"
|
||||||
|
data-back-url="{{ request('back') }}">
|
||||||
|
{{ __('戻る') }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
51
resources/views/admin/cities/add.blade.php
Normal file
51
resources/views/admin/cities/add.blade.php
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
@section('title', '新規')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<!-- Content Header -->
|
||||||
|
<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('city') }}">市区マスタ</a>
|
||||||
|
</li>
|
||||||
|
<li class="breadcrumb-item active">新規</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
<form id="form_add"
|
||||||
|
method="post"
|
||||||
|
action="{{ route('city_add') }}?back={{ urlencode(request()->get('back', request()->fullUrl())) }}"
|
||||||
|
enctype="multipart/form-data">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
@include('admin.cities._form', [
|
||||||
|
'isEdit' => false
|
||||||
|
])
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endsection
|
||||||
63
resources/views/admin/cities/edit.blade.php
Normal file
63
resources/views/admin/cities/edit.blade.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
@section('title', '編集')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<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('city') }}">市区マスタ</a>
|
||||||
|
</li>
|
||||||
|
<li class="breadcrumb-item active">編集</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.content-header -->
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
{{-- 編集フォーム --}}
|
||||||
|
<form id="form_edit"
|
||||||
|
action="{{ route('city_edit', ['id' => $record->city_id]) }}?back={{ urlencode(request()->get('back', request()->fullUrl())) }}"
|
||||||
|
method="POST"
|
||||||
|
enctype="multipart/form-data">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
@include('admin.cities._form', [
|
||||||
|
'isEdit' => true,
|
||||||
|
'record' => $record
|
||||||
|
])
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{{-- 削除フォーム(非表示) --}}
|
||||||
|
<form id="form_delete"
|
||||||
|
action="{{ route('city_delete') }}"
|
||||||
|
method="POST"
|
||||||
|
style="display:none;">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="pk" value="{{ $record->city_id }}">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<!-- /.content -->
|
||||||
|
@endsection
|
||||||
142
resources/views/admin/cities/list.blade.php
Normal file
142
resources/views/admin/cities/list.blade.php
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('title', '市区マスタ')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<!-- Content Header -->
|
||||||
|
<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 active">市区マスタ</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
{{-- 並び替え用 hidden --}}
|
||||||
|
<form method="GET" action="{{ route('city') }}" id="list-form">
|
||||||
|
<input type="hidden" name="sort" id="sort" value="{{ $sort ?? '' }}">
|
||||||
|
<input type="hidden" name="sort_type" id="sort_type" value="{{ $sort_type ?? '' }}">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{{-- ▼ ボタンエリア --}}
|
||||||
|
<div class="col-lg-12 mb-3 px-0">
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-sm btn-primary mr10"
|
||||||
|
onclick="location.href='{{ route('city_add') }}?back={{ urlencode(request()->fullUrl()) }}'">
|
||||||
|
新規
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-sm btn-danger mr10" id="delete">削除</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ ページネーション --}}
|
||||||
|
<div class="col-lg-12 px-0">
|
||||||
|
<div class="d-flex flex-column align-items-end mb-2 text-sm">
|
||||||
|
{{-- 件数表示(上) --}}
|
||||||
|
<div class="text-dark text-sm mb-1">
|
||||||
|
@if ($list->total() > 0)
|
||||||
|
全 {{ $list->total() }} 件中 {{ $list->firstItem() }}〜{{ $list->lastItem() }} 件を表示
|
||||||
|
@else
|
||||||
|
全0件
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ページネーション(下) --}}
|
||||||
|
<div>
|
||||||
|
{{ $list->appends([
|
||||||
|
'sort' => $sort ?? '',
|
||||||
|
'sort_type' => $sort_type ?? '',
|
||||||
|
] + request()->except('page'))->links('pagination') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ フラッシュメッセージ(利用者分類マスタと同じ見せ方) --}}
|
||||||
|
<div class="form col-lg-12 px-0">
|
||||||
|
@if(Session::has('success'))
|
||||||
|
<div class="alert alert-success alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||||
|
{{ Session::get('success') }}
|
||||||
|
</div>
|
||||||
|
@elseif(Session::has('error'))
|
||||||
|
<div class="alert alert-danger alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||||
|
{!! Session::get('error') !!}
|
||||||
|
</div>
|
||||||
|
@elseif(isset($errorMsg))
|
||||||
|
<div class="alert alert-danger alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||||
|
{!! $errorMsg !!}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- ▼ テーブル --}}
|
||||||
|
<div class="col-lg-12 mb20 px-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<form id="form_delete" method="POST" action="{{ route('city_delete') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<table class="table table-bordered dataTable text-nowrap">
|
||||||
|
<thead class="thead-light">
|
||||||
|
<tr>
|
||||||
|
<th style="width:140px;">
|
||||||
|
<input type="checkbox"
|
||||||
|
class="js-check-all"
|
||||||
|
onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th class="sorting {{ ($sort ?? '') === 'city_id' ? (($sort_type ?? '') === 'asc' ? 'sorting_asc' : 'sorting_desc') : '' }}"
|
||||||
|
sort="city_id">
|
||||||
|
<span>市区ID</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th class="sorting {{ ($sort ?? '') === 'city_name' ? (($sort_type ?? '') === 'asc' ? 'sorting_asc' : 'sorting_desc') : '' }}"
|
||||||
|
sort="city_name">
|
||||||
|
<span>市区名</span>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th><span>印字レイアウトファイル</span></th>
|
||||||
|
<th><span>備考</span></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody class="bg-white">
|
||||||
|
@foreach ($list as $city)
|
||||||
|
<tr>
|
||||||
|
<td style="background-color:#faebd7;">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<input type="checkbox" name="pk[]" value="{{ $city->city_id }}">
|
||||||
|
<a href="{{ route('city_edit', ['id' => $city->city_id]) }}?back={{ urlencode(request()->fullUrl()) }}"
|
||||||
|
class="btn btn-sm btn-outline-primary ml10">
|
||||||
|
編集
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>{{ $city->city_id }}</td>
|
||||||
|
<td>{{ $city->city_name }}</td>
|
||||||
|
<td>{{ $city->print_layout }}</td>
|
||||||
|
<td>{{ $city->city_remarks }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
@endsection
|
||||||
Loading…
Reference in New Issue
Block a user