230 lines
13 KiB
PHP
230 lines
13 KiB
PHP
@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 active">{{ __('決済トランザクション') }}</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- /.content-header -->
|
||
|
||
<section class="content">
|
||
<!-- 絞り込みフィルター -->
|
||
<div class="col-lg-12">
|
||
<div class="card">
|
||
<div class="card-header"><h3 class="card-title">絞り込みフィルター</h3></div>
|
||
<div class="card-body">
|
||
<form action="{{ route('settlement_transactions') }}" method="POST" id="list-form">
|
||
@csrf
|
||
<input type="hidden" name="sort" id="sort" value="{{ $sort ?? '' }}">
|
||
<input type="hidden" name="sort_type" id="sort_type" value="{{ $sort_type ?? '' }}">
|
||
|
||
<div class="row">
|
||
<div class="form-group col-12">
|
||
<label>定期契約ID</label>
|
||
<input type="text" name="contract_id" class="form-control"
|
||
value="{{ old('contract_id', $contract_id ?? '') }}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group col-12 text-left">
|
||
<button type="submit" name="action" value="filter" class="btn btn-default">絞り込み</button>
|
||
<button type="submit" name="action" value="unlink" class="btn btn-default">解除</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="container-fluid">
|
||
|
||
<div class="row">
|
||
{{-- ソート保持用 --}}
|
||
<form action="{{ route('settlement_transactions') }}" method="POST" id="list-form">
|
||
@csrf
|
||
<input type="hidden" name="sort" value="{{ $sort ?? '' }}">
|
||
<input type="hidden" name="sort_type" value="{{ $sort_type ?? '' }}">
|
||
</form>
|
||
|
||
<div class="container-fluid mb20">
|
||
{{ $transactions->appends(['sort' => $sort ?? '', 'sort_type' => $sort_type ?? ''])->links('pagination') }}
|
||
</div>
|
||
|
||
<div class="form col-lg-12">
|
||
@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>
|
||
@elseif(Session::has('error'))
|
||
<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>
|
||
{!! Session::get('error') !!}
|
||
</div>
|
||
@elseif(isset($errorMsg))
|
||
<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>
|
||
{!! $errorMsg !!}
|
||
</div>
|
||
@endif
|
||
</div>
|
||
|
||
<div class="col-lg-12 row sample03-wrapper no_padding_right mb20">
|
||
{{-- 左:チェック&操作 --}}
|
||
<div class="col-xl-2 col-lg-2 col-md-2 col-sm-3 col-xs-3 table_left">
|
||
<form action="{{ route('settlement_transactions_delete') }}" method="POST" id="form_delete">
|
||
@csrf
|
||
<table class="table dataTable">
|
||
<thead>
|
||
<tr>
|
||
<th>
|
||
<input type="checkbox" class="minimal m-0" id="checkbox_all">
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($transactions as $item)
|
||
<tr role="row">
|
||
<td>
|
||
<input type="checkbox" class="minimal m-0 checkbox"
|
||
value="{{ $item->settlement_transaction_id }}" name="ids[]">
|
||
<div class="btn_action">
|
||
<a href="{{ route('settlement_transactions_edit', ['settlement_transaction_id' => $item->settlement_transaction_id]) }}"
|
||
class="btn btn-sm btn-default ml10">{{ __('編集') }}</a>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</form>
|
||
</div>
|
||
|
||
{{-- 右:データ一覧 --}}
|
||
<div class="col-lg-10 col-xl-10 col-md-10 col-sm-9 col-xs-9 table_right no_padding_right">
|
||
<div class="scroll">
|
||
<table class="table dataTable">
|
||
<thead>
|
||
<tr>
|
||
<th class="sorting {{ ($sort=='settlement_transaction_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="settlement_transaction_id">
|
||
<span>{{ __('validation.attributes.settlement_transaction_id') }}</span>
|
||
</th>
|
||
<th class="sorting {{ ($sort=='contract_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="contract_id">
|
||
<span>{{ __('validation.attributes.contract_id') }}</span>
|
||
</th>
|
||
<th class="sorting {{ ($sort=='status') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="status">
|
||
<span>{{ __('validation.attributes.status') }}</span>
|
||
</th>
|
||
<th><span>{{ __('validation.attributes.pay_code') }}</span></th>
|
||
<th><span>{{ __('validation.attributes.contract_payment_number') }}</span></th>
|
||
<th class="sorting {{ ($sort=='corp_code') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="corp_code">
|
||
<span>{{ __('validation.attributes.corp_code') }}</span>
|
||
</th>
|
||
<th class="sorting {{ ($sort=='mms_date') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="mms_date">
|
||
<span>{{ __('validation.attributes.mms_date') }}</span>
|
||
</th>
|
||
<th class="sorting {{ ($sort=='cvs_code') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="cvs_code">
|
||
<span>{{ __('validation.attributes.cvs_code') }}</span>
|
||
</th>
|
||
<th class="sorting {{ ($sort=='shop_code') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="shop_code">
|
||
<span>{{ __('validation.attributes.shop_code') }}</span>
|
||
</th>
|
||
<th class="sorting {{ ($sort=='pay_date') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="pay_date">
|
||
<span>{{ __('validation.attributes.pay_date') }}</span>
|
||
</th>
|
||
<th><span>{{ __('validation.attributes.settlement_amount') }}</span></th>
|
||
<th><span>{{ __('validation.attributes.stamp_flag') }}</span></th>
|
||
<th><span>{{ __('validation.attributes.md5_string') }}</span></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($transactions as $item)
|
||
<tr>
|
||
<td class="sm-item text-left">{{ $item->settlement_transaction_id }}</td>
|
||
<td class="sm-item text-left">{{ $item->contract_id }}</td>
|
||
<td class="sm-item text-left">{{ $item->status }}</td>
|
||
<td class="sm-item text-left">{{ $item->pay_code }}</td>
|
||
<td class="sm-item text-left">{{ $item->contract_payment_number }}</td>
|
||
<td class="sm-item text-left">{{ $item->corp_code }}</td>
|
||
<td class="sm-item text-left">{{ $item->mms_date }}</td>
|
||
<td class="sm-item text-left">{{ $item->cvs_code }}</td>
|
||
<td class="sm-item text-left">{{ $item->shop_code }}</td>
|
||
<td class="sm-item text-left">{{ optional($item->pay_date)->format('Y-m-d H:i') }}</td>
|
||
<td class="sm-item text-left">{{ $item->settlement_amount }}</td>
|
||
<td class="sm-item text-left">{{ $item->stamp_flag }}</td>
|
||
<td class="sm-item text-left">{{ $item->md5_string }}</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</section>
|
||
|
||
|
||
@push('scripts')
|
||
<script>
|
||
// 全選択
|
||
document.getElementById('checkbox_all')?.addEventListener('change', function(e){
|
||
document.querySelectorAll('.checkbox').forEach(cb => cb.checked = e.target.checked);
|
||
});
|
||
|
||
// 削除
|
||
document.getElementById('delete')?.addEventListener('click', function(){
|
||
const anyChecked = Array.from(document.querySelectorAll('.checkbox')).some(cb => cb.checked);
|
||
if (!anyChecked) { alert('{{ __("削除対象が選択されていません。") }}'); return; }
|
||
if (confirm('{{ __("削除してよろしいですか?") }}')) {
|
||
document.getElementById('form_delete').submit();
|
||
}
|
||
});
|
||
|
||
// ソート
|
||
document.querySelectorAll('th.sorting').forEach(th => {
|
||
th.addEventListener('click', function(){
|
||
const form = document.getElementById('list-form');
|
||
const current = "{{ $sort ?? '' }}";
|
||
const currentType = "{{ $sort_type ?? '' }}";
|
||
const nextCol = this.getAttribute('sort');
|
||
let nextType = 'asc';
|
||
if (current === nextCol) {
|
||
nextType = (currentType === 'asc') ? 'desc' : 'asc';
|
||
}
|
||
form.querySelector('[name=sort]').value = nextCol;
|
||
form.querySelector('[name=sort_type]').value = nextType;
|
||
form.submit();
|
||
});
|
||
});
|
||
|
||
// インポート:ファイル選択→自動送信(必要ならUIを別途用意)
|
||
const importBtn = document.querySelector('button[form="form_import"]');
|
||
const importInput = document.getElementById('import_file');
|
||
importBtn?.addEventListener('click', function(e){
|
||
e.preventDefault();
|
||
importInput.click();
|
||
});
|
||
importInput?.addEventListener('change', function(){
|
||
if (this.files.length > 0) {
|
||
document.getElementById('form_import').submit();
|
||
}
|
||
});
|
||
</script>
|
||
@endpush
|
||
@endsection
|