@extends('_version_02.commons.layouts.admin') @section('content') {!! Form::model($model, ['class'=>'form-horizontal']) !!} @include('_version_02.commons.layouts.partials._alert') @php $savedIds = App\Support\SubsidyRecipientSelection::decode($model->subsidize_tenant_id ?: '[]'); $selectionError = null; $ids = $savedIds; if (old('subsidize_tenant_ids_json') !== null || old('subsidize_tenant_count') !== null || old('subsidy_form_complete') !== null) { try { $ids = App\Support\SubsidyRecipientSelection::fromInput(array( 'subsidize_tenant_ids_json' => old('subsidize_tenant_ids_json'), 'subsidize_tenant_count' => old('subsidize_tenant_count'), 'subsidy_form_complete' => old('subsidy_form_complete'), )); } catch (\InvalidArgumentException $e) { $selectionError = 'The previous selection was incomplete. The saved selection is shown below.'; } } // Render only the canonical IDs. Directory data is loaded in bounded AJAX pages. $selectedRoomType = old('room_type', $model->room_type ?: 'single'); if (!in_array($selectedRoomType, array('single', 'twin', 'quad'), true)) { $selectedRoomType = 'single'; } $revision = $model->exists ? App\Support\SubsidyRecipientSelection::revision($model->getAttributes()) : 'new'; @endphp @if($selectionError)
{{ $selectionError }}
@endif
{{ App\Language::trans('Information') }}

{!! Form::label('status', App\Language::trans('Status'), ['class'=>'control-label col-md-4']) !!}
status ?? 1) == 1 ? 'checked' : '' }} class="custom-control-input">
status ?? 1) == 0 ? 'checked' : '' }} class="custom-control-input">
{!! $errors->first('status', '') !!}
{{--
{!! Form::label('is_sudsidy_distribute_directly', App\Language::trans('Is Distribute Complementary Directly For First Month ?'), ['class'=>'control-label col-md-12']) !!}
{!! $errors->first('is_sudsidy_distribute_directly', '') !!}
--}}
{!! Form::label('code', App\Language::trans('Code'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('code', null, ['class'=>'form-control']) !!} {!! $errors->first('code', '') !!}
{!! Form::label('text', App\Language::trans('Name'), ['class'=>'control-label col-md-4']) !!}
{!! Form::text('name', null, ['class'=>'form-control']) !!} {!! $errors->first('name', '') !!}
{!! Form::label('amount', App\Language::trans('Amount'), ['class'=>'control-label col-md-4']) !!}
{!! Form::number('amount', null, ['min'=>1,'max'=>9999,'step'=>'0.01','class'=>'form-control']) !!} {!! $errors->first('amount', '') !!}
{!! Form::label('implementation_date', App\Language::trans('Implementation Date'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('implementation_date', App\Setting::select_days_combobox(), null, ['class'=>'form-control']) !!} {!! $errors->first('implementation_date', '') !!}
@php $starting_date = old('starting_date', $model->starting_date ? date('m-Y' , strtotime($model->starting_date)) : ''); $ending_date = old('ending_date', $model->ending_date ? date('m-Y' , strtotime($model->ending_date)) : ''); $startingOptions = App\PowerMeterModel\MeterInvoice::previous_one_year_combobox(); $endingOptions = App\PowerMeterModel\MeterInvoice::next_one_year_combobox(); if (preg_match('/^(0[1-9]|1[0-2])-[0-9]{4}$/D', $starting_date)) { $startingOptions[$starting_date] = $starting_date; } if (preg_match('/^(0[1-9]|1[0-2])-[0-9]{4}$/D', $ending_date)) { $endingOptions[$ending_date] = $ending_date; } @endphp
{!! Form::label('starting_date', App\Language::trans('From Month'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('starting_date', $startingOptions, $starting_date ?: null, ['class'=>'form-control','autofocus','id'=>'starting_date','aria-describedby'=>'subsidy-starting-error']) !!} {!! $errors->first('starting_date', '') !!}
{!! Form::label('ending_date', App\Language::trans('To Month'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('ending_date', $endingOptions, $ending_date ?: null, ['class'=>'form-control','id'=>'ending_date','aria-describedby'=>'subsidy-ending-error']) !!} {!! $errors->first('ending_date', '') !!}
{{ App\Language::trans('Beneficial Selection') }}

{!! Form::label('room_type', App\Language::trans('Room Type'), ['class'=>'control-label']) !!}
{!! Form::select('room_type', App\Setting::room_type_combobox(), $selectedRoomType, ['class'=>'form-control','autofocus','id'=>'room_type']) !!} {!! $errors->first('room_type', '') !!}
{!! $errors->first('subsidize_tenant_id', '
:message
') !!}
{!! Form::label('remark', App\Language::trans('Remark'), ['class'=>'control-label col-md-12']) !!}
{!! Form::text('remark', null, ['class'=>'form-control']) !!} {!! $errors->first('remark', '') !!}
@include('_version_02.commons.layouts.partials._form_floaring_footer_standard') {{-- One JSON input avoids PHP max_input_vars truncating large selections. --}} {!! Form::close() !!} @stop @section('script') @stop