File: /var/www/vhost/disk-apps/dev-beg.teky.com.co/resources/views/items/list.blade.php
@extends('layouts.master')
@section('page-css')
<link rel="stylesheet" href="{{ asset('assets/styles/vendor/datatables.min.css') }}">
@endsection
@section('main-content')
<div class="breadcrumb">
<h1> @lang('items')</h1>
@can('item_create')
<a class="nav-item-hold button_header" href="{{ route('items.create') }}" data-toggle="tooltip" data-placement="top"
title="@lang('create_item')">
<i class="nav-icon i-Add"></i>
</a>
@endcan
</div>
<div class="separator-breadcrumb border-top"></div>
<section class="contact-list">
<div class="row">
<div class="col-md-12 mb-4">
<div class="card text-left">
<div class="card-body">
<div class="table-responsive">
<table id="table-list" class="display table " style="width:100%">
<thead>
<tr>
<th>@lang('name')</th>
<th>@lang('part')</th>
<th>@lang('measurement_unit')</th>
<th>@lang('supplier1')</th>
<th>@lang('supplier2')</th>
<th>@lang('remarks')</th>
<th>@lang('url_data_sheet')</th>
<th>@lang('actions')</th>
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
<td>{{ $item->name }}</td>
<td>{{ $item->code }}</td>
<td>{{ $item->measurement_unit }}</td>
<td>{{ $item->supplier1 }}</td>
<td>{{ $item->supplier2 }}</td>
<td>{{ $item->remarks }}</td>
<td><a href="{{ $item->url_data_sheet }}" target="_blank">@lang('open')</a></td>
<td>
@can('item_edit')
<a href="{{ route('items.edit', ['id' => $item->id]) }}"
class="ul-link-action text-success" data-toggle="tooltip"
data-placement="top" title="@lang('edit')" onclick="saveIndexTable()">
<i class="i-Edit"></i>
</a>
@endcan
@can('item_destroy')
<span class="ul-link-action text-danger mr-1" data-toggle="tooltip"
data-placement="top" title="@lang('delete')"
onclick="deleteRegistry({{ $item->id }}); saveIndexTable()">
<i class="i-Eraser-2"></i>
</span>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
@section('page-js')
<script src="{{ asset('assets/js/vendor/datatables.min.js') }}"></script>
<script src="{{ asset('assets/js/tooltip.script.js') }}"></script>
<script src="{{ asset('js/views/items.js') }}"></script>
@if (env('APP_LANGUAGE') == "es")
<script>
_table = $("#table-list").DataTable({
order: [],
language: {
url: "https://cdn.datatables.net/plug-ins/1.10.19/i18n/Spanish.json"
}
});
setTimeout(function() {
if (localStorage.getItem("setPageTable") == "true") {
var index = parseInt(localStorage.getItem("tableIndex"));
_table.page(index).draw(false);
}
}, 500);
setTimeout(function() {
localStorage.setItem("tableIndex", 0);
localStorage.setItem("setPageTable", false);
}, 500);
</script>
@else
<script>
_table = $('#table-list').DataTable({
order: [],
});
setTimeout(function() {
if (localStorage.getItem("setPageTable") == "true") {
var index = parseInt(localStorage.getItem("tableIndex"));
_table.page(index).draw(false);
}
}, 500);
setTimeout(function() {
localStorage.setItem("tableIndex", 0);
localStorage.setItem("setPageTable", false);
}, 500);
</script>
@endif
@endsection