<div class="row">
	<div class="col-md-12">
		<div class="ibox">
			<div class="ibox-content">
				<div class="row">
					<div class="col-md-12">
						<button id="nueva-cotizacion-btn" type="button" class="btn btn-primary"><i class="fa fa-plus" style=""></i> Nueva cotizaci&oacute;n</button>
					</div>
				</div>
				<div class="hr-line-dashed"></div>
				<div class="row m-t-md">
					<div id="cotizaciones-table-wrapper">
						<div class="table-responsive">
							<table id="cotizaciones-table" class="display table" style="width: 100%; cellspacing: 0;">
								<thead>
									<tr>
										<th>Fecha</th>
										<th>Cliente</th>
										<th>Vendedor</th>
										<th>Acciones</th>
									</tr>
								</thead>
									<!--<tr>
										<td>30-08-2015 11:42</td>
										<td>Ronald Sifredo Amaya</td>
										<td>Carlos Ulises Portillo</td>
										<td>$450.00</td>
										<td>
											<a class="btn btn-info btn-xs" target="_blank" href="<?php echo base_url('reportes/reporte_cotizacion?id=');?>3">Exportar</a>
											<button class="btn btn-warning btn-xs">Modificar</button>
											<button class="btn btn-danger btn-xs">Eliminar</button>
										</td>
									</tr>-->
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
	 </div>
</div>
<script>
$(document).ready(function(){
	cotizaciones.setUrl('<?php echo base_url();?>');
	
	$('#nueva-cotizacion-btn').on('click', function(e) {
        Custombox.open({
            target:"<?php echo base_url('transacciones/cotizacion_nueva')?>",
            effect: 'fadein',
			overlayClose:false
        });
        e.preventDefault();
    });
	
	$("#cotizaciones-table").DataTable({
		"processing": true,
		"order": [ 0, 'desc' ],
		"serverSide": true,
		"ajax": {
			"url": "<?php echo base_url();?>transacciones/cargar_cotizaciones",
			"type": "POST"
		},
		"columnDefs": [
			{ "width": "25%", "targets": 0 },
			{ "width": "25%", "targets": 1 },
			{ "width": "25%", "targets": 2 },
			{ "width": "25%", "targets": 3 }
		],
		"language": {
			"emptyTable":     "",
			"lengthMenu": "Mostrar _MENU_ registros por pagina",
			"zeroRecords": "",
			"info": "Pagina _PAGE_ de _PAGES_",
			"infoEmpty": "No hay registros",
			"infoFiltered": "(Ningun resultado encontrado de _MAX_ registros)",
			"search":         "Buscar:",
			"processing":     '<div class="sk-circle"><div class="sk-circle1 sk-child"></div><div class="sk-circle2 sk-child"></div><div class="sk-circle3 sk-child"></div><div class="sk-circle4 sk-child"></div><div class="sk-circle5 sk-child"></div><div class="sk-circle6 sk-child"></div><div class="sk-circle7 sk-child"></div><div class="sk-circle8 sk-child"></div><div class="sk-circle9 sk-child"></div><div class="sk-circle10 sk-child"></div><div class="sk-circle11 sk-child"></div><div class="sk-circle12 sk-child"></div></div>',
			"loadingRecords": '<div class="sk-circle"><div class="sk-circle1 sk-child"></div><div class="sk-circle2 sk-child"></div><div class="sk-circle3 sk-child"></div><div class="sk-circle4 sk-child"></div><div class="sk-circle5 sk-child"></div><div class="sk-circle6 sk-child"></div><div class="sk-circle7 sk-child"></div><div class="sk-circle8 sk-child"></div><div class="sk-circle9 sk-child"></div><div class="sk-circle10 sk-child"></div><div class="sk-circle11 sk-child"></div><div class="sk-circle12 sk-child"></div></div>',
			"paginate": {
				"first":      "Primero",
				"last":       "Ultimo",
				"next":       "Siguiente",
				"previous":   "Anterior"
			}
		},
		"bAutoWidth": false
	});
});
</script>