<div class="row">
	<form autocomplete='off' class='form-horizontal' name='formSaveCaja' id='formSaveCaja'  method='post' action='<?php echo base_url('administracion/guardar_caja');?>' onsubmit="cajas.guardar(event,'<?php echo (isset($caja))?'actualizado':'guardado';?>');">
		<div class="panel blank-panel">
			<div class="panel-body">
				<?php if(isset($caja) && $caja->estado_caja==1):?>
					<div class="alert alert-warning">
						<i class="fa fa-times"></i>
						No es posible realizar cambios mientras la caja se encuentre activa.
					</div>
				<?php endif;?>
				<div class="form-group">
					<label class="col-md-1 control-label">Nombre:</label>
					<div class="col-md-4">
						<input type="hidden" name="id_caja" value="<?php echo (isset($caja))?$caja->id_caja:"";?>">
						<input type="text" class="form-control" name="nombre_caja" value="<?php echo (isset($caja))?$caja->nombre_caja:"";?>" required <?php if(isset($caja) && $caja->estado_caja==1):?>readonly<?php endif;?>>
					</div>
					<label class="col-md-1 control-label">Dir. IP:</label>
					<div class="col-md-3">
						<input type="text" class="form-control" name="direccion_ip_caja" value="<?php echo (isset($caja))?$caja->direccion_ip_caja:"";?>" data-inputmask="'alias': 'ip'" data-mask required <?php if(isset($caja) && $caja->estado_caja==1):?>readonly<?php endif;?>>
					</div>
				</div>
				<div class="hr-line-dashed"></div>
				<h3>Impresores</h3>
				<div class="form-group">
					<label class="col-md-1 control-label">Ticket:</label>
					<div class="col-md-3">
						<input type="text" class="form-control" name="printer_receipt" value="<?php echo (isset($caja))?$caja->printer_receipt:"";?>" <?php if(isset($caja) && $caja->estado_caja==1):?>readonly<?php endif;?>>
					</div>
					<label class="col-md-1 control-label">Auditoria:</label>
					<div class="col-md-3">
						<input type="text" class="form-control" name="printer_journal" value="<?php echo (isset($caja))?$caja->printer_journal:"";?>" <?php if(isset($caja) && $caja->estado_caja==1):?>readonly<?php endif;?>>
					</div>
					<label class="col-md-1 control-label">Impresos:</label>
					<div class="col-md-3">
						<input type="text" class="form-control" name="printer_slip" value="<?php echo (isset($caja))?$caja->printer_slip:"";?>" <?php if(isset($caja) && $caja->estado_caja==1):?>readonly<?php endif;?>>
					</div>
				</div>
				
				<?php if(isset($caja) && $caja->estado_caja==1):?>
				<div class="form-group text-center">
					<button type="button" class="btn btn-danger btn-rounded" onclick="Custombox.close();">Cancelar</button>
				</div>
				<?php else:?>
				<div class="form-group text-center">
					<button type="button" class="btn btn-danger btn-rounded" onclick="Custombox.close();">Cancelar</button>
					<button type="submit" class="btn btn-primary btn-rounded" id="guardar-caja">Guardar caja</button>
				</div>
				<?php endif;?>
			</div>
		</div>
	</form>
</div>
<script>
	$(document).ready(function() {		
		$("[data-mask]").inputmask();		
	});
</script>