| Path : /var/www/html/thb_loan_system/storage/framework/views/ |
|
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/storage/framework/views/2885f607864dc91372e3399da00037089bd1ee3b.php |
<?php $__env->startSection('title'); ?>
<?php echo e(translate('edit loan')); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="panel panel-white">
<div class="panel-heading">
<h6 class="panel-title"><?php echo e(translate('edit loan')); ?></h6>
<div class="heading-elements">
</div>
</div>
<?php echo Form::open(array('url' => url('loan/'.$loan->id.'/update'), 'method' => 'post', 'class' => 'form-horizontal',"enctype"=>"multipart/form-data",'id'=>'loan_form')); ?>
<div class="panel-body">
<div class="form-group">
<?php echo Form::label('borrower_id',translate('borrower')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::select('borrower_id',$borrowers,$loan->borrower_id, array('class' => ' select2 form-control', 'placeholder'=>"Select",'required'=>'required')); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('loan_officer_id',translate('loan_officer')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::select('loan_officer_id',$users,$loan->loan_officer_id, array('class' => ' select2 form-control', 'placeholder'=>"Select",'required'=>'required')); ?>
</div>
<div class="col-sm-4">
<i class="icon-info3" data-toggle="tooltip" title="Select the officer in charge of the loan"></i>
</div>
</div>
<div class="form-group">
<?php echo Form::label('loan_product_id',translate('loan').' '.translate('product')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::select('loan_product_id',$loan_products,$loan->loan_product_id, array('class' => ' select2 form-control', 'placeholder'=>"Select",'required'=>'required','id'=>'loanProduct')); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('principal',translate('principal').' '.translate('amount')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::text('principal',$loan->principal, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')); ?>
</div>
</div>
<p class="text-red"><b><?php echo e(translate('duration')); ?>:</b></p>
<div class="form-group">
<?php echo Form::label('loan_duration',translate('loan').' '.translate('duration')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-2">
<?php echo Form::number('loan_duration',$loan->loan_duration, array('class' => 'form-control', 'placeholder'=>"5",'required'=>'required')); ?>
</div>
<div class="col-sm-3">
<?php echo Form::select('loan_duration_type',array('day'=>translate('day').'(s)','week'=>translate('week').'(s)','month'=>translate('month').'(s)','year'=>translate('year').'(s)'),$loan->loan_duration_type, array('class' => 'form-control', 'placeholder'=>"","id"=>"inputMaxInterestPeriod",'required'=>'required')); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('repayment_cycle',translate('repayment_cycle')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::select('repayment_cycle',array('daily'=>translate('daily'),'weekly'=>translate('weekly'),'monthly'=>translate('monthly'),'bi_monthly'=>translate('bi_monthly'),'quarterly'=>translate('quarterly'),'semi_annual'=>translate('semi_annually'),'annual'=>translate('annual')),$loan->repayment_cycle, array('class' => 'form-control', 'placeholder'=>"","id"=>"",'required'=>'required')); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('release_date',translate('loan').' '.translate('disbursement').' '.translate('date')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::text('release_date',$loan->release_date, array('class' => 'form-control date-picker', 'placeholder'=>"yyyy-mm-dd",'required'=>'required','id'=>'releaseDate')); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('first_payment_date',translate('first').' '.translate('repayment').' '.translate('date')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::text('first_payment_date',$loan->first_payment_date, array('class' => 'form-control date-picker', 'placeholder'=>"yyyy-mm-dd",''=>'','id'=>'firstPayment')); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('interest_method',translate('interest').' '.translate('method')." *",array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::select('interest_method',array('flat_rate'=>translate('flat_rate'),'declining_balance_equal_installments'=>translate('declining_balance_equal_installments'),'declining_balance_equal_principal'=>translate('declining_balance_equal_principal'),'interest_only'=>translate('interest_only')),$loan->interest_method, array('class' => 'form-control', 'placeholder'=>"Select",'required'=>'required')); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('interest_rate',translate('loan').' '.translate('interest').' (%) *',array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-2">
<?php echo Form::text('interest_rate',$loan->interest_rate, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')); ?>
</div>
<div class="col-sm-3">
<?php echo Form::select('interest_period',array('day'=>translate('per_day'),'week'=>translate('per_week'),'month'=>translate('per_month'),'year'=>translate('per_year')),$loan->interest_period, array('class' => 'form-control', 'placeholder'=>"Select","id"=>"inputDefaultInterestPeriod",'required'=>'required')); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('pay_off_interest_rate',translate('loan').' '.translate('pay_off_interest_rate').' (%) *',array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-2">
<?php echo Form::text('pay_off_interest_rate',$loan->pay_off_interest_rate, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')); ?>
</div>
</div>
<!-- <div class="form-group">
<?php echo Form::label('override_interest',translate('override').' '.translate('interest'),array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::select('override_interest',array('0'=>translate('no'),'1'=>translate('yes')),$loan->override_interest, array('class' => 'form-control','id'=>'override_interest')); ?>
</div>
<div class="col-sm-4">
<i class="icon-info3" data-toggle="tooltip"
title="<?php echo e(translate('override_msg')); ?>"></i>
</div>
</div> -->
<!-- <div class="form-group" id="overrideDiv">
<?php echo Form::label('override_interest_amount',translate('override').' '.translate('interest').' %',array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::text('override_interest_amount',$loan->override_interest_amount, array('class' => 'form-control touchspin','id'=>'override_interest_amount')); ?>
</div>
</div> -->
<!-- <div class="form-group">
<?php echo Form::label('grace_on_interest_charged',translate('grace_on_interest'),array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::number('grace_on_interest_charged',$loan->grace_on_interest_charged, array('class' => 'form-control', 'placeholder'=>"2")); ?>
</div>
<div class="col-sm-4">
<i class="icon-info3" data-toggle="tooltip"
title="<?php echo e(translate('grace_on_interest_msg')); ?>"></i>
</div>
</div> -->
<div class="form-group">
<?php echo Form::label('decimal_places',translate('decimal_place'),array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::select('decimal_places',array('round_off_to_two_decimal'=>translate('round_off_to_two_decimal'),'round_off_to_integer'=>translate('round_off_to_integer')),$loan->decimal_places, array('class' => 'form-control', 'placeholder'=>"","id"=>"",'required'=>'required')); ?>
</div>
<div class="col-sm-4">
<i class="icon-info3" data-toggle="tooltip"
title="<?php echo e(translate('loan_decimal_msg')); ?>"></i>
</div>
</div>
<hr>
<div class="form-group">
<?php echo Form::label('description',translate('description'),array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::textarea('description',$loan->description, array('class' => 'form-control', 'rows'=>"3")); ?>
</div>
</div>
<div class="form-group">
<?php echo Form::label('files',translate('loan').' '.translate('file').'('.translate('borrower_file_types').')',array('class'=>'col-sm-3 control-label')); ?>
<div class="col-sm-5">
<?php echo Form::file('files[]', array('class' => 'form-control file-styled', 'multiple'=>"multiple")); ?>
</div>
<div class="col-sm-9">
<?php $__currentLoopData = unserialize($loan->files); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<span id="file_<?php echo e($key); ?>_span"><a href="<?php echo asset('uploads/'.$value); ?>"
target="_blank"><?php echo $value; ?></a> <button value="<?php echo e($key); ?>"
id="<?php echo e($key); ?>"
onclick="delete_file(this)"
type="button"
class="btn btn-danger btn-xs">
<i class="fa fa-trash"></i></button> </span><br>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<!-- <p class="bg-navy color-palette"><?php echo e(translate('charge')); ?></p> -->
<div class="form-group table-responsive" id="chargesDiv">
<div style="display: none;" id="saved_charges">
<?php $__currentLoopData = $loan->loan_product->charges; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<input name="charges[]" id="charge<?php echo e($key->charge_id); ?>" value="<?php echo e($key->charge_id); ?>">
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th><?php echo e(translate('name')); ?></th>
<th><?php echo e(translate('type')); ?></th>
<th><?php echo e(translate('amount')); ?></th>
<th><?php echo e(translate('collected on')); ?></th>
<th><?php echo e(translate('date')); ?></th>
</tr>
</thead>
<tbody id="charges_table">
<?php $__currentLoopData = $loan->loan_product->charges; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(!empty($key->charge)): ?>
<tr id="row<?php echo e($key->charge->id); ?>">
<td><?php echo e($key->charge->name); ?></td>
<td>
<?php if($key->charge->charge_option=="fixed"): ?>
<?php echo e(translate('fixed')); ?>
<?php endif; ?>
<?php if($key->charge->charge_option=="principal_due"): ?>
% <?php echo e(translate('principal due')); ?>
<?php endif; ?>
<?php if($key->charge->charge_option=="principal_interest"): ?>
% <?php echo e(translate('principal')); ?>
+ <?php echo e(translate('interest due')); ?>
<?php endif; ?>
<?php if($key->charge->charge_option=="interest_due"): ?>
% <?php echo e(translate('interest due')); ?>
<?php endif; ?>
<?php if($key->charge->charge_option=="total_due"): ?>
% <?php echo e(translate('total due')); ?>
<?php endif; ?>
<?php if($key->charge->charge_option=="original_principal"): ?>
% <?php echo e(translate('original principal')); ?>
<?php endif; ?>
</td>
<td>
<?php
$charge = \App\Models\LoanCharge::where('charge_id',$key->charge->id)->where('loan_id',$loan->id)->first();
if(!empty($charge)){
$charge_date=$charge->date;
$charge_amount=$charge->amount;
}else{
$charge_date="";
$charge_amount=$key->charge->amount;
}
?>
<?php if($key->charge->override==1): ?>
<input type="text" class="form-control"
name="charge_amount_<?php echo e($key->charge->id); ?>"
value="<?php echo e($charge_amount); ?>" required>
<?php else: ?>
<input type="text" class="form-control"
name="charge_amount_<?php echo e($key->charge->id); ?>"
value="<?php echo e($charge_amount); ?>">
<!-- <?php echo e($charge_amount); ?> -->
<?php endif; ?>
</td>
<td>
<?php if($key->charge->charge_type=='disbursement'): ?>
<?php echo e(translate('disbursement')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='specified_due_date'): ?>
<?php echo e(translate('specified_due_date')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='installment_fee'): ?>
<?php echo e(translate('installment_fee')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='overdue_installment_fee'): ?>
<?php echo e(translate('overdue_installment_fee')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='loan_rescheduling_fee'): ?>
<?php echo e(translate('loan_rescheduling_fee')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='overdue_maturity'): ?>
<?php echo e(translate('overdue_maturity')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='savings_activation'): ?>
<?php echo e(translate('savings_activation')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='withdrawal_fee'): ?>
<?php echo e(translate('withdrawal_fee')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='monthly_fee'): ?>
<?php echo e(translate('monthly_fee')); ?>
<?php endif; ?>
<?php if($key->charge->charge_type=='annual_fee'): ?>
<?php echo e(translate('annual_fee')); ?>
<?php endif; ?>
</td>
<td>
<?php if($key->charge->charge_type=='specified_due_date'): ?>
<input type="text" class="form-control date-picker"
name="charge_date_<?php echo e($key->charge->id); ?>"
value="<?php echo e($charge_date); ?>" required>
<?php else: ?>
<input type="hidden" class="form-control"
name="charge_date_<?php echo e($key->charge->id); ?>"
value="">
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<!-- <p class="bg-navy disabled color-palette"><?php echo e(translate('custom_field')); ?></p> -->
<?php $__currentLoopData = $custom_fields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="form-group">
<?php echo Form::label($key->id,$key->name,array('class'=>'control-label col-sm-3')); ?>
<div class="col-sm-5">
<?php if($key->field_type=="number"): ?>
<input type="number" class="form-control" name="<?php echo e($key->id); ?>"
<?php if($key->required==1): ?> required
<?php endif; ?> value="<?php if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first())): ?><?php echo e(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first()->name); ?> <?php endif; ?>">
<?php endif; ?>
<?php if($key->field_type=="textfield"): ?>
<input type="text" class="form-control" name="<?php echo e($key->id); ?>"
<?php if($key->required==1): ?> required
<?php endif; ?> value="<?php if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first())): ?><?php echo e(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first()->name); ?> <?php endif; ?>">
<?php endif; ?>
<?php if($key->field_type=="date"): ?>
<input type="text" class="form-control date-picker" name="<?php echo e($key->id); ?>"
<?php if($key->required==1): ?> required
<?php endif; ?> value="<?php if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first())): ?><?php echo e(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first()->name); ?> <?php endif; ?>">
<?php endif; ?>
<?php if($key->field_type=="textarea"): ?>
<textarea class="form-control" name="<?php echo e($key->id); ?>"
<?php if($key->required==1): ?> required <?php endif; ?>><?php if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first())): ?><?php echo e(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first()->name); ?> <?php endif; ?></textarea>
<?php endif; ?>
<?php if($key->field_type=="decimal"): ?>
<input type="text" class="form-control touchspin" name="<?php echo e($key->id); ?>"
<?php if($key->required==1): ?> required
<?php endif; ?> value="<?php if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first())): ?><?php echo e(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$loan->id)->where('category','loans')->first()->name); ?> <?php endif; ?>">
<?php endif; ?>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<!-- /.panel-body -->
<div class="panel-footer">
<div class="heading-elements">
<button type="submit" class="btn btn-primary pull-right"><?php echo e(translate('save')); ?></button>
</div>
</div>
<?php echo Form::close(); ?>
</div>
<!-- /.box -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('footer-scripts'); ?>
<script>
$(document).ready(function () {
if ($('#override_interest').val() == 0) {
$('#overrideDiv').hide();
$('#override_interest_amount').removeAttr('required');
}
if ($('#override_interest').val() == 1) {
$('#overrideDiv').show();
$('#override_interest_amount').attr('required', 'required');
}
$('#override_interest').change(function (e) {
if ($('#override_interest').val() == 0) {
$('#overrideDiv').hide();
$('#override_interest_amount').removeAttr('required');
}
if ($('#override_interest').val() == 1) {
$('#overrideDiv').show();
$('#override_interest_amount').attr('required', 'required');
}
})
});
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: "<?php echo url('loan/'.$loan->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
})
}
});
})
}
$("#loan_form").validate({
rules: {
field: {
required: true,
number: true
}
}
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/thb_loan_system/resources/views/loan/edit.blade.php ENDPATH**/ ?>