File: /home/ser65kty/cardedeu.serversmw.com/resources/views/ofertashome.blade.php
@extends('layouts.app')
@section('metadata')
<title>Ofertes de feina - Ajuntament de Cardedeu</title>
@endsection
@section('css')
<link rel="stylesheet" href="//cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css">
<script src="//cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js" ></script>
@endsection
@section('content')
<section class="cabecera">
<div class="container">
<div class="">
<br>
<h2 class="text-center">Ofertes de feina</h2><br>
<div class="afegiroferta"><a href="/publicaroferta">Publicar oferta de feina</a></div>
<br>
<table class="table table-striped table-bordered" id="tablaofertas">
<thead>
<th>Número oferta</th>
<th>Títol</th>
<!--<th>Descripció</th>
<th class="select-filter">Municipi</th>
<th>Data publicació</th>-->
</thead>
<tbody>
@foreach($ofertas as $oferta)
<tr id="{{ $oferta->id }}" name="{{ $oferta->name }}">
<td>{{ $oferta->numerooferta }}</td>
<td><a href="{{$oferta->link}}" target="_blank" class="ofertaslinkhome"><h2>{{$oferta->name}}</h2></a></td>
<!--<td>{!!$oferta->descripciocurta!!}</td>
<td>{{$oferta->municipi}}</td>
<td>{{ App\Helpers\helpers::getdatedayhelper($oferta->datapublicacio) }}</td>-->
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</section>
<div class="clearfix"></div>
@endsection
@section('bottomscripts')
<script>
$(document).ready(function() {
//$.fn.dataTable.ext.search.pop(); -> posible reset
var oTable = $('#tablaofertas').DataTable( {
"order": [[ 0, "desc" ]],
responsive : true,
"language": {
search: "",
emptyTable: "No hi ha ofertes",
zeroRecords: "No hi ha ofertes per aquesta cerca",
lengthMenu: "Mostrar _MENU_ ofertes",
info: "Mostrant _START_ a _END_ de _TOTAL_ ofertes",
infoEmpty: "No hi ha ofertes",
infoFiltered: "(filtrat de _MAX_ ofertes en total)",
searchPlaceholder: "Buscar...",
selectPlaceholder: "Buscar...",
paginate: {
first: "Primer",
previous: "Anterior",
next: "Següent",
last: "Últim"
},
},
"dom": '<"datatablesofertas"f><l<t>ip>',
"columnDefs": [ {
"searchable": false,
"orderable": false,
"targets": [],
} ],
initComplete: function () {
// Remove accented character from search input as well
$('#tablaofertas_filter input').keyup( function () {
oTable
.search(
jQuery.fn.DataTable.ext.type.search.string( this.value )
)
.draw()
} );
//end remove special characters
this.api().columns('.select-filter').every( function () {
var column = this;
var th = $("#tablaofertas").find("th").eq(column.index());
var select = $('<select class="form-control"><option value="">' + 'Filtrar ' + th.text() + '</option></select>')
//.appendTo( $(column.footer()).empty() )
.appendTo( $('.datatablesofertas'))
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
}
} );
} );
</script>
@endsection