MMCT TEAM
Server IP : 103.191.208.50  /  Your IP : 216.73.216.53
Web Server : LiteSpeed
System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User : celkcksm ( 1031)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, popen, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/celkcksm/jcboseedu.org/admin/../scripts/site/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/jcboseedu.org/admin/../scripts/site/javascript.js
// Window Open
function openWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
}

// Search Panel Toggle
function update_toggle(panel) {

    panels = new Array('f1', 'f2', 'f3', 'f4', 'f5');

    for (var i = 0; i < panels.length; i++) {

        if (panels[i] == panel) {// != null ){
            document.getElementById(panel).style.display = 'block';
        } else {
            document.getElementById(panels[i]).style.display = 'none';
        }
        //alert ('Panels= '+ panels[i]);

    }

    ///if ( panels[i] != panel)


    //}

}

// Enable Disable Profile Submit
function btnstat() {
    if (document.frmprofile.accept.checked) {
        document.frmprofile.Submit.disabled = 0;
    } else {
        document.frmprofile.Submit.disabled = 1;
    }
}

// Checks a string for a list of characters
function doesContain(strPassword, strCheck) {
    nCount = 0;

    for (i = 0; i < strPassword.length; i++)
    {
        if (strCheck.indexOf(strPassword.charAt(i)) > -1)
        {
            nCount++;
        }
    }

    return nCount;
}

// New form Validation

function showError(elementId) {
    $('#' + elementId).focus();
}
function hideError() {
    $('input').removeClass('errorMsg');
    $('select').removeClass('errorMsg');
    $('textarea').removeClass('errorMsg');
    $('.errorSpan').slideUp('slow', function () {
        $(this).remove();
    });
}
function isEmailAddress(str) {

    var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    if (pattern.test(str)) {
        return true;
    } else {
        return false;
    }
}

function isAlphaNumberSpecial(str) {
    var regex = /^[-\s@.,?&*a-z0-9]+$/i;

    if (regex.test(str)) {
        return true;
    } else {
        return false;
    }
}


function isNumber(str) {
    var a = str.search(/^\s*\d+\s*$/);

    if (a == -1) {
        return false;
    } else {
        return true;
    }
}


// Validate Contact us
function validate_conFrm() {

    var r = false;
    if ($('#Name1').val().length <= 0 || !isAlphaNumberSpecial($('#Name1').val())) {
        showError('Name1', 'Please provide your Name');
    } else if (!isEmailAddress($('#emails').val())) {
        showError('emails', 'Please provide your valid Email');
    } else if ($('#mobile1').val().length < 10 || !isNumber($('#mobile1').val())) {
        showError('mobile1', 'Please provide Phone No. (at least 10 digits)');
    }
    //else if($('#travel_date1').val().length <= 0){
    //    showError('travel_date1', 'Please provide your Journey Date');
    //}					
    else if ($('#comments1').val().length <= 0) {
        showError('comments1');
    } else if ($('#txtNumber1').val().length <= 0 || !isAlphaNumberSpecial($('#txtNumber1').val())) {
        showError('txtNumber1');
    } else {
        hideError();
        r = true;
    }
    return r;
}
// Img Verifier Loader
function reloadImgVerify() {
    document.getElementById('ImgVerify').src = 'imgverify/image_verify_process.php?id=' + Math.random();
}

// Captcha Loader
function reloadCAPTCHA(path) {
    document.getElementById('CAPTCHA').src = path + 'captcha/image_verify_process.php?id=' + Math.random();
}






// Vaidate Username & Password
function validate_username(f) {
    if (f.username.value == "" || f.username.value.indexOf("@") <= 0 || f.username.value.indexOf(".") <= 0 || f.username.value.length < 5) {
        alert('Please provide valid Email as the Username.');
        f.username.focus();
        return false;
    } else if (f.password.value == "" || f.password.value.length < 6) {
        alert('Please fill up the Password.');
        f.password.focus();
        return false;
    } else if (f.password.value != f.cpassword.value) {
        alert('Your Passwords Do Not Match.');
        f.cpassword.focus();
        return false;
    } else {
        return true;
    }
}

// Validate Location
function validate_location(f) {
    if (f.country.value == "") {
        alert('Please select a Country.');
        f.country.focus();
        return false;
    } else if (f.state.value == "" || f.state.value.length < 2) {
        alert('Please provide your Province/State name.');
        f.state.focus();
        return false;
    } else if (f.district.value == "" || f.district.value.length < 2) {
        alert('Please provide your District name.');
        f.district.focus();
        return false;
    } else if (f.city.value == "" || f.city.value.length < 2) {
        alert('Please provide your City name.');
        f.city.focus();
        return false;
    } else {
        return true;
    }
}

// Validate Password Update
function passchange_verify(f) {
    if (f.o_pass.value == "" || f.password.value == "" || f.cpassword.value == "" || f.password.value < 6) {
        alert('Please fill all the fields of the form.');
        f.o_pass.focus();
        return false;
    } else if (f.password.value != f.cpassword.value) {
        alert('The New Password doesnot matches your Confirmed Password');
        f.cpassword.focus();
        return false;
    } else {
        return true;
    }
}

// Is Numeric Validate
function IsNumeric(sText) {
    var ValidChars = "0123456789";
    var IsNumber = true;
    var Char;

    for (i = 0; i < sText.length && IsNumber == true; i++) {
        Char = sText.charAt(i);
        if (ValidChars.indexOf(Char) == -1) {
            IsNumber = false;
        }
    }
    return IsNumber;
}


// Validate Link
function validate_link(f) {
    if (f.lname.value == "") {
        alert('Please provide a Name');
        f.lname.focus();
        return false;
    } else if (f.lprn.value == "") {
        alert('Please select a Parent');
        f.lprn.focus();
        return false;
    } else if (!IsNumeric(f.priority.value) && f.priority.value <= 0) {
        alert('Only Numbers for Priority');
        f.priority.focus();
        return false;
    } else {
        return true;
    }
}

// Validate Page
function validate_pageupdate(f) {
    if (f.hid.value == "") {
        alert('Please select a Page Link.');
        f.hid.focus();
        return false;
    } else if (f.title.value == "") {
        alert('Please provide a Page Title.');
        f.title.focus();
        return false;
    } else if (f.p_type.value == "") {
        alert('Please select a Page Type.');
        f.p_type.focus();
        return false;
    } 
    else {
        return true;
    }
}

// Validate Profile Creation
function validate_profile(f) {
    if (!validate_username(f)) {
        return false;
    } else if (f.name.value == "" || f.name.value.length < 3) {
        alert('Please provide your Name.');
        f.name.focus();
        return false;
    } else if (f.country.value == "") {
        alert('Please select your Country.');
        f.country.focus();
        return false;
    } else if (f.accept.value == "") {
        alert('Please accept the Terms & Conditions.');
        f.accept.focus();
    } else {
        return true;
    }
}

// Toggle Editor and URL Field in Page Add/Edit
function showeditor(f, d1, d2) {
    if (document.getElementById(f).value == 'Page') {
        document.getElementById(d1).style.display = 'block';
        document.getElementById(d2).style.display = 'none';
    } else {
        document.getElementById(d1).style.display = 'none';
        document.getElementById(d2).style.display = 'block';
    }
}

// Validate Profile Update
function validate_profileupdate(f) {
    if (f.name.value == "" || f.name.value.length < 3) {
        alert('Please provide your Name.');
        f.name.focus();
        return false;
    } else if (f.country.value == "") {
        alert('Please select your Country.');
        f.country.focus();
        return false;
    } else {
        return true;
    }
}

// Validate Page
function validate_newsupdate(f) {
    if (f.heading.value == "") {
        alert('Please provide a Heading.');
        f.heading.focus();
        return false;
    } else if (f.details.value == "") {
        alert('Please provide Details.');
        f.details.focus();
        return false;
    } else if (f.dt.value == "" || f.mn.value == "" || f.yr.value == "") {
        alert('Please select a Date.');
        f.dt.focus();
        return false;
    } else {
        return true;
    }
}

function validate_passretrieval(f) {
    if (f.r_email.value == "" || f.r_email.value.indexOf("@") <= 0 || f.r_email.value.indexOf(".") <= 0) {
        alert('Please provide a Valid Email.');
        f.r_email.focus();
        return false;
    } else {
        return true;
    }
}


// Validate Contact us
function validate_contactus() {

    var r = false;
    if ($('#fromname').val().length <= 0 || !isAlphaNumberSpecial($('#fromname').val())) {
        showError('fromname');
    } else if (!isEmailAddress($('#frommail').val())) {
        showError('frommail');
    } else if ($('#phone').val().length <= 0 || !IsNumeric($('#phone').val())) {
        showError('phone');
    } else if ($('#subject').val().length <= 0 || !isAlphaNumberSpecial($('#subject').val())) {
        showError('subject');
    } else if ($('#message').val().length <= 0 || !isAlphaNumberSpecial($('#message').val())) {
        showError('message');
    } else if ($('#txtNumber').val().length <= 0 || !isAlphaNumberSpecial($('#txtNumber').val())) {
        showError('txtNumber');
    } else {
        hideError();
        r = true;
    }
    return r;
}
function validate_quickcontactus() {

    var r = false;
    if ($('#qfromname').val().length <= 0 || !isAlphaNumberSpecial($('#qfromname').val())) {
        showError('qfromname');
    } else if (!isEmailAddress($('#qfrommail').val())) {
        showError('qfrommail');
    } else if ($('#qphone').val().length <= 0 || !IsNumeric($('#qphone').val())) {
        showError('qphone');
    } else if ($('#qmessage').val().length <= 0 || !isAlphaNumberSpecial($('#qmessage').val())) {
        showError('qmessage');
    } else if ($('#txtNumber').val().length <= 0) {
        showError('txtNumber');
    } else {
        hideError();
        r = true;
    }
    return r;
}
function quick_contact() {

    var r = false;
    if ($('#qfromname').val().length <= 0 || !isAlphaNumberSpecial($('#fromname').val())) {
        showError('qfromname');
    } else if (!isEmailAddress($('#qfrommail').val())) {
        showError('qfrommail');
    } else if ($('#qphone').val().length <= 0 || !IsNumeric($('#qphone').val())) {
        showError('qphone');
    } else if ($('#qmessage').val().length <= 0 || !isAlphaNumberSpecial($('#qmessage').val())) {
        showError('qmessage');
    } else if ($('#txtNumber').val().length <= 0) {
        showError('txtNumber');
    } else {
        r = true;
    }
    return r;
}

// Validate Login
function validate_login(f) {
    if (f.u_name.value == "" || f.u_name.value.indexOf("@") <= 0 || f.u_name.value.indexOf(".") <= 0 || f.u_name.value.length < 5) {
        alert('Please provide valid Email as the Username.');
        f.u_name.focus();
        return false;
    } else if (f.p_word.value == "" || f.p_word.value.length < 6) {
        alert('Please provide a Valid Password.');
        f.p_word.focus();
        return false;
    } else if (f.loginCaptcha.value == "") {
        alert('Please Answer the Math');
        f.loginCaptcha.focus();
        return false;
    } else {
        return true;
    }
}

// Swap Any Image
function ImgSwap(i, image) {
    i.src = image;
}

// Toggle all
function checkAll(ref, exby) {
    var checks = document.getElementsByName(ref);
    var boxLength = checks.length;
    for (i = 0; i < boxLength; i++) {
        checks[i].checked = exby.checked ? true : false;
    }
}

//new comments validation

function validate_comments() {

    var r = false;
    if ($('#Name').val().length <= 0 || !isAlphaNumberSpecial($('#Name').val())) {
        showError('Name');
    } else if (!isEmailAddress($('#email').val())) {
        showError('email');
    } else if ($('#comment').val().length <= 0) {
        showError('comment');
    } else if ($('#commentTxt').val().length <= 0 || !isN($('#commentTxt').val())) {
        showError('commentTxt');
    } else {
        r = true;
    }
    return r;
}

// User Groups Update
function userGroup_update(id, name, subs) {
    document.UserGrFrom.Gname.value = name;
    document.UserGrFrom.Gsub.value = subs;
    document.UserGrFrom.hid.value = id;
    document.UserGrFrom.Add_Group.value = 'Update';
}

// User Groups Validate
function userGr_validate(f) {
    if (f.Gname.value == "") {
        alert("Please provide a Group Name");
        f.Gname.focus();
        return false;
    } else if (!IsNumeric(f.Gsub.value) || f.Gsub.value == "") {
        alert("Please provide a proper Subscription value (Only numbers)");
        f.Gsub.focus();
        return false;
    } else {
        return true;
    }
}


function showHide(div, image) {

    if ($('#' + div).css('display') != 'none') {
        $('#' + div).slideUp();

        $('#' + image).attr('src', 'images/system_icon/expand.png');
    } else {
        $('#' + div).slideDown();
        $('#' + image).attr('src', 'images/system_icon/collapse.png');
    }
}

function showHideDiv(id) {
    //if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
    if ($('#' + id).css('display') == 'none') {
        $('#' + id).slideDown();
    } else {
        $('#' + id).slideUp();
    }
    //}
}
function showHideAccordion(id, cval, active, allicClass) {
    if ($('#' + id).css('display') == 'none') {
        $('.' + cval).each(function () {
            $(this).slideUp();
        });
        $('#' + id).slideDown();
        $("." + allicClass).each(function () {
            $(this).removeClass('activeIcon');
        });
        $("." + active).addClass('activeIcon');

    } else {
        $("." + allicClass).each(function () {
            $(this).removeClass('activeIcon');
        });
        $('.' + cval).each(function () {
            $(this).slideUp();
        });
        $('#' + id).slideUp();
    }

}
function showHideDiv1(id) {
    if ($('#' + id).css('display') == 'none') {
        $('#' + id).slideDown();
    } else {
        $('#' + id).slideUp();
    }
}
function showHideSection(id) {
    if ($('#' + id).css('display') == 'none') {
        $('#' + id).css('display', 'block');
    } else {
        $('#' + id).css('display', 'none');
    }

}

function inputLimit(sourceid, limit, targetid) {
    var t = $('#' + sourceid).val().length;
    //alert (t);
    var totalLength = limit;

    var remainingLength = totalLength - t;
    $('#' + targetid).val(remainingLength);

    if (remainingLength < 0) {
        var v = $('#' + sourceid).val().substr(0, totalLength);
        $('#' + sourceid).val(v);
        $('#' + targetid).val('0');
    }

}

function redirect(url, time) {
    if (url) {
        url = url.replace('??', '?');
        setTimeout(function () {
            window.location.replace(url);
        }, time);
    }
}

function showMessage(){
    
}

function quickQuery(){
    $("#QuickForm").bind("submit", function () {
        var $form = $(this);
        if ($form.data('submitted') === true) {
            preventDefault();
        }
        else{
            $.ajax({
            type: "POST",
            cache: false,
            async: true,
            url: "ajax/loader.php?section=default&action=quickquery",
            data: $(this).serializeArray(),
            dataType: 'json',
            beforeSend: function(){
                $("#qSubmit").attr('disabled', 'disabled');
                $("#qSubmit").html('Submitting...');
            },
            success: function (data) {
                if(data.success == true){
                    $(".mack-an-appointment").html(data.msg);
                    $(".mack-an-appointment").parent("#reqInfo").addClass("sucBg");
                }
                else{
                    $(".dzFormMsg").html(data.msg);
                    $("#qSubmit").removeAttr('disabled', 'disabled');
                    $("#qSubmit").html('Submit');
                    $("#reqInfo").removeClass("sucBg");
                }
            },
            error:function (jqXHR){

            }
        });
        }
    });
}

MMCT - 2023