krgm.so-manager-dev.com/resources/views/admin/settings/list.blade.php

155 lines
6.7 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') }}">XX様info(ホーム)</a></li>
<li class="breadcrumb-item"><a href="javascript:void(0);">[東京都|〇〇駐輪場]</a></li>
<li class="breadcrumb-item active">{{ __('設定マスタ') }}</li>
</ol>
</div>
</div>
</div>
</div>
<section class="content">
<div class="container-fluid">
{{-- ソート用フォーム --}}
<form action="{{ route('settings') }}" method="post" id="list-form" class="d-none">
@csrf
<input type="hidden" name="sort" id="sort" value="{{ $sort }}">
<input type="hidden" name="sort_type" id="sort_type" value="{{ $sort_type }}">
</form>
<div class="container-fluid mb20">
<button type="button" class="btn btn-sm btn-default mr10" onclick="location.href='{{ route('settings_add') }}'">{{ __('新規') }}</button>
<button type="submit" class="btn btn-sm btn-default mr10" form="form_delete">{{ __('削除') }}</button>
{{ $list->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 sample03-wrapper no_padding_right mb20">
<form action="{{ route('settings_delete') }}" method="post" id="form_delete">
@csrf
<div class="scroll">
<table class="table dataTable">
<thead>
<tr>
{{-- 左:チェック+編集 --}}
<th style="width:140px; background:#f9f9f9;">
<input type="checkbox" class="minimal m-0" id="checkbox_all">
</th>
{{-- 右:本体 --}}
<th sort="setting_id" class="sorting @if($sort=='setting_id'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif text-right">
{{ __('設定ID') }}
</th>
<th sort="edit_master" class="sorting @if($sort=='edit_master'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif text-left">
{{ __('編集マスタ') }}
</th>
<th sort="web_master" class="sorting @if($sort=='web_master'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif text-left">
{{ __('ウェブ参照マスタ') }}
</th>
<th sort="auto_change_date" class="sorting @if($sort=='auto_change_date'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif text-right">
{{ __('自動切替日時') }}
</th>
<th>{{ __('自動切換え参照マスタ') }}</th>
<th sort="printable_alert_flag" class="sorting @if($sort=='printable_alert_flag'){{ $sort_type=='asc'?'sorting_asc':'sorting_desc' }}@endif text-left">
{{ __('印字残警告') }}
</th>
<th class="text-right">{{ __('ロール紙印字可能数') }}</th>
<th class="text-right">{{ __('ロール紙印字残警告数') }}</th>
<th class="text-right">{{ __('キープアライブ(分)') }}</th>
</tr>
</thead>
<tbody>
@foreach($list as $row)
<tr>
{{-- 左:チェック+編集 --}}
<td class="sm-item text-left" style="background:#f9f9f9;">
<input type="checkbox" class="minimal m-0 checkbox" name="id[]" value="{{ $row->setting_id }}">
<div class="btn_action">
<a href="{{ route('settings_edit',['id'=>$row->setting_id]) }}" class="btn btn-sm btn-default ml10">{{ __('編集') }}</a>
</div>
</td>
{{-- 右:本体 --}}
<td class="sm-item text-right">{{ $row->setting_id }}</td>
<td class="sm-item text-left">{{ $row->edit_master }}</td>
<td class="sm-item text-left">{{ $row->web_master }}</td>
<td class="sm-item text-right">
@php
$dt = $row->auto_change_date instanceof \Carbon\Carbon
? $row->auto_change_date->format('Y/m/d H:i')
: ($row->auto_change_date ? \Carbon\Carbon::parse($row->auto_change_date)->format('Y/m/d H:i') : '');
@endphp
{{ $dt }}
</td>
<td class="sm-item text-left">{{ $row->auto_chage_master }}</td>
<td class="sm-item text-left">{{ $row->printable_alert_flag ? '○' : '' }}</td>
<td class="sm-item text-right">{{ $row->printable_number }}</td>
<td class="sm-item text-right">{{ $row->printable_alert_number }}</td>
<td class="sm-item text-right">{{ $row->printer_keep_alive }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</form>
</div>
</div>
</section>
@push('scripts')
<script>
document.querySelectorAll('th.sorting[sort]').forEach(function(th){
th.style.cursor = 'pointer';
th.addEventListener('click', function(){
var field = this.getAttribute('sort');
var cur = document.getElementById('sort').value;
var type = document.getElementById('sort_type').value || 'asc';
var next = (cur === field && type === 'asc') ? 'desc' : 'asc';
document.getElementById('sort').value = field;
document.getElementById('sort_type').value = next;
document.getElementById('list-form').submit();
});
});
document.getElementById('checkbox_all')?.addEventListener('change', function(e){
document.querySelectorAll('.checkbox').forEach(function(cb){ cb.checked = e.target.checked; });
});
</script>
@endpush
@endsection