@extends('layouts.app')

@section('title',"articulos")

@section('content')
<div class="card">
	<div class="card-header header-elements-inline">
		<h5 class="card-title"><i class="icon-clipboard "></i> Articulos </h5>
		<div class="header-elements">
			<div class="list-icons">
        		<a class="list-icons-item" data-action="collapse"></a>
        		<a class="list-icons-item" data-action="reload"></a>
        		<a class="list-icons-item" data-action="remove"></a>
        	</div>
    	</div>
	</div>
	<div class="card-body mt-2">
		<div class="row">
			<div class="col-6">
				@include('layouts.buttons.button-create',['buttons'=> array(
	                array(
	                  'modal'=>'no',
	                  'url'=>url('articulos/create'),
	                  'class'=>" btn btn-primary",
	                  'icon'=>"icon-database-add",
	                  'text' => "Crear articulo"
	                )
            	)])	
			</div>
			<div class="col-6 text-right">
				<a href="#" class="btn btn-primary" data-all="all"  data-url="{{ url('automattic') }}" onclick="sincroniza_art(this); return false">
				  <i class="icon-spinner9"></i> Sincronizar Articulos
				</a>			
			</div>
		</div>
	</div>
	<table class="table table-bordered table-hover datatable">
		<thead>
			<th>id</th>
			<th>Nombre </th>
			<th>Precio</th>
			<th>Cantidad</th>
			<th>U/M</th>
			<th width="20%">Acciones</th>
		</thead>
	</table>
</div>
<div class="response-ajax"></div>
	@section('scripts')
	<script>
		var url = 'articulos';
		var columns = [
		        {data: 'id'},
		        {data: 'nombre'},
		        {data: 'precio'},
		        {data: 'cantidad'},
		        {data: 'um'},
		        {data: 'action'},
		    ];
	</script>
	<script src="{!! asset('assets/datatables/datatables_basic.js') !!}"></script>
	<script src="{!! asset('assets/views_functions/articulos.js') !!}"></script>
	@endsection
@endsection