@extends('BaseSistemaWeb')
@section('CSS')
{{ HTML::style('image-picker/image-picker.css') }}
@stop
@section('Contenido')
	
		
			
			
				 
								
				{{ Form::open(array('route' => 'SysWebPAterrizajePlantillaxClienteGuardar', 'method' => 'post', 'class' => 'form-horizontal row-border', 'id' => 'frmAgregar', 'files' => true)) }}
					
						{{-- MACRO REALIZADO POR KEVIN MORÁN PUEDE UBICARSE EN /app/start/global.php AL FINAL DEL DOCUMENTO POR SI NECESITA MODIFICARSE --}}
						
							
								
								
									
										
											@foreach($PlantillasC as $Plantilla)
												
													
														
															
 {{$Plantilla->nombre }} 
														
														.$fecha }}) 
														
															 {{ $Plantilla->descripcion }} 
														 
														
													 
												 
												@endforeach
											
										 
								 
							 
						 
						
							
								
								
									
										
											@foreach($PlantillasR as $Plantilla)
												
													
														
															
 {{$Plantilla->nombre }} 
														
														.$fecha }}) 
														
															 {{ $Plantilla->descripcion }} 
														 
														
													 
												 
											@endforeach
											
										 
								 
							 
						 
						
							
								
								
									
										
											@foreach($PlantillasV as $Plantilla)
												
													
														
															
 {{$Plantilla->nombre }} 
														
														.$fecha }}) 
														
															 {{ $Plantilla->descripcion }} 
														 
														
													 
												 
											@endforeach
											
										 
								 
							 
						 
						
							
								
								
									
										
											@foreach($PlantillasU as $Plantilla)
												
													
														
															
 {{$Plantilla->nombre }} 
														
														.$fecha }}) 
														
															 {{ $Plantilla->descripcion }} 
														 
														
													 
												 
											@endforeach
											
										 
								 
							 
						 
						
						
							
								
								
									
										
											@foreach($PlantillasA as $Plantilla)
												
													
														
															
 {{$Plantilla->nombre }} 
														
														.$fecha }}) 
														
															 {{ $Plantilla->descripcion }} 
														 
														
													 
												 
											@endforeach
											
										 
								 
							 
						 
						
							
								
								
									
										
											@foreach($PlantillasL as $Plantilla)
												
													
														
															
 {{$Plantilla->nombre }} 
														
														.$fecha }}) 
														
															 {{ $Plantilla->descripcion }} 
														 
														
													 
												 
											@endforeach
											
										 
								 
							 
						 
					
				{{ Form::close() }}
		
 
		
	 
 
@stop
@section('JS')
{{ HTML::script('image-picker/image-picker.min.js') }}
@stop
@section('JSOr')
$("select").imagepicker({ hide_select : true, show_label  : true });
$(".btnSelectionP").click(function(){
	var titulo = $(this).attr("data-nombre");
	var id = $(this).attr("data-idP");
	var mensaje = '
';
	BootstrapDialog.show({
		cssClass: "mdAvatar",
		title: titulo,
		message: mensaje,
		closeByBackdrop: false,
		draggable: true,
		buttons: [{
			id: "btnAgrgarP",
			label: "Agregar",
			cssClass: "btn-success btn-block btn-lg", 
			action: function(dialogItself){
				$("#btnAgrgarP").prop("disabled", true).html('
 Procesando...');
				$.isLoading({ text: "Cargando..." }); NProgress.start();
				$.post(
					"{{ URL::route('SysWebPAterrizajePlantillaxClienteGuardar') }}",
					$("#frmNombrePlantilla").serialize(),
					function(data){
						$.isLoading("hide"); NProgress.done();
						$("#btnAgrgarP").prop("disabled", false).html("Agregar");
						if(data.success){
							new PNotify({ title: "Realizado", text: data.mensaje, type: "success" });
							setTimeout( function(){ window.location.href = data.ruta; }, 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(""); } });
						}
					},
					"json"
				);
			}
		}]
	});
});
@stop