ultimatepos/Modules/AssetExchange/Resources/views/appraisals/index.blade.php

72 lines
3.1 KiB
PHP

@extends('layouts.app')
@section('title', __('assetexchange::lang.appraisals'))
@section('content')
@include('assetexchange::layouts.nav')
<section class="content no-print mt-page">
<div class="mt-page-header">
<h1><i class="fas fa-search-dollar" style="color:#3b82f6;margin-left:8px;"></i> @lang('assetexchange::lang.appraisals')</h1>
@can('aex.appraisals.create')
<a href="{{ action([\Modules\AssetExchange\Http\Controllers\AppraisalController::class, 'create']) }}" class="mt-btn-primary btn">
<i class="fa fa-plus"></i> @lang('assetexchange::lang.new_appraisal')
</a>
@endcan
</div>
<div class="mt-card">
<div class="mt-card-header"><h3 class="mt-card-title">@lang('assetexchange::lang.all_appraisals')</h3></div>
<div class="mt-card-body">
<div class="row" style="margin-bottom:12px;">
<div class="col-md-3">
{!! Form::select('status', ['' => __('assetexchange::lang.all')] + $statuses, null, ['class' => 'form-control select2 aex-filter-status', 'style' => 'width:100%']) !!}
</div>
<div class="col-md-3">
<button type="button" class="btn btn-primary aex-apply-filters"><i class="fa fa-filter"></i> @lang('assetexchange::lang.apply_filters')</button>
</div>
</div>
<div class="table-responsive">
<table class="table table-bordered table-striped" id="aex_appraisals_table" style="width:100%">
<thead>
<tr>
<th>@lang('assetexchange::lang.appraisal_number')</th>
<th>@lang('assetexchange::lang.listing_title')</th>
<th>@lang('assetexchange::lang.appraiser')</th>
<th>@lang('assetexchange::lang.as_is_value')</th>
<th>@lang('assetexchange::lang.status')</th>
<th>@lang('assetexchange::lang.action')</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</section>
@endsection
@section('javascript')
<script type="text/javascript">
$(document).ready(function() {
$('.select2').select2();
var table = $('#aex_appraisals_table').DataTable({
processing: true,
serverSide: true,
ajax: {
url: '{{ action([\Modules\AssetExchange\Http\Controllers\AppraisalController::class, "index"]) }}',
data: function(d) { d.status = $('.aex-filter-status').val(); }
},
columns: [
{ data: 'appraisal_number', name: 'appraisal_number' },
{ data: 'listing_title', name: 'listing_title', orderable: false },
{ data: 'appraiser_name', name: 'appraiser_name', orderable: false },
{ data: 'as_is_fmt', name: 'as_is_value' },
{ data: 'status_label', name: 'status' },
{ data: 'action', name: 'action', orderable: false, searchable: false }
]
});
$('.aex-apply-filters').on('click', function() { table.ajax.reload(); });
});
</script>
@endsection