MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/iuris/pages/call_center/js/script.js
$(document).on("keypress",".SOLO_NUMEROS",function(e) 
{
    tecla = (document.all) ? e.keyCode : e.which;
    //Tecla de retroceso para borrar, siempre la permite
    if (tecla==8)
    {
      return true;
    }     
    // Patron de entrada, en este caso solo acepta numeros
    patron =/[0-9]/;
    tecla_final = String.fromCharCode(tecla);
    return patron.test(tecla_final);
});


function TICKETS(valor)
{
    if(valor == '1')
    {
        $("#Titulo_menu_call_center").text('Crear Ticket');
        $.ajax(
        {
            url:"php/CREAR_TICKET.php",
            type:"POST",
            dataType:"html",
            success: function(RESPUESTA)
            {
                $("#Tbl_callcenter").html(RESPUESTA);
            }
        });
        $("#BTN_REGRESAR_CALL").css("display","none");
    }
    else if(valor == '3')
    {
        window.location.assign("consultas.php?val="+valor);
    }
    else
    {
        window.location.assign("php/TBL_TICKETS.php?val="+valor);
    }
}

function CONSULTAR_TICKETS_CEDULA()
{
    cedula = $("#cedula_iuris").val();
    if(cedula == '')
    {
        Swal.fire({icon: 'warning', title:'DIGITA EL NÚMERO DE CEDULA', showConfirmButton: false, timer:1000}).then((result) => {$("#cedula_iuris").focus();});
		return 0;
    }
    
    DATOS = {"cedula":cedula};
    
    $.ajax(
    {
        data:DATOS,
        url:"php/TBL_TICKETS_CEDULA.php",
        type:"POST",
        dataType:"html",
        success: function(RESPUESTA)
        {
            $("#DIV_TBL_TICKETS").html(RESPUESTA);
            $("#DIV_SUCURSAL").css("display","none");
        }
    });
    
    $.ajax(
    {
        data:DATOS,
        url:"php/TBL_TICKET_POR_CEDULA.php",
        type:"POST",
        dataType:"html",
        success: function(RESPUESTA)
        {
            $("#DIV_CREAR_TICKET").html(RESPUESTA);
            $("#DIV_SUCURSAL").css("display","none");
        }
    });
}

function GUARDAR_TICKET()
{
    cedula_ticket   =$("#cedula_ticket").val();
    nombre          =$("#nombre").val();
    grado           =$("#grado").val();
    contrato        =$("#contrato").val();
    celular         =$("#celular").val();
    telefono        =$("#telefono").val();
    direccion       =$("#direccion").val();
    ciudad          =$("#ciudad").val();
    email           =$("#email").val();
    gestion         =$("#gestion").val();
    num_extencion   =$("#num_extencion").val();
    num_entrante    =$("#num_entrante").val();
    dirigido_hacia  =$("#dirigido_hacia").val();
    sucursal        =$("#sucursal").val();
    abogado         =$("#dirigido_hacia_abogado").val();

    //data usuario datos savados de iuris/pages/call_center/index.php
    cedUsu = $("#ced").val();
    nomUsu = $("#nom").val();
    codigoUsu = $("#aaa").val();
    cargoUsu = $("#cargo").val();
    
    
    if(celular == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE EL NÚMERO DE CELULAR', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(telefono == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE EL NÚMERO DE TELEFONO', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(direccion == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE LA DIRECCIÓN', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(ciudad == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE LA CIUDAD', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(email == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE EL EMAIL', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(gestion == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE EL SERVICIO SOLICITADO', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(num_extencion == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE EL NÚMERO DE LA EXTENCIÓN', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(num_entrante == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE EL NÚMERO ENTRANTE', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(dirigido_hacia == '')
    {
        Swal.fire({icon:'warning', title:'SELECCIONE HACIA DONDE VA DIRIGIDO', showConfirmButton: false, timer: 1500  });
		return 0;
    }

    if(dirigido_hacia == 'SUPERVISOR SUCURSAL' && sucursal == '')
    {
        Swal.fire({icon:'warning', title:'SELECCIONE LA SUCURSAL', showConfirmButton: false, timer: 1500  });
        return 0;
    }
    
    DATOS = {
        "cedula_ticket":cedula_ticket, "nombre":nombre, "grado":grado, "contrato":contrato, "celular":celular, "telefono":telefono, "direccion":direccion, "ciudad":ciudad, "email":email, "gestion":gestion, "num_extencion":num_extencion, "num_entrante":num_entrante, "dirigido_hacia":dirigido_hacia, "sucursal":sucursal, "abogado":abogado, "cedUsu":cedUsu, "nomUsu":nomUsu, "codigoUsu":codigoUsu, "cargoUsu":cargoUsu
    };
        
    $.ajax(
    {
        data:DATOS,
		url:"php/GUARDAR_TICKET.php",
		type:"POST",
		success: function(RESPUESTA)
        {
            Separar = RESPUESTA.split("/");
            RESPUESTA = Separar[0];
            Ticket = Separar[1];
            if(RESPUESTA  == '1')
            {
                Swal.fire({icon:'success', title:'TICKET CREADO '+Ticket, showConfirmButton: false  });
                CONSULTAR_TICKETS();
                $("#DIV_CREAR_TICKET").html('');
                return 0;
            }
            else if(RESPUESTA  != '1')
            {
                Swal.fire({icon:'warning', title:'TICKET NO CREADO', showConfirmButton: false, timer: 1500  });
                return 0;
            }
                
        }
    });
}

function DIRIGIDO_CAMBIAR()
{
    //enconde las sucursales 
    $("#DIV_SUCURSAL").css("display","none");
    $("#abogados_sucu").css("display","none");

    valor = $("#dirigido_hacia").val();
    
    if(valor == 'SUPERVISOR SUCURSAL')
    {
        $("#DIV_SUCURSAL").css("display","block");
    }
}
 
function abogadoSucu()
{   
    let sucursales = [2, 3, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 24, 26, 27, 44];
    //enconde las sucursales 
    $("#abogados_sucu").css("display","none");

    valorSucu = $("#sucursal").val();
    console.log(valorSucu)
    console.log(sucursales.includes(parseInt(valorSucu))) 
    if(sucursales.includes(parseInt(valorSucu)))
    {
        DATOS = {"sucursal":valorSucu};
       
        $.ajax(
        {
            data:DATOS,
            url:"http://asjudinet.com/iuris/pages/call_center/php/TBL_ABOGADO_SUCURSAL.php",
            type:"POST",
            dataType:"html",
            success: function(RESPUESTA)
            {   
                console.log(RESPUESTA);
                $("#dirigido_hacia_abogado").html(RESPUESTA);
                $("#abogados_sucu").css("display","block");
            }
        });

    }
}

function ASIGNAR_FUNCIONARIO()
{   
    Num_Ticket      = $("#Num_Ticket").val();
    Abogado         = $("#Abogado").val();
    gestion         = $("#gestion").val();
    fecha_ejecucion = $("#fecha_ejecucion").val();
    
    if(Abogado == '')
    {
        Swal.fire({icon:'warning', title:'SELECCIONE AL ABOGADO', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    if(gestion == '')
    {
        Swal.fire({icon:'warning', title:'POR FAVOR DIGITAR LA GESTIÓN', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    parametros = new FormData($("#FORM_RESPUESTA_TICKET")[0]);
    
    $.ajax(
    {
        data:parametros,
		url:"ASIGNAR_FUNCIONARIO.php",
		type:"POST",
        contentType: false,
        processData: false,
		success: function(RESPUESTA)
        {
            if(RESPUESTA  == '1')
            {
                Swal.fire({icon:'success', title:'GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '3')
            {
                Swal.fire({icon:'warning', title:'ARCHIVO NO GUARDADO', showConfirmButton: false, timer: 1500  });
                return 0;
            }
            else if(RESPUESTA  == '31')
            {
                Swal.fire({icon:'success', title:'ARCHIVO NO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '41')
            {
                Swal.fire({icon:'success', title:'ARCHIVO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else
            {
                Swal.fire({icon:'warning', title:'OCURRIO UN ERROR', showConfirmButton: false, timer: 1500  });
                return 0;
            }
        }
    });
    
}

function SERVICIO_EN_LINEA()
{
    
    gestion = $("#gestion").val();
    if(gestion == '')
    {
        Swal.fire({icon:'warning', title:'POR FAVOR DIGITAR LA GESTIÓN', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    parametros = new FormData($("#FORM_RESPUESTA_TICKET")[0]);
    
    $.ajax(
    {
        data:parametros,
		url:"SERVICIO_EN_LINEA.php",
		type:"POST",
        contentType: false,
        processData: false,
		success: function(RESPUESTA)
        {
            if(RESPUESTA  == '1')
            {
                Swal.fire({icon:'success', title:'GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '3')
            {
                Swal.fire({icon:'warning', title:'ARCHIVO NO GUARDADO', showConfirmButton: false, timer: 1500  });
                return 0;
            }
            else if(RESPUESTA  == '31')
            {
                Swal.fire({icon:'success', title:'ARCHIVO NO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '41')
            {
                Swal.fire({icon:'success', title:'ARCHIVO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else
            {
                Swal.fire({icon:'warning', title:'OCURRIO UN ERROR', showConfirmButton: false, timer: 1500  });
                return 0;
            }
        }
    });
}


function TRABAJO_PENDIENTE()
{
    fecha = $("#fecha_ejecucion").val();
    gestion = $("#gestion").val();
    if(gestion == '')
    {
        Swal.fire({icon:'warning', title:'POR FAVOR DIGITAR LA GESTIÓN', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    if(fecha == '')
    {
        Swal.fire({icon:'warning', title:'POR FAVOR SELECCIONAR LA FECHA DE EJECUCIÓN', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    parametros = new FormData($("#FORM_RESPUESTA_TICKET")[0]);
    
    $.ajax(
    {
        data:parametros,
		url:"TRABAJO_PENDIENTE.php",
		type:"POST",
        contentType: false,
        processData: false,
		success: function(RESPUESTA)
        {
            if(RESPUESTA  == '1')
            {
                Swal.fire({icon:'success', title:'GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '3')
            {
                Swal.fire({icon:'warning', title:'ARCHIVO NO GUARDADO', showConfirmButton: false, timer: 1500  });
                return 0;
            }
            else if(RESPUESTA  == '31')
            {
                Swal.fire({icon:'success', title:'ARCHIVO NO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '41')
            {
                Swal.fire({icon:'success', title:'ARCHIVO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else
            {
                Swal.fire({icon:'warning', title:'OCURRIO UN ERROR', showConfirmButton: false, timer: 1500  });
                return 0;
            }
        }
    });    
    
}

function GUARDAR_GESTION()
{
    gestion = $("#gestion").val();
    if(gestion == '')
    {
        Swal.fire({icon:'warning', title:'POR FAVOR DIGITAR LA GESTIÓN', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    parametros = new FormData($("#FORM_RESPUESTA_TICKET")[0]);
    
    $.ajax(
    {
        data:parametros,
		url:"GUARDAR_GESTION.php",
		type:"POST",
        contentType: false,
        processData: false,
		success: function(RESPUESTA)
        {
            if(RESPUESTA  == '1')
            {
                Swal.fire({icon:'success', title:'GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '3')
            {
                Swal.fire({icon:'warning', title:'ARCHIVO NO GUARDADO', showConfirmButton: false, timer: 1500  });
                return 0;
            }
            else if(RESPUESTA  == '31')
            {
                Swal.fire({icon:'success', title:'ARCHIVO NO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '41')
            {
                Swal.fire({icon:'success', title:'ARCHIVO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else
            {
                Swal.fire({icon:'warning', title:'OCURRIO UN ERROR', showConfirmButton: false, timer: 1500  });
                return 0;
            }
        }
    });
    
}

function TRABAJO_REALIZADO()
{
    gestion = $("#gestion").val();
    if(gestion == '')
    {
        Swal.fire({icon:'warning', title:'POR FAVOR DIGITAR LA GESTIÓN', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    parametros = new FormData($("#FORM_RESPUESTA_TICKET")[0]);
    
    $.ajax(
    {
        data:parametros,
		url:"TRABAJO_REALIZADO.php",
		type:"POST",
        contentType: false,
        processData: false,
		success: function(RESPUESTA)
        {
            if(RESPUESTA  == '1')
            {
                Swal.fire({icon:'success', title:'GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '3')
            {
                Swal.fire({icon:'warning', title:'ARCHIVO NO GUARDADO', showConfirmButton: false, timer: 1500  });
                return 0;
            }
            else if(RESPUESTA  == '31')
            {
                Swal.fire({icon:'success', title:'ARCHIVO NO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '41')
            {
                Swal.fire({icon:'success', title:'ARCHIVO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else
            {
                Swal.fire({icon:'warning', title:'OCURRIO UN ERROR', showConfirmButton: false, timer: 1500  });
                return 0;
            }
        }
    });
}

function CASO_CERRADO()
{
    
    gestion = $("#gestion").val();
    if(gestion == '')
    {
        Swal.fire({icon:'warning', title:'POR FAVOR DIGITAR LA GESTIÓN', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    parametros = new FormData($("#FORM_RESPUESTA_TICKET")[0]);
    
    $.ajax(
    {
        data:parametros,
		url:"CASO_CERRADO_HISTOSER.php",
		type:"POST",
        contentType: false,
        processData: false,
		success: function(RESPUESTA)
        {
            if(RESPUESTA  == '1')
            {
                Swal.fire({icon:'success', title:'GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '3')
            {
                Swal.fire({icon:'warning', title:'ARCHIVO NO GUARDADO', showConfirmButton: false, timer: 1500  });
                return 0;
            }
            else if(RESPUESTA  == '31')
            {
                Swal.fire({icon:'success', title:'ARCHIVO NO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '41')
            {
                Swal.fire({icon:'success', title:'ARCHIVO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    close();
                });
                return 0;
            }
            else
            {
                Swal.fire({icon:'warning', title:'OCURRIO UN ERROR', showConfirmButton: false, timer: 1500  });
                return 0;
            }
        }
    });
}

function CASO_ABIERTO()
{
    gestion = $("#gestion").val();
    if(gestion == '')
    {
        Swal.fire({icon:'warning', title:'POR FAVOR DIGITAR LA GESTIÓN', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    parametros = new FormData($("#FORM_RESPUESTA_TICKET")[0]);
    
    $.ajax(
    {
        data:parametros,
		url:"CASO_ABIERTO_HISTOSER.php",
		type:"POST",
        contentType: false,
        processData: false,
		success: function(RESPUESTA)
        {
            if(RESPUESTA  == '1')
            {
                Swal.fire({icon:'success', title:'GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '3')
            {
                Swal.fire({icon:'warning', title:'ARCHIVO NO GUARDADO', showConfirmButton: false, timer: 1500  }).then((result) => 
				{
                    
                });
                return 0;
            }
            else if(RESPUESTA  == '31')
            {
                Swal.fire({icon:'success', title:'ARCHIVO NO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    
                    close();
                });
                return 0;
            }
            else if(RESPUESTA  == '41')
            {
                Swal.fire({icon:'success', title:'ARCHIVO GUARDADO - GESTION GUARDADA ', showConfirmButton: false, timer: 3000  }).then((result) => 
				{
                    
                    close();
                });
                return 0;
            }
            else
            {
                Swal.fire({icon:'warning', title:'OCURRIO UN ERROR', showConfirmButton: false, timer: 1500  });
                return 0;
            }
        }
    });
}

function INGRESAR_REQUERIMIENTO()
{
    Ticket = $("#Num_Ticket").val();
    
    window.location.assign("../../../../callcenter/requerimientos_admins_control_histoser_callcenter.php?atencion="+Ticket);
}

function CONSULTAR_TICKETS()
{
    cedula = $("#Cedula_ticket").val();
    ticket = $("#numero_ticket").val();
    
    DATOS = {"cedula":cedula,"ticket":ticket};
    
    if(cedula == '' && ticket == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE EL NÚMERO DE CEDULA O EL NÚMERO DE TICKET', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    $.ajax(
    {
        data:DATOS,
        url:"php/CONSULTAS_CONSULTAR_TICKETS.php",
        type:"POST",
        dataType:"html",
        success: function(RESPUESTA)
        {
            $("#DIV_RESULTADO_CONSULTA").html(RESPUESTA);
        }
    });
}

function CONSULTAR_CARTERA()
{
    cedula = $("#cedula").val();
    nombre = $("#nombres").val();
    
    DATOS = {"cedula":cedula,"nombre":nombre};
    
    if(cedula == '' && nombre == '')
    {
        Swal.fire({icon:'warning', title:'DIGITE EL NÚMERO DE CEDULA O EL NOMBRE', showConfirmButton: false, timer: 2000  });
		return 0;
    }
    
    $.ajax(
    {
        data:DATOS,
        url:"php/CONSULTAS_CONSULTAR_CARTERA.php",
        type:"POST",
        dataType:"html",
        success: function(RESPUESTA)
        {
            $("#DIV_RESULTADO_CONSULTA").html(RESPUESTA);
        }
    });
}
function Cargando_Proceso()
{
	cedula 	= $("#cedulaProceso").val();
	contrato= $("#contratoProceso").val();

	if(cedula =='')
    {
        Swal.fire({icon: 'warning', title: 'Por favor digita un número de cedula valido', showConfirmButton: false, timer: 1500  });
		return 0;
    }
    if(contrato=='')
    {
        Swal.fire({icon: 'warning', title: 'Por favor digita un número de contrato valido', showConfirmButton: false, timer: 1500  });
		return 0;
    }
	$("#Loading_DIV_Proceso").css("display","block");
	setTimeout(CONSULTAR_PROCESO_CEDULA,2500);
}

function CONSULTAR_PROCESO_CEDULA()
{
    cedula = $("#cedula").val();
    DATOS = {"cedula":cedula};
    $("#Loading_DIV_Proceso").css("display","none");
    $.ajax(
    {
        data:DATOS,
        url:"php/CONSULTAR_PROCESO_CEDULA.php",
        type:"POST",
        dataType:"html",
        success: function(RESPUESTA)
        {
            $("#DIV_RESULTADO_CONSULTA").html(RESPUESTA);
        }
    });
}