@extends('layouts.master') @section('title') {{translate('edit collateral')}} @endsection @section('content')
{{translate('edit collateral')}}
{!! Form::open(array('url' => url('collateral/'.$collateral->id.'/update'), 'method' => 'post','class'=>'', 'name' => 'form',"enctype"=>"multipart/form-data")) !!}
@if(isset($_REQUEST['return_url'])) @endif
{!! Form::label('collateral_type_id',translate('type'),array('class'=>' control-label')) !!} {!! Form::select('collateral_type_id',$types,$collateral->collateral_type_id, array('class' => 'form-control','required'=>'required')) !!}
{!! Form::label('name',translate('product').' '.translate('name'),array('class'=>'')) !!} {!! Form::text('name',$collateral->name, array('class' => 'form-control', 'placeholder'=>"")) !!}
{!! Form::label('value',translate('value'),array('class'=>'')) !!} {!! Form::text('value',$collateral->value, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')) !!}
{!! Form::label('date',translate('register').' '.translate('date'),array('class'=>'')) !!} {!! Form::text('date',$collateral->date, array('class' => 'form-control date-picker', 'placeholder'=>"",'required'=>'required')) !!}
{!! Form::label('status',translate('current').' '.translate('status'),array('class'=>' control-label')) !!} {!! Form::select('status',array('deposited_into_branch'=>'Deposited into branch','collateral_with_borrower'=>'Collateral with borrower','returned_to_borrower'=>'Returned to borrower','repossession_initiated'=>'Repossession initiated','repossessed'=>'Repossessed','sold'=>'Sold','lost'=>'Lost'),$collateral->status, array('class' => 'form-control','required'=>'required')) !!}

{{translate('optional field')}}

{!! Form::label('name',translate('owner').' '.translate('name'),array('class'=>'')) !!} {!! Form::text('owner_name',$collateral->owner_name, array('class' => 'form-control', 'placeholder'=>"")) !!}
{!! Form::label('relationship',translate('relationship'),array('class'=>'')) !!} {!! Form::text('relationship',$collateral->relationship, array('class' => 'form-control', 'placeholder'=>"")) !!}
{!! Form::label('color',translate('color'),array('class'=>'')) !!} {!! Form::text('color',$collateral->collateralVehicle?$collateral->collateralVehicle->color:null, array('class' => 'form-control')) !!}
{!! Form::label('manufacture_date',translate('manufacture_date'),array('class'=>'')) !!} {!! Form::text('manufacture_date',$collateral->collateralVehicle?$collateral->collateralVehicle->manufacture_date:null, array('class' => 'form-control date-picker')) !!}
{!! Form::label('serial_number',translate('serial_number'),array('class'=>'')) !!} {!! Form::text('serial_number',$collateral->collateralVehicle?$collateral->collateralVehicle->serial_number:null, array('class' => 'form-control')) !!}
{!! Form::label('engine_number',translate('engine_number'),array('class'=>'')) !!} {!! Form::text('engine_number',$collateral->collateralVehicle?$collateral->collateralVehicle->engine_number:null, array('class' => 'form-control')) !!}
{!! Form::label('frame_number',translate('frame_number'),array('class'=>'')) !!} {!! Form::text('frame_number',$collateral->collateralVehicle?$collateral->collateralVehicle->frame_number:null, array('class' => 'form-control')) !!}
{!! Form::label('license_plate',translate('license_plate'),array('class'=>'')) !!} {!! Form::text('license_plate',$collateral->collateralVehicle?$collateral->collateralVehicle->license_plate:null, array('class' => 'form-control')) !!}
{!! Form::label('model_name',translate('model_name'),array('class'=>'')) !!} {!! Form::text('model_name',$collateral->collateralVehicle?$collateral->collateralVehicle->model_name:null, array('class' => 'form-control')) !!}
{!! Form::label('model_number',translate('model_number'),array('class'=>'')) !!} {!! Form::text('model_number',$collateral->collateralVehicle?$collateral->collateralVehicle->model_number:null, array('class' => 'form-control')) !!}
{!! Form::label('notes',translate('description'),array('class'=>'')) !!} {!! Form::textarea('notes',$collateral->notes, array('class' => 'form-control')) !!}
{!! Form::label('photo',translate('collateral').' '.translate('photo'),array('class'=>'')) !!} {!! Form::file('photo', array('class' => 'form-control',)) !!}
{!! Form::label('files',translate('collateral').' '.translate('file').'('.translate('borrower_file_types').')',array('class'=>'')) !!} {!! Form::file('files[]', array('class' => 'form-control', 'multiple'=>"",'rows'=>'3')) !!}
@foreach(unserialize($collateral->files) as $key=>$value) {!! $value!!}
@endforeach

{{translate('custom_field')}}

@foreach($custom_fields as $key)
{!! Form::label($key->id,$key->name,array('class'=>'')) !!} @if($key->field_type=="number") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$collateral->id)->where('category','collateral')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$collateral->id)->where('category','collateral')->first()->name}} @endif"> @endif @if($key->field_type=="textfield") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$collateral->id)->where('category','collateral')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$collateral->id)->where('category','collateral')->first()->name}} @endif"> @endif @if($key->field_type=="date") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$collateral->id)->where('category','collateral')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$collateral->id)->where('category','collateral')->first()->name}} @endif"> @endif @if($key->field_type=="textarea") @endif @if($key->field_type=="decimal") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$collateral->id)->where('category','collateral')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$collateral->id)->where('category','collateral')->first()->name}} @endif"> @endif

Click here to add custom fields on this page

@endforeach
{!! Form::close() !!}
@endsection @section('footer-scripts') @endsection