<div class="row" id="<?php $windowid= date('YmdHis'); echo $windowid;?>">
	<form autocomplete='off' class='form-horizontal' id='formSave'  method='post' action='<?php echo base_url('administracion/guardar_meta');?>' onsubmit="usuarios.guardar_meta(event,'<?php echo (isset($meta->id_meta))?"actualizado":"guardado";?>')">
		<div class="panel blank-panel">
			<div class="panel-body">
				<!--Ocultos-->
				<div>
					<input type="hidden" id="id_usuario" name="id_usuario" value="<?php echo $usuario;?>">
					<?php if(isset($meta)):?>
					<input type="hidden" id="id_meta" name="id_meta" value="<?php echo $meta->id_meta;?>">
					<?php endif;?>
				</div>
				<div class="form-group">
					<div class="col-md-4" id="monto_meta">
						<label class="control-label">Meta:</label>
						<div class="input-group date">
							<span class="input-group-addon"><i class="fa fa-money"></i></span>
							<input type="text" class="form-control" id="monto_meta" name="monto_meta" value="<?php echo (isset($meta)?$meta->monto_meta:"");?>" required>
						</div>
					</div>
					<!--Fecha-->
					<div class="dates--metas-wrapper">
						<div class="col-md-4" id="inicio_meta">
							<label class="control-label">Fecha Inicio:</label>
							<div class="input-group date">
								<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
								<input type="text" class="form-control" id="inicio_meta" name="inicio_meta" value="<?php echo (isset($meta)?$meta->inicio_meta:"");?>" readonly required>
							</div>
						</div>
						<div class="col-md-4" id="fin_meta">
							<label class="control-label">Fecha Fin:</label>
							<div class="input-group date">
								<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
								<input type="text" class="form-control" id="fin_meta" name="fin_meta" value="<?php echo (isset($meta)?$meta->fin_meta:"");?>" readonly required>
							</div>
						</div>
					</div>
				</div>
				<!--Botones-->
				<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-meta">Guardar meta</button>
				</div>
			</div>
		</div>
	</form>
</div>
<script>
	$(document).ready(function(){
		$('.dates--metas-wrapper .input-group.date').datepicker({
			language:'es',
			autoclose:true,
			format:'yyyy-mm-dd'
		});
	});
</script>