Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/uploads/../modules/../js/customer
الملفات الموجودة في هذا الـ Path:
.
..
campaign.js
campaign_statistic.js
compose.js
contact.js
dashboard.js
domain.js
email_account.js
email_template.js
form.js
group.js
inbox.js
label.js
lead_finder.js
list_builder.js
queue.js
sender.js
sent.js
settings.js
ticket.js

مشاهدة ملف: list_builder.js

"use strict";
$(document).on('change', '#sent_type', function (e){
    const type = $(this).val();
    if (type=='between'){
        $('.between_date').removeClass('d-none');
        $('#days_section').addClass('d-none');
        $('.days_section').addClass('d-none');
    }else if(type=='empty'){
        $('#days_section').addClass('d-none');
        $('.between_date').addClass('d-none');
        $('#between_date').addClass('d-none');
    } else{
        $('.between_date').addClass('d-none');
        $('#days_section').removeClass('d-none');
        $('.days_section').removeClass('d-none');
    }
});
$(document).on('change', '#email_received_type', function (e){
    const type = $(this).val();
    if (type=='between'){
        $('.email_received_between_date').removeClass('d-none');
        $('#email_received_days_section').addClass('d-none');
        $('.email_received_days_section').addClass('d-none');
    }else if(type=='empty'){
        $('.email_received_days_section').addClass('d-none');
        $('#email_received_days_section').addClass('d-none');
        $('.email_received_between_date').addClass('d-none');
    } else{
        $('.email_received_between_date').addClass('d-none');
        $('#email_received_days_section').removeClass('d-none');
        $('.email_received_days_section').removeClass('d-none');
    }
});

$('.between_dates').daterangepicker({
    autoUpdateInput: true,
    singleDatePicker: true,
    timePicker: true,
    locale: {
        format: 'MM/DD/YYYY hh:mm A'
    }
});

$('#groups').on('change',function (e) {
    e.preventDefault();
    $('#group_ids').val(JSON.stringify($(this).val()));
});

$('#groupForm').validate({
    rules: {
        name: {
            required: true
        }
    },
    messages: {
        name: {required: "Please provide  name"},
    },
    errorElement: 'span',
    errorPlacement: function (error, element) {
        error.addClass('invalid-feedback');
        element.closest('.form-group').append(error);
    },
    highlight: function (element, errorClass, validClass) {
        $(element).addClass('is-invalid');
    },
    unhighlight: function (element, errorClass, validClass) {
        $(element).removeClass('is-invalid');
    }
});

$(function () {
    //Initialize Select2 Elements
    $('.select2').select2();
});

$(document).on('click', '#addNewGroupBtn', function (e) {
    const name = $('#group_name').val();
    if(!name){
        toastr.error('Please enter group name', 'failed', {timeOut: 9000});
        return;
    }
    $.ajax({
        method: "post",
        url: '/new-group',
        data: {
            _token:csrf_token,
            name:name,
            filter:JSON.stringify(filterData)
        },
        success: function (res) {
            if (res.status == 'success') {
                toastr.success(res.message, 'success', {timeOut: 9000});
                $('#modal-default').modal('hide');
                location.href='/groups';
            }else{
                toastr.error(res.message, 'failed', {timeOut: 9000});
            }
        }

    });
});