KUJUNTI.ID MINISH3LL
Path : /var/www/html/thb_loan_system/resources/views/guarantor/
(S)h3ll Cr3at0r :
F!le Upl0ad :

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/guarantor/edit.blade.php


@extends('layouts.master')
@section('title')
    {{translate('edit guarantor')}}
@endsection
@section('content')
    <div class="panel panel-white">
        <div class="panel-heading">
            <h6 class="panel-title">{{translate('edit guarantor')}}</h6>

            <div class="heading-elements">

            </div>
        </div>
        {!! Form::open(array('url' => url('guarantor/'.$guarantor->id.'/update'), 'method' => 'post', 'name' => 'form',"enctype"=>"multipart/form-data")) !!}
        <div class="panel-body">
            <div class="col-md-12">
                <p class="bg-navy disabled color-palette">{{translate('required field')}}</p>

                <div class="form-group">
                    {!! Form::label('first_name',translate('first_name'),array('class'=>'')) !!}
                    {!! Form::text('first_name',$guarantor->first_name, array('class' => 'form-control', 'placeholder'=>translate('first_name'),'required'=>'required')) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('last_name',translate('last_name'),array('class'=>'')) !!}
                    {!! Form::text('last_name',$guarantor->last_name, array('class' => 'form-control', 'placeholder'=>translate('last_name'),'required'=>'required')) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('gender',translate('gender'),array('class'=>'')) !!}
                    {!! Form::select('gender',array('Male'=>translate('Male'),'Female'=>translate('Female')),$guarantor->gender, array('class' => 'form-control','required'=>'required')) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('id_card_number',translate('id_card_number'),array('class'=>'')) !!}
                    {!! Form::text('id_card_number',$guarantor->id_card_number, array('class' => 'form-control', 'placeholder'=>translate('id_card_number'),'required'=>'required')) !!}
                </div>

                <div class="form-group">
                    {!! Form::label('country',translate('country'),array('class'=>'')) !!}
                    {!! Form::select('country_id',$countries,$guarantor->country_id,array('class'=>'form-control select2','placeholder'=>'','required'=>'required')) !!}
                </div>
                <p class="bg-navy disabled color-palette">{{translate('optional field')}}</p>

                <div class="form-group">
                    {!! 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')),$guarantor->title, array('class' => 'form-control',)) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('mobile',translate('mobile'),array('class'=>'')) !!}
                    {!! Form::text('mobile',$guarantor->mobile, array('class' => 'form-control', 'placeholder'=>translate('numbers_only'))) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('email',translate('email'),array('class'=>'')) !!}
                    {!! Form::text('email',$guarantor->email, array('class' => 'form-control', 'placeholder'=>translate('email'))) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('unique_number',translate('unique_number'),array('class'=>'')) !!}
                    {!! Form::text('unique_number',$guarantor->unique_number, array('class' => 'form-control', 'placeholder'=>translate('unique_number'))) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('dob',translate('dob'),array('class'=>'')) !!}
                    {!! Form::text('dob',$guarantor->dob, array('class' => 'form-control date-picker', 'placeholder'=>translate('dob'))) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('address',translate('address'),array('class'=>'')) !!}
                    {!! Form::text('address',$guarantor->address, array('class' => 'form-control', 'placeholder'=>"")) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('city',translate('city'),array('class'=>'')) !!}
                    {!! Form::text('city',$guarantor->city, array('class' => 'form-control', 'placeholder'=>"")) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('state',translate('state'),array('class'=>'')) !!}
                    {!! Form::text('state',$guarantor->state, array('class' => 'form-control', 'placeholder'=>"")) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('zip',translate('zip'),array('class'=>'')) !!}
                    {!! Form::text('zip',$guarantor->zip, array('class' => 'form-control', 'placeholder'=>"")) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('phone',translate('phone'),array('class'=>'')) !!}
                    {!! Form::text('phone',$guarantor->phone, array('class' => 'form-control', 'placeholder'=>"")) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('business_name',translate('business'),array('class'=>'')) !!}
                    {!! Form::text('business_name',$guarantor->business_name, array('class' => 'form-control', 'placeholder'=>"")) !!}
                </div>
                <div class="form-group">
                    {!! 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')),$guarantor->working_status, array('class' => 'form-control')) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('photo',translate('photo'),array('class'=>'')) !!}
                    {!! Form::file('photo', array('class' => 'form-control', 'placeholder'=>"")) !!}
                    @if(!empty($guarantor->photo))
                        <a class="fancybox" rel="group" href="{{ url(asset('uploads/'.$guarantor->photo)) }}"> <img
                                    src="{{ url(asset('uploads/'.$guarantor->photo)) }}" width="120"/></a>
                    @endif
                </div>
                <div class="form-group">
                    {!! Form::label('notes',translate('description'),array('class'=>'')) !!}
                    {!! Form::textarea('notes',$guarantor->notes, array('class' => 'form-control', 'placeholder'=>"")) !!}
                </div>
                <div class="form-group">
                    {!! Form::label('files',translate('file'). ' '.translate('borrower_file_types'),array('class'=>'')) !!}
                    {!! Form::file('files[]', array('class' => 'form-control', 'multiple'=>"")) !!}
                    <div class="col-sm-12">
                        {{translate('select_thirty_files')}}<br>
                        @foreach(unserialize($guarantor->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 class="form-group">
                    <hr>
                </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',$guarantor->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$guarantor->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',$guarantor->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$guarantor->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',$guarantor->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$guarantor->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',$guarantor->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$guarantor->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',$guarantor->id)->where('category','borrowers')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$guarantor->id)->where('category','borrowers')->first()->name}} @endif">
                        @endif

                    </div>
                @endforeach
                <p style="text-align:center; font-weight:bold;">
                    <small><a href="{{url('custom_field/create')}}" target="_blank">Click here to add custom fields
                            on this page</a></small>
                </p>

            </div>
        </div>
        <!-- /.panel-body -->
        <div class="panel-footer">
            <button type="submit" class="btn btn-primary pull-right">{{translate('save')}}</button>
        </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/'.$guarantor->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

© KUJUNTI.ID