<div class="row">
		<div class="col-md-10">
			<h2><?php echo $caja->nombre_caja;?></h2>
			<span class=""><?php echo $caja->direccion_ip_caja;?></span>
			<p>
				<small><?php if($caja->estado_caja==0) echo "Inactiva"; else echo "Activa";?></small>
			</p>
		</div>
		<div class="col-md-2">
			<div class="input-group">
				<button class="btn btn-link dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v fa-2x"></i></button>
				<ul class="dropdown-menu">
					<li><a href="javascript:void(0)" <?php if($permisos_cajaop):?>id="config-fact-editar-caja"<?php else:?>onclick="error_noacces()"<?php endif;?> data-id="<?php echo $caja->id_caja;?>"><i class="fa fa-pencil"></i> Editar</a></li>
					<li><a href="javascript:void(0)" <?php if($permisos_cajaop):?>onclick="cajas.eliminar('<?php echo $caja->id_caja;?>','<?php echo $caja->nombre_caja;?>',<?php echo $caja->estado_caja;?>);"<?php else:?>onclick="error_noacces()"<?php endif;?>><i class="fa fa-times"></i> Eliminar</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="hr-line-dashed" style="margin-top:0px;"></div>
	<div class="row">
		<div class="col-sm-4">
			<div class="widget style1 navy-bg">
				<div class="row">
					<div class="col-xs-4">
						<i class="fa fa-print fa-3x"></i>
					</div>
					<div class="col-xs-8 text-right">
						<h5><?php echo ($caja->printer_receipt == "")?"N/A":$caja->printer_receipt;?></h5>
					</div>
				</div>
				<div class="row text-center">
					<small>Tickets</small>
				</div>
			</div>
			
		</div>
		<div class="col-sm-4">
		
			<div class="widget style1 lazur-bg">
				<div class="row">
					<div class="col-xs-4">
						<i class="fa fa-print fa-3x"></i>
					</div>
					<div class="col-xs-8 text-right">
						<h5><?php echo ($caja->printer_journal == "")?"N/A":$caja->printer_journal;?></h5>
					</div>
				</div>
				<div class="row text-center">
					<small>cinta de auditoria</small>
				</div>
			</div>
			
		</div>
		<div class="col-sm-4">
		
			<div class="widget style1 yellow-bg">
				<div class="row">
					<div class="col-xs-4">
						<i class="fa fa-print fa-3x"></i>
					</div>
					<div class="col-xs-8 text-right">
						<h5><?php echo ($caja->printer_slip == "")?"N/A":$caja->printer_slip;?></h5>
					</div>
				</div>
				<div class="row text-center">
					<small>Pre-impresos</small>
				</div>
			</div>
			
		</div>
		
	</div>
	<!--tabs resoluciones && cortes-->
	<div class="panel blank-panel">
		<div class="panel-heading">
			<div class="panel-options">
				<ul class="nav nav-tabs">
					<li class="active"><a data-toggle="tab" href="#c-f-cajas-cortes">Cortes</a></li>
					<li><a data-toggle="tab" href="#c-f-cajas-resoluciones">Documentos</a></li>
					
				</ul>
			</div>
			<div class="panel-body">
				 <div class="tab-content">
					<!--Cortes tab-->
					<div id="c-f-cajas-cortes" class="tab-pane active">
						<?php if($permisos_cortes):?>
						<div class="table-responsive">
							<table id="c-f-cajas-cortes-table" class="table table-striped table-hover">
								<thead>
									<tr>
										<th>ID</th>
										<th>Fecha</th>
										<th>Correlativo</th>
										<th>Tipo</th>
										<th></th>
									</tr>
								</thead>
								<tbody>
								</tbody>
							 </table>
						</div>
						<?php else:?>
						<div class="text-center">
						<small >Cortes no disponibles, consulte los permisos de su cuenta.</small>
						</div>
						<?php endif;?>
					</div>
					<!--Resoluciones tab-->									
					<div id="c-f-cajas-resoluciones" class="tab-pane">
						<div class="table-responsive">
							<table id="c-f-cajas-resoluciones-table" class="table table-striped table-hover">
								<thead>
									<tr>
										<th>ID</th>
										<th>Fecha</th>
										<th>Resolución</th>
										<th>Estado</th>
										<th></th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>16/08/2015</td>
										<td>10008-NEX-0108-2013</td>
										<td><span class="label label-info">Activa</span></td>
										<td>
											<button class="btn btn-primary btn-xs">Ver</button>
										</td>
									</tr>
									<tr>
										<td>16/08/2015</td>
										<td>10008-NEX-0108-2013</td>
										<td><span class="label">Agotada</span></td>
										<td>
											<button class="btn btn-primary btn-xs">Ver</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>								
				 </div>
			</div>
		</div>
	</div>	
	<script>
	$(document).ready(function(){
		$("#config-fact-editar-caja").click(function(){
			var id=$(this).attr('data-id');
			Custombox.open({
				target:'<?php echo base_url("administracion/nuevacaja");?>?id='+id, 
				effect: 'fadein',
				overlayClose:false,
				complete:function(){
					$(".modal-body input:text").first().focus();
				}
			});
		});
		
		 $("#c-f-cajas-cortes-table").dataTable({
			"iDisplayLength": 5,
			"aLengthMenu": [[5, 10, 25, -1], [5, 10, 25, "Todas"]],
			"bLengthChange": true,
			"processing": true,
			"order": [ 0, 'asc' ],
			"serverSide": true,
			"ajax": {
			"url": "<?php echo base_url();?>administracion/cargar_cortes",
			"type": "POST",
			"data": function ( d ) {
				d.idCaja = "<?php echo $caja->id_caja;?>";
			}
		},
			"columns": [
				{ "data": "id_corte"},
				{ "data": "fecha_corte" , "width": "30%"},
				{ "data": "correlativo_corte" , "width": "20%"},
				{ "data": "tipo_corte" , "width": "30%"},
				{ "data": "acciones", "width": "20%", "orderable": false, "searchable": false, "className" : "myTableActionClass"}
			],
			"columnDefs": [
				{
					"targets": [ 0 ],
					"visible": false,
					"searchable": false
				}
			],
			"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
		});
		
		$("#c-f-cajas-resoluciones-table").dataTable({
			"dom":'<"toolbar">frtip',
			"iDisplayLength": 5,
			"aLengthMenu": [[5, 10, 25, -1], [5, 10, 25, "Todas"]],
			"bLengthChange": true,
			"processing": true,
			"order": [ 0, 'asc' ],
			"serverSide": true,
			"ajax": {
			"url": "<?php echo base_url();?>administracion/cargar_resoluciones",
			"type": "POST",
			"data": function ( d ) {
				d.idCaja = "<?php echo $caja->id_caja;?>";
			}
		},
			"columns": [
				{ "data": "id_resolucion"},
				{ "data": "fecha_autorizacion" , "width": "30%"},
				{ "data": "num_resolucion" , "width": "30%"},
				{ "data": "estado_resolucion" , "width": "20%","className" : "myTableActionClass"},
				{ "data": "acciones", "width": "20%", "orderable": false, "searchable": false, "className" : "myTableActionClass"}
			],
			"columnDefs": [
				{
					"targets": [ 0 ],
					"visible": false,
					"searchable": false
				}
			],
			"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
		});
		$("div.toolbar").html("<button id='cajas-nueva-resolucion-btn' class='btn btn-info' type='button'>Agregar Serie</button>");
		
		
		$("#cajas-nueva-resolucion-btn").click(function(){
			Custombox.open({
				/* target:'<?php echo base_url("administracion/nueva_resolucion");?>?mode=create&caja=<?php echo $caja->id_caja;?>&resolucion=1', */
				target:'<?php echo base_url("administracion/nueva_resolucion");?>?mode=create&caja=<?php echo $caja->id_caja;?>',
				effect: 'fadein',
				complete:function(){
					$("#nuevo-cliente-modal input:text").first().focus();
				}
			});
		});
	 });
	</script>