| Path : /var/www/html/thb_loan_system/resources/views/borrower/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/thb_loan_system/resources/views/borrower/edit.blade.php |
@extends('layouts.master')
@section('title')
{{translate('edit borrower')}}
@endsection
@section('content')
<div class="panel panel-white">
<div class="panel-heading">
<h6 class="panel-title">{{translate('edit borrower')}}</h6>
<div class="heading-elements">
</div>
</div>
{!! Form::open(array('url' => url('borrower/'.$borrower->id.'/update'), 'method' => 'post', 'name' => 'form',"enctype"=>"multipart/form-data")) !!}
<div class="panel-body">
<div class="form-group">
<div class="row">
<!--
<div class="col-md-4">
{!! Form::label('title',translate('title')." *",array('class'=>'')) !!}
{!! Form::select('title',array('Mr'=>translate('Mr'),'Mrs'=>translate('Mrs'), 'Miss'=>translate('Miss'),'Ms'=>translate('Ms'),'Dr'=>translate('Dr'),'Prof'=>translate('Prof'),'Rev'=>translate('Rev')),$borrower->title, array('class' => 'form-control',)) !!}
</div>
-->
<div class="col-md-4">
{!! Form::label('first_name',translate('first_name')." *",array('class'=>'')) !!}
{!! Form::text('first_name',$borrower->first_name, array('class' => 'form-control', 'placeholder'=>translate('first_name'),'required'=>'required')) !!}
</div>
<div class="col-md-4">
{!! Form::label('last_name',translate('last_name')." *",array('class'=>'')) !!}
{!! Form::text('last_name',$borrower->last_name, array('class' => 'form-control', 'placeholder'=>translate('last_name'),'required'=>'required')) !!}
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-4">
{!! Form::label('gender',translate('gender')." *",array('class'=>'')) !!}
{!! Form::select('gender',array('Male'=>translate('male'),'Female'=>translate('female')),$borrower->gender, array('class' => 'form-control','required'=>'required')) !!}
</div>
<div class="col-md-4">
{!! Form::label('unique_number',translate('unique_number'),array('class'=>'')) !!}
{!! Form::text('unique_number',$borrower->unique_number, array('class' => 'form-control', 'placeholder'=>translate('unique_number'))) !!}
</div>
<!--
<div class="col-md-4">
{!! Form::label('country',translate('country')." *",array('class'=>'')) !!}
{!! Form::select('country_id',$countries,$borrower->country_id,array('class'=>'form-control select2','placeholder'=>'','required'=>'required')) !!}
</div>
-->
</div>
</div>
<div class="form-group">
<div class="row">
<!--
<div class="col-md-4">
{!! Form::label('mobile',translate('mobile'),array('class'=>'')) !!}
{!! Form::text('mobile',$borrower->mobile, array('class' => 'form-control', 'placeholder'=>translate('numbers_only'))) !!}
</div>
-->
<div class="col-md-4">
{!! Form::label('email',translate('email'),array('class'=>'')) !!}
{!! Form::text('email',$borrower->email, array('class' => 'form-control', 'placeholder'=>translate('email'))) !!}
</div>
<div class="col-md-4">
{!! Form::label('dob',translate('dob'),array('class'=>'')) !!}
{!! Form::text('dob',$borrower->dob, array('class' => 'form-control date-picker', 'placeholder'=>"yyyy-mm-dd")) !!}
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-4">
{!! Form::label('phone',translate('phone'),array('class'=>'')) !!}
{!! Form::text('phone',$borrower->phone, array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>
<!--
<div class="col-md-4">
{!! Form::label('state',translate('state'),array('class'=>'')) !!}
{!! Form::text('state',$borrower->state, array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>
-->
<!--
<div class="col-md-4">
{!! Form::label('city',translate('city'),array('class'=>'')) !!}
{!! Form::text('city',$borrower->city, array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>-->
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-4">
{!! Form::label('address',translate('address'),array('class'=>'')) !!}
{!! Form::text('address',$borrower->address, array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>
<!--
<div class="col-md-4">
{!! Form::label('zip',translate('zip'),array('class'=>'')) !!}
{!! Form::text('zip',$borrower->zip, array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>-->
<div class="col-md-4">
{!! Form::label('business_name',translate('business'),array('class'=>'')) !!}
{!! Form::text('business_name',$borrower->business_name, array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-4">
{!! Form::label('working_status',translate('working_status'),array('class'=>'')) !!}
{!! Form::select('working_status',array('Employee'=>translate('Employee'),'Owner'=>translate('Owner'),'Student'=>translate('Student'),'Overseas Worker'=>translate('Overseas Worker'),'Pensioner'=>translate('Pensioner'),'Unemployed'=>translate('Unemployed')),$borrower->working_status, array('class' => 'form-control',)) !!}
</div>
<div class="col-md-4">
{!! Form::label('id_card_number',translate('id_card_number'),array('class'=>'')) !!}
{!! Form::text('id_card_number',$borrower->id_card_number, array('class' => 'form-control', 'placeholder'=>translate('id_card_number'))) !!}
</div>
<div class="col-md-4">
{!! Form::label('place_of_birth',translate('place_of_birth'),array('class'=>'')) !!}
{!! Form::text('place_of_birth',$borrower->place_of_birth, array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-4">
{!! Form::label('photo',translate('photo'),array('class'=>'')) !!}
{!! Form::file('photo', array('class' => 'form-control', 'placeholder'=>"")) !!}
@if(!empty($borrower->photo))
<a class="fancybox" rel="group" href="{{ url(asset('uploads/'.$borrower->photo)) }}"> <img
src="{{ url(asset('uploads/'.$borrower->photo)) }}" width="120"/></a>
@endif
</div>
<div class="col-md-4">
{!! Form::label('files',translate('file'). ' '.translate('borrower_file_types'),array('class'=>'')) !!}
{!! Form::file('files[]', array('class' => 'form-control', 'multiple'=>"")) !!}
@foreach(unserialize($borrower->files) as $key=>$value)
<span id="file_{{$key}}_span"><a href="{!!asset('uploads/'.$value)!!}"
target="_blank">{!! $value!!}</a> <button value="{{$key}}"
id="{{$key}}"
onclick="delete_file(this)"
type="button"
class="btn btn-danger btn-xs">
<i class="fa fa-trash"></i></button> </span><br>
@endforeach
</div>
</div>
</div>
<div class="form-group">
{!! Form::label('notes',translate('description'),array('class'=>'')) !!}
{!! Form::textarea('notes',$borrower->notes, array('class' => 'form-control', 'placeholder'=>"",'rows'=>'3')) !!}
</div>
<!--
<p class="bg-navy disabled color-palette">{{translate('login detail')}}</p>
<div class="form-group">
<div class="row">
<div class="col-md-4">
{!! Form::label('username',translate('username'),array('class'=>'')) !!}
{!! Form::text('username',$borrower->username, array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>
<div class="col-md-4">
{!! Form::label('password',translate('password'),array('class'=>'')) !!}
{!! Form::password('password', array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>
<div class="col-md-4">
{!! Form::label('repeatpassword',translate('repeat_password'),array('class'=>'')) !!}
{!! Form::password('repeatpassword', array('class' => 'form-control', 'placeholder'=>"")) !!}
</div>
</div>
</div>
<div class="form-group">
{!! Form::label('loan_officers',translate('loan_officer_access'),array('class'=>'')) !!}
{!! Form::select('loan_officers[]',$user,unserialize($borrower->loan_officers), array('class' => 'form-control select2','multiple'=>'')) !!}
</div>
-->
<!--
<p class="bg-navy disabled color-palette">{{translate('custom_field')}}</p>
@foreach($custom_fields as $key)
<div class="form-group">
{!! Form::label($key->id,$key->name,array('class'=>'')) !!}
@if($key->field_type=="number")
<input type="number" class="form-control" name="{{$key->id}}"
@if($key->required==1) required
@endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first()->name}} @endif">
@endif
@if($key->field_type=="textfield")
<input type="text" class="form-control" name="{{$key->id}}"
@if($key->required==1) required
@endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first()->name}} @endif">
@endif
@if($key->field_type=="date")
<input type="text" class="form-control date-picker" name="{{$key->id}}"
@if($key->required==1) required
@endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first()->name}} @endif">
@endif
@if($key->field_type=="textarea")
<textarea class="form-control" name="{{$key->id}}"
@if($key->required==1) required @endif>@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first()->name}} @endif</textarea>
@endif
@if($key->field_type=="decimal")
<input type="text" class="form-control touchspin" name="{{$key->id}}"
@if($key->required==1) required
@endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$borrower->id)->where('category','borrowers')->first()->name}} @endif">
@endif
</div>
@endforeach
</div>
-->
<!-- /.panel-body -->
<div class="panel-footer">
<div class="heading-elements">
<button type="submit" class="btn btn-primary pull-right">{{translate('save')}}</button>
</div>
</div>
{!! Form::close() !!}
</div>
<!-- /.box -->
@endsection
@section('footer-scripts')
<script>
function delete_file(e) {
var id = e.id;
swal({
title: 'Are you sure?',
text: '',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Ok',
cancelButtonText: 'Cancel'
}).then(function () {
$.ajax({
type: 'GET',
url: "{!! url('borrower/'.$borrower->id) !!}/delete_file?id=" + id,
success: function (data) {
$("#file_" + id + "_span").remove();
swal({
title: 'Deleted',
text: 'File successfully deleted',
type: 'success',
showCancelButton: false,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Ok',
timer: 2000
})
}
});
})
}
</script>
@endsection