<?php $__env->startSection('CSS'); ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/jquery.webui-popover/1.2.1/jquery.webui-popover.min.css">
<?php echo HTML::style('WebPro/plugins/bootstrap-colorpicker/css/colorpicker.css'); ?>

<?php echo HTML::style('SysWeb/SumeClientes/BootstrapMod.css'); ?>

<?php echo HTML::style('SysWeb/SumeClientes/bootstrap-custom-breakpoint.css'); ?>

<?php echo HTML::style('bootstrap-slider/bootstrap-slider.min.css'); ?>

<style type="text/css">
	.pointer{ cursor:pointer; }
	.Separacion{ display: inline-block; padding: 1px; }
	.disenhador{ background: url(<?php echo asset('SysWeb/SumeClientes/edit-bg.png'); ?>); }
	.colorpicker.dropdown-menu.alpha{ z-index: 500000000; }
	/*.BordesDiv:hover{ border-width: 1px; border-color: blue; border-style: dashed; }*/
	/*.BordesElemento:hover{ border-width: 1px; border-color: blue; border-style: dashed; }*/
	.BordesElemento:hover{ box-shadow: 0px 0px 0px 1px #03ddff; }
	.BordesElemento{ transition: box-shadow 0.3s ease-in-out 0s; }
	.SepararCampos{ display: inline-block; }

	.brd {
		border:1px solid #000;
	}
	.placeholder {
		width:300px;
		height:50px;
		background-color:#DDD;
	}
</style>
<?php echo HTML::style('jQueryUI/NT/jquery-ui.min.css'); ?>

<?php echo HTML::style('jQueryUI/NT/jquery-ui.structure.min.css'); ?>

<?php /* HTML::style('VideoJS/video-js.css') */ ?>
<?php /* HTML::script('VideoJS/videojs-ie8.min.js') */ ?>
<?php echo HTML::style('bootstrap-select/css/bootstrap-select.min.css'); ?>

<?php echo HTML::style('SysWeb/SumeClientes/EditorDeFormularios.css'); ?>

<?php
	/*
	$json = file_get_contents('https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyBHLrXP6aOOUOUmI2oA5vpfnhWQE3r32O8');
	$fonts = json_decode($json);
	foreach($fonts->items as $font){ echo '<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family='.$font->family.'">'; }
	*/
?>
<link id="Adamia" href="http://fonts.googleapis.com/css?family=Adamina" rel="stylesheet" type="text/css">
<link id="DancingScript" href="http://fonts.googleapis.com/css?family=Dancing+Script" rel="stylesheet" type="text/css">
<link id="DroidSans" href="http://fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet" type="text/css">
<link id="JustAnotherHand" href="http://fonts.googleapis.com/css?family=Just+Another+Hand" rel="stylesheet" type="text/css">
<link id="LobsterTwo" href="http://fonts.googleapis.com/css?family=Lobster+Two" rel="stylesheet" type="text/css">
<link id="Montserrat" href="http://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
<link id="NixieOne" href="http://fonts.googleapis.com/css?family=Nixie+One" rel="stylesheet" type="text/css">
<link id="OpenSans" href="http://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
<link id="Oswald" href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="text/css">
<link id="Pacifico" href="http://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet" type="text/css">
<link id="ShadowsIntoLightTwo" href="http://fonts.googleapis.com/css?family=Shadows+Into+Light+Two" rel="stylesheet" type="text/css">
<link id="TheGirlNextDoor" href="http://fonts.googleapis.com/css?family=The+Girl+Next+Door" rel="stylesheet" type="text/css">
<link id="BubblegumSans" href="http://fonts.googleapis.com/css?family=Bubblegum+Sans" rel="stylesheet" type="text/css">
<link id="LondrinaSolid" href="http://fonts.googleapis.com/css?family=Londrina+Solid" rel="stylesheet" type="text/css">
<link id="RockSalt" href="http://fonts.googleapis.com/css?family=Rock+Salt" rel="stylesheet" type="text/css">
<?php $__env->stopSection(); ?>


<?php $__env->startSection('Contenido'); ?>
<div class="row">
	<div class="col-md-12">
		<h2><i class="fa fa-envelope-o"></i> E-Mail Marketing </h2>
	</div>
</div>

<div class="row">
	<div class="col-md-12">
		<div class="block-web">
			<div class="header"> <h3 class="content-header"> Agregar formulario a <strong> <?php echo $ListaEmail->nombre; ?> </strong> </h3> </div>
			<div class="porlets-content">
				<?php echo Form::open(array('route' => array('SysWebEmailMarketingFormulariosAgregar', $ListaEmail->id), 'method' => 'post', 'class' => 'form-horizontal row-border', 'id' => 'frmAgregar', 'files' => true, 'target' => 'upload_iframe')); ?>

					<div class="form-group">
						<label class="col-sm-3 control-label"> Nombre del formulario </label>
						<div class="col-sm-9">
							<?php echo Form::text('nombre_form', '',  array('class' => 'form-control', 'placeholder' => '')); ?>

							<span class="text-danger" id="errnombre_form"> </span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Úbicación de agradecimiento </label>
						<div class="col-sm-9">
							<label class="checkbox-inline">
								<input type="checkbox" value="1" id="chUbicacion">
								<span class="custom-checkbox"></span> Deseo que permanezcan en la página
							</label>
						</div>
					</div>
					<div class="form-group" id="dvPagina">
						<label class="col-sm-3 control-label"> Página de agradecimiento </label>
						<div class="col-sm-9">
							<?php echo Form::text('pagina_agradecimiento', '',  array('class' => 'form-control', 'id' => 'pagina_agradecimiento')); ?>

							<span class="text-danger" id="errpagina_agradecimiento"> </span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Opciones visibles </label>
						<div class="col-sm-9" id="OpcionesVisibles">
							<label class="checkbox-inline">
								<input type="checkbox" value="1" id="ch1" checked onclick="Checkes()">
								<span class="custom-checkbox"></span> Título
							</label>
							<label class="checkbox-inline">
								<input type="checkbox" value="2" id="ch2" checked onclick="Checkes()">
								<span class="custom-checkbox"></span> Sub Título
							</label>
							<label class="checkbox-inline">
								<input type="checkbox" value="3" id="ch3" checked onclick="Checkes()">
								<span class="custom-checkbox"></span> Multimedia
							</label>
							<label class="checkbox-inline">
								<input type="checkbox" value="6" id="ch6" checked onclick="Checkes()">
								<span class="custom-checkbox"></span> Pie de formulario
							</label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Diseño </label>
						<div class="col-sm-9">
							<label class="radio-inline">
								<input type="radio" value="V" id="rdVertical" name="Diseño" onclick="Disenho(this)" checked>
								<span class="custom-radio"></span> Vertical
							</label>
							<label class="radio-inline">
								<input type="radio" value="V2" id="rdVertical2" name="Diseño" onclick="Disenho(this)">
								<span class="custom-radio"></span> Vertical 2
							</label>
							<label class="radio-inline">
								<input type="radio" value="H1" id="rdHorizontal" name="Diseño" onclick="Disenho(this)">
								<span class="custom-radio"></span> Horizontal
							</label>
							<label class="radio-inline">
								<input type="radio" value="H2" id="rdHorizontal2" name="Diseño" onclick="Disenho(this)">
								<span class="custom-radio"></span> Horizontal 2
							</label>
							<label class="radio-inline">
								<input type="radio" value="H3" id="rdHorizontal3" name="Diseño" onclick="Disenho(this)">
								<span class="custom-radio"></span> Horizontal 3
							</label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Campos disponibles </label>
						<div class="col-sm-9">
							<?php foreach($Campos as $Campo): ?>
							<?php $label = ($Campo->requerido==1)?'success':'info'; ?>
							<div class="Separacion pointer" onclick="AgregarCampo('<?php echo $Campo->slug; ?>', '<?php echo $Campo->nombre; ?>')"> <span class="label label-<?php echo $label; ?>"> <?php echo $Campo->nombre; ?> </span> </div>
							<?php endforeach; ?>
						</div>
					</div>
					<div class="row"></div>
					<!-- <div class="form-group"> -->
						<!-- label class="col-sm-3 control-label"> Diseñador de formulario </label> -->
						<!-- <div class="col-md-5"> -->
						<div class="col-md-8" style="padding: 25px;">
							<div id="disenhador" class="row disenhador" style="padding: 15px;"> </div>
						</div>
						<div class="col-md-4" id="Opciones"> </div>
					</div>
					<!-- <input id="colorpicker" type="text" class="colorpicker-rgba form-control" value="" data-color-format="rgba" onchange="edCuerpoColor(this)"> -->
					<div class="bottom">
						<?php echo Form::button('Guardar', array('class' => 'btn btn-primary', 'id' => 'btnAgregar', 'type' => 'submit')); ?>

						<?php echo HTML::linkRoute('SysWebEmailMarketingFormularios', 'Cancelar', array($ListaEmail->id), array('class' => 'btn btn-default')); ?>

					</div>
				<?php echo Form::close(); ?>

		</div>
		
	</div>
</div><!--/row end-->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('JS'); ?>
<?php /* HTML::script('WebPro/plugins/ckeditor-new/ckeditor.js') */ ?>
<script src="https://cdn.jsdelivr.net/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.webui-popover/1.2.1/jquery.webui-popover.min.js"></script>
<?php echo HTML::script('WebPro/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js'); ?>

<?php echo HTML::script('SysWeb/SumeClientes/EditorDeFormularios.js'); ?>

<?php echo HTML::script('jQueryUI/NT/jquery-ui.min.js'); ?>

<?php /* HTML::script('VideoJS/video.js') */ ?>
<?php echo HTML::script('bootstrap-select/js/bootstrap-select.min.js'); ?>

<?php echo HTML::script('bootstrap-select/js/i18n/defaults-es_CL.min.js'); ?>

<?php echo HTML::script('bootstrap-slider/bootstrap-slider.min.js'); ?>

<script type="text/javascript">
	function Disenho(elemento){
		var Disenho = elemento.value;
		Formulario(Disenho, '<?php echo asset('SysWeb/SumeClientes/Multimedia.png'); ?>', true);
	}
</script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('JSOr'); ?>
$(".sidebar-toggle-box").trigger("click");
Formulario('V', '<?php echo asset('SysWeb/SumeClientes/Multimedia.png'); ?>', false);
$(window).keydown(function(event){
	if(event.keyCode == 13) {
		event.preventDefault();
		return false;
	}
});
$("#chUbicacion").click(function(){
	if($("#chUbicacion").is(":checked")){ $("#pagina_agradecimiento").val(""); $("#dvPagina").hide("slow"); }
	else{ $("#dvPagina").show("slow"); }
});
$("#frmAgregar").submit(function(e){
	$('[id^="err"]').html("");
	$("#btnAgregar").html('<i class="fa fa-spinner fa-spin"></i> Cargando').prop("disabled", true);
	e.preventDefault();
	var frmAgregar = new FormData(document.getElementById("frmAgregar"));
	frmAgregar.append("codigo_html", $("#codigo_html").html().trim());
	$.ajax({
		type: "POST",
		url: "<?php echo URL::route('SysWebEmailMarketingFormulariosAgregar', array($ListaEmail->id)); ?>",
		data: frmAgregar,
		cache: false,
		contentType: false,
		processData: false,
		dataType: "json",
		success: function(data){
			$("#btnAgregar").html("Guardar").prop("disabled", false);
			if(data.success){
				new PNotify({ title: "Realizado", text: data.mensaje, type: "success" });
				setTimeout( function(){ window.location.href = "<?php echo URL::route('SysWebEmailMarketingFormularios', array($ListaEmail->id)); ?>"; }, 3000 );
			}
			else{
				if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
				$.each(data.errMensajes, function(key, value){ if(value != ''){ $("#err"+key).html(value); } else{ $("#err"+key).html(""); } });
			}
		},
		error: function(jqXHR, textStatus, errorThrown){
			new PNotify({ title: "Error", text: textStatus + " " + errorThrown, type: "error" });
		}
	});
});
<?php $__env->stopSection(); ?>
<?php echo $__env->make('BaseSistemaWeb', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>