@extends('_version_02.commons.layouts.admin') @section('content') {!! Form::model($model, ['class'=>'form-horizontal']) !!} @include('_version_02.commons.layouts.partials._alert') @php $starting_date = $model->starting_date ? date('m-Y', strtotime($model->starting_date)) : ''; $ending_date = $model->ending_date ? date('m-Y', strtotime($model->ending_date)) : ''; $roomType = old('room_type', $model->room_type ?? 'single'); $ids = strlen($model->subsidize_tenant_id ?? '') > 1 ? json_decode($model->subsidize_tenant_id, true) : []; if (!is_array($ids)) $ids = []; $ids = array_values(array_map('strval', $ids)); // ALWAYS string ids $tenantOptionsUrl = action('UMeterSubsidiariesController@getTenantOptions'); @endphp
{{ 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', '') !!}
{{-- Code + Name --}}
{!! 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', '') !!}
{{-- Amount + Implementation Date --}}
{!! 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', '') !!}
{{-- Month range --}}
{!! Form::label('starting_date', App\Language::trans('From Month'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('starting_date', App\PowerMeterModel\MeterInvoice::previous_one_year_combobox(), null, ['class'=>'form-control','autofocus','id'=>'starting_date']) !!} {!! $errors->first('starting_date', '') !!}
{!! Form::label('ending_date', App\Language::trans('To Month'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select('ending_date', App\PowerMeterModel\MeterInvoice::next_one_year_combobox(), null, ['class'=>'form-control','id'=>'ending_date']) !!} {!! $errors->first('ending_date', '') !!}
{{ App\Language::trans('Beneficial Selection') }}

{{-- Room Type --}}
{!! Form::label('room_type', App\Language::trans('Room Type'), ['class'=>'control-label col-md-4']) !!}
{!! Form::select( 'room_type', App\Setting::room_type_combobox(), $roomType, ['class'=>'form-control','autofocus','onchange'=>'init_room_type_subsidize_handle(this)','id'=>'room_type'] ) !!} {!! $errors->first('room_type', '') !!}
{{-- Room type message row --}} {{-- Subsidize Tenant List --}}
{!! $errors->first('subsidize_tenant_id', '') !!}
{{-- Remark --}}
{!! 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') {!! Form::close() !!} @stop @section('script') @stop