<?php /*
    Autor: Giovanni López O.
    @gmlo_89
*/ ?>

<?php $__env->startSection('content'); ?>
	<header>
		<h1 class="module-title"><span class="glyphicon glyphicon-user"></span><?php echo trans('customers::label.module_name'); ?></h1>
    </header>
    <?php echo Alert::render(); ?>
    <div class="row btn-bar">
    	<div class="btn-group pull-left">
			<a href="<?php echo url('admin'); ?>" class="btn btn-default"><?php echo trans('dashboard::label.go_home'); ?></a>
		</div>
		<div class="btn-group pull-right">
			<a href="<?php echo url('admin/customers/add'); ?>" class="btn btn-info"><span class="glyphicon glyphicon-plus"></span> <?php echo trans('customers::label.add_customer'); ?></a>
		</div>
    </div>
    <table class="table table-hover table-bordered" id="tablaPrincipal">
		<thead>
			<tr>
				<th><?php echo trans('customers::label.name'); ?></th>
				<th><?php echo trans('customers::label.description'); ?></th>
			</tr>
		</thead>
	</table>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
	
	<script>
		$(document).ready(function() {
		    $('#tablaPrincipal').dataTable({
		    	"oLanguage": {
		    		"sUrl": inncore.lang_dir+"datatables.txt"
		    	},
		    	"bProcessing": true,
		        "bServerSide": true,
		        "sAjaxSource": inncore.url_base+"/admin/customers/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/monitors/"+id;
			});
		});
	</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('dashboard::master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>