@extends('BaseSistemaWeb')
@section('CSS')
@stop
@section('Contenido')
@if( Auth::user()->tipo == 'A' )
Formulario |
Cliente |
Acciones |
No existe ningún formulario de registro inicial |
Verificar páginas de subdominio de cuentas inactivas
@endif
@stop
@section('JS')
@stop
@section('JSOr')
$.post(
"{{ URL::route('SysWebOrdenPlantillasCE') }}",
{tipo: "", accion: "consulta"},
function(data){
if(data.success){
$("#pceTipo").html();
$("#pceTipo").append('');
console.log(data)
$.each(data.tipo, function(e, index){
if(index.tipo == 'V'){
var tipo = 'Venta'
}
else if(index.tipo == 'C'){
var tipo = 'Comunicación'
}
else{
var tipo = 'Relacional'
}
$("#pceTipo").append('');
});
}
else{
//if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
$("#pceTipo").change(function(){
if($(this).val() != ""){
$.post(
"{{ URL::route('SysWebOrdenPlantillasCE') }}",
{tipo: $(this).val(), accion: 'consulta'},
function(data){
if(data.success){
var ids = "";
if(data.orden == 0){
$.each(data.data, function(e, index){
ids += index.id;
if((e+1) < data.data.length){
ids +=',';
}
});
$("#pceOrden").val(ids);
}
else{
$("#pceOrden").val(data.data);
}
}
else{
//if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
}
});
$("#GuardarOrden").on('click', function(){
$.post(
"{{ URL::route('SysWebOrdenPlantillasCE') }}",
{ tipo: $("#pceTipo").val(), accion: "guardar", orden: $("#pceOrden").val() },
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
location.reload();
}
else{
//if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
});
$(".eliminar-cuenta").click(function(){
@if( App::environment() == 'local' )
if(confirm("Esta seguro que desea borra la información de la cuenta demo")){
$.post(
"{{ URL::route('SysWebEliminarCuentaPrueba') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
}
@else
var id = ($("#idCuenta").val() == "")?905:$("#idCuenta").val();
if(confirm("Esta seguro que desea borra la información de la cuenta demo")){
$.post(
"{{ URL::route('SysWebEliminarCuentaPrueba') }}",
{id: id},
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
}
@endif
});
$(".actualizar-cuenta").click(function(){
if(confirm("Esta seguro que desea actualizar los datos de los sitios")){
$.post(
"{{ URL::route('SysWebActualizarSitios') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
}
});
$("#frmLimpiarTemayPlantillas").submit(function(e){
e.preventDefault();
var formulario = $(this);
var formData = new FormData(document.getElementById("frmLimpiarTemayPlantillas"));
$.ajax({
type: "POST",
url: "{{ URL::route('SysWebLimpiarTemayPlantillaDescomprimirJson', array()) }}",
data: formData,
cache: false,
contentType: false,
processData: false,
dataType: "json",
timeout: 1800000,
success: function(data){
if(data.success){
new PNotify({ title: "Realizado", text: data.mensaje, type: "success" });
//setTimeout( function(){ window.location.href = "{{ URL::route('SysWebLimpiarTemayPlantillaDescomprimirJson', array()) }}"; }, 3000 );
if(typeof data.MensajeError != "undefined"){ $("#MensajeError2").html(data.MensajeError); $("#MensajeError2").show(); }else{ $("#MensajeError2").hide(); $("#MensajeError2").html(""); }
$("#frmCodigosLimpios").append('');
$("#frmCodigosLimpios").after('');
$.each(data.archivos, function(i, archivo){
//LIMPIEZA DE CÓDIGO
var code = decodeURIComponent(archivo.codigo);
$(".scCodigoHTML").html(code)
limpiezaHtml($(".scCodigoHTML"));
//------------------
//CREACIÓN DE LOS INPUTS HIDDEN --------------------------------
$("").attr({
type: "hidden",
value: archivo.nombre,
name: "archivos["+i+"][nombre]"
}).appendTo("#frmCodigosLimpios .scHdn");
$("").attr({
type: "hidden",
value: $(".scCodigoHTML").html(),
name: "["+i+"][codigo]",
name: "archivos["+i+"][codigo]"
}).appendTo("#frmCodigosLimpios .scHdn");
$(".scCodigoHTML").html("");
//--------------------------------------------------------------
});
$("#frmCodigosLimpios").submit();
}
else{
if(typeof data.MensajeError != "undefined"){ $("#Errs").html(data.MensajeError); $("#MensajeError").show(); }else{ $("#MensajeError").hide(); $("#Errs").html(""); }
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){
$("input[type='submit']").prop("disabled", false);
new PNotify({ title: "Error", text: textStatus + " " + errorThrown, type: "error" });
}
});
});
$(".crear-variacion").click(function(){
$.post(
"{{ URL::route('SysWebCrearVariaciones') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
});
$(".importar-productos").click(function(){
$.post(
"{{ URL::route('SysWebImportarProductos') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
});
$(".importar-prospectos").click(function(){
$.post(
"{{ URL::route('SysWebImportarProspectos') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
});
$(".agregar-referencia").click(function(){
$.post(
"{{ URL::route('SysWebAgregarReferencia') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
});
$(".actualizar-referencia").click(function(){
$.post(
"{{ URL::route('SysWebActualizarReferencia') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
});
$(".actualizar-historias").click(function(){
$.post(
"{{ URL::route('SysWebActualizarHistoriasDeCompras') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
});
$(".actualizar-etiquetas").click(function(){
$.post(
"{{ URL::route('SysWebActualizarEtiquetasDeClientes') }}",
function(data){
if(data.success){
new PNotify({ title: "Felicidades!", text: data.mensaje, type: "success" });
}
else{
if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
}
},
"json"
);
});
$("#btnBuscarInfoDelSuscriptor").click(function(e){
var frm = $("#frmBuscarInfoDelSuscriptor");
frm.find("span.text-danger").html("");
frm.find("div.alert").hide("slow");
$.post(
"{{ URL::route('SysWebInfoDelSuscriptor') }}",
frm.serialize(),
function(data){
if(data.success){
var jsonFormateado = JSON.stringify(data.infoDelSuscriptor, null, "\t");
frm.find(".preInfo").html( jsonFormateado );
frm.find("div.alert").show("slow");
}
else{
if(data.mensaje != ""){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
$.each(data.errMensajes, function(key, value){ if(value != ""){ frm.find(".err"+key).html(value); } else{ frm.find(".err"+key).html(""); } });
}
},
"json"
);
});
@stop