@extends('dashboard::master')
{{--
    Autor: Giovanni López O.
    @gmlo_89
--}}

@section('content')
	<header>
		<h1 class="module-title"><span class="glyphicon glyphicon-align-left"></span>Registros</h1>
    </header>
    {{ Alert::render() }}
    <div class="row btn-bar">
    	<div class="btn-group pull-left">
			<a href="{{ url('admin') }}" class="btn btn-default">{{ trans('dashboard::label.go_home') }}</a>
		</div
    </div>
    <table class="table table-hover table-bordered" id="tablaPrincipal">
		<thead>
			<tr>
				<th>Nombre</th>
				<th>Fecha</th>
			</tr>
		</thead>
	</table>
@stop

@section('scripts')
	
	<script>
		$(document).ready(function() {
		    $('#tablaPrincipal').dataTable({
		    	"oLanguage": {
		    		"sUrl": inncore.lang_dir+"datatables.txt"
		    	},
		    	"bProcessing": true,
		        "bServerSide": true,
		        "sAjaxSource": inncore.url_base+"/admin/records/tabla-ajax"
		    }).on('click', 'td:not(.dataTables_empty)', function(event) {
				var id = $(this).parent().find('input.id').val();
				document.location.href=inncore.url_base+"/admin/records/show/"+id;
			});
		});
	</script>
@stop