@include('header')
@include('navigator_menu_principal') 
<div class="containerbig">

    <div class="row">
        <div class="col-md-10 h3">Valorizar campos de documentos de {{$cli->nombre_cliente}}</div>
        <div class="col-md-2 text-right"><button type="button" class="btn btn-fidelitas btn-primary" onclick="location.href='/led/led-clientes'">Volver a clientes</button></div>
    </div>

	<table class="table table-bordered table-condensed table-striped" id="tablaDocumentos">
		<thead>
			<tr>
				<th class="text-left">Set de Documentos</th>
				<th class="text-left">Documento</th>
                <th class="text-left"></th>
			</tr>
		</thead>
		<tbody>
             @FOREACH ($tipo_doc AS $doc)
               <tr>
               <td class="text-left">{{$doc->nombre_set}}</td>  
               <td class="text-left">{{$doc->nombre_tipo_doc}}</td>
               <td><a href="#" class="btn btn-fidelitas btn-primary valorizar" data-cliente = "{{$cli->cliente}}" data-set="{{$doc->set_doc}}" data-doc="{{$doc->tipo_doc}}"></i>Valorizar campos</a></td>
               </tr>
             @ENDFOREACH
		</tbody>
	</table>
</div>

<form method="post" name="frmValorizar" action="/led/led-valoracion-campos-documentos-2">
    <input type="hidden" name="_token" value="{{csrf_token()}}">
    <input type="hidden" name="cliente" value="">
    <input type="hidden" name="set" value="">
    <input type="hidden" name="doc" value="">
</form>


<script type="text/javascript">
    $(document).ready(function() {
        $('#tablaDocumentos').DataTable({
            "pagingType": "full_numbers",
            "dom" : "p<'row'>f<t>lp",
            "ordering": true,
            "columns": [ null, null,{ "orderable": false } ],
            "searching": true,
            "order": [[ 0, "asc" ],[ 1 , "asc"]],
            "info":  true,
            "lengthMenu": [ [10, 25, 50, 100, -1], [10, 25, 50, 100,"Todos"] ],
            "pageLength": 25,
            "language": {
                "lengthMenu": "Mostrar _MENU_ registros por página",
                "zeroRecords": "No se encontraron resultados",
                //"info": "Mostrando página _PAGE_ de _PAGES_",
                //"info": "Total de Registros: _MAX_", 
                "info": "Mostrando  _START_  de  _END_ - <b>Total:</b> _TOTAL_ registros",
                "infoEmpty": "No hay registros disponibles",
                "infoFiltered": "(filtered from _MAX_ total records)",
                "sSearch": "Buscar",
                "oPaginate": {
                    "sFirst": "Primera",
                    "sPrevious": "Anterior",
                    "sNext": "Siguiente",
                    "sLast": "Última"
                },
            }
        });
    });

    $(document).on('click', '.valorizar', function(e) {
        e.preventDefault();
        document.forms['frmValorizar'].cliente.value = $(this).data('cliente');
        document.forms['frmValorizar'].set.value = $(this).data('set');
        document.forms['frmValorizar'].doc.value = $(this).data('doc');
        document.forms['frmValorizar'].submit();

    });


</script>

@include('footer')
