<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">function RedirectURL(url) { window.location.href = url; }

function SetModelDisplay(MyModel, show_hide) {
    $("#" + MyModel).modal(show_hide);
}

var AttachmentType = {
    Map: 1,
    Aggrement: 2,
    CNIC: 3,
    Transfer: 4,
    Witness: 5,
    LedgerAttach:6
};
function parseToFloat(value) {
    const parsed = parseFloat(value);
    return isNaN(parsed) ? 0 : parsed;
}


function adjustIframeHeight(myIframe) {
    const iframe = document.getElementById(myIframe); // Replace 'myIframe' with the iframe's ID
    if (iframe &amp;&amp; iframe.contentWindow.document.body) {
        const contentHeight = iframe.contentWindow.document.body.scrollHeight;
        iframe.style.height = contentHeight + 'px'; // Dynamically adjust the height
    }
}
 
function parseToInt(value) {
    const parsed = parseInt(value);
    return isNaN(parsed) ? 0 : parsed;
}

function showtoastrMSg(msg,issucesss) {
    if (issucesss) {
       if (parent &amp;&amp; parent.toastr) {
            parent.toastr.success(msg);
        } else {
            toastr.success(msg);
        }
    }
    else {
        if (parent &amp;&amp; parent.toastr) {
            parent.toastr.error(msg, 'Error');
        } else {
            toastr.error(msg, 'Error');
        }
    }
    
}
  
function ServingenableDisable(parentdrop, reqVal, enabledisabletxt) {
    if ($('#' + parentdrop + ' option:selected').val().trim() == reqVal) {
        $('#' + enabledisabletxt).prop('disabled', false);
    }
    else {
        $('#' + enabledisabletxt).prop('disabled', true);
        $('#' + enabledisabletxt).val("");
    }
}

 
function showalertmsg(typeid, Msg)
{
   
    if (typeid == 1) {
        showtoastrMSg(Msg, 1)
        //$('#alertMessage').removeClass('alert-danger');
        //$('#alertMessage').addClass('alert-success show');
        //$("#alertMessage").html("");
        //$("#alertMessage").html(Msg);
    }
    else {
        showtoastrMSg(Msg,0)
        //$('#alertMessage').removeClass('alert-success');
        //$('#alertMessage').addClass('alert-danger show');
        //$("#alertMessage").html("");
        //$("#alertMessage").html(Msg);
    }
    //setTimeout(function () {
    //    //document.getElementById("alertMessage").innerHTML = '';
    //    //$('#alertMessage').removeClass('alert-danger');
    //    //$('#alertMessage').removeClass('alert-success');
    //    //document.getElementById("alertMessage").style.display = "none";
    //}, 5000);
}
 

//function showalertmsg(typeid, Msg) {
//    document.getElementById("msgpanel").style.display = "block";
//    if (typeid == 1) {
//        $('#alertMessage').removeClass('alert-danger');
//        $('#alertMessage').addClass('alert-success show');
//        $("#alertMessage").html("");
//        $("#alertMessage").html(Msg);
//    }
//    else {
//        $('#alertMessage').removeClass('alert-success');
//        $('#alertMessage').addClass('alert-danger show');
//        $("#alertMessage").html("");
//        $("#alertMessage").html(Msg);
//    }
//    setTimeout(function () {
//        document.getElementById("alertMessage").innerHTML = '';
//        $('#alertMessage').removeClass('alert-danger');
//        $('#alertMessage').removeClass('alert-success');
//        document.getElementById("msgpanel").style.display = "none";
//    }, 5000);
//}


function setCNIC(txt) {
    txt.value = txt.value.replace(/[^0-9\n\r-]+/g, '');

}
function IS_eMAIL(txt) {
    txt.value = txt.value.replace(/^w+[+.w-]*@([w-]+.)*w+[w-]*.([a-z]{2,4}|d+)$/i);
}

function IS_iNT(txt) {
    txt.value = txt.value.replace(/[^0-9\n\r]+/g, '');
}
 
function IS_cellno(txt) {
    txt.value = txt.value.replace(/[^0-9\n\r+]+/g, '');
}

function CheckValidCNIC(txt) {
    txt.value = txt.value.replace(/[^0-9\n\r]+/g, '');
    if (txt.value.length &lt; 13) {
        txt.value = "";
        txt.focus();
    }
}

function setYearCurrent(txt) {
    txt.value = txt.value.replace(/[^0-9\n\r]+/g, '');
    var CYear = new Date().getFullYear();
    if (txt.value &gt; CYear) {
        txt.value = "";
        
    }
    if (txt.value &lt; 1950) {
        txt.value = "";
        
    }
}

function IS_DignUMERIC(txt) {
    txt.value = txt.value.replace(/[^0-9\n\r.]+/g, '');
}

function IS_aLPHA(txt) {
    txt.value = txt.value.replace(/[^a-zA-Z \n\r\/,]+/g, '');
}

function floatMax(txt, MinInt, MaxInt) {
    txt.value = txt.value.replace(/[^0-9\n\r.]+/g, '');
    if ((txt.value &lt; MinInt) || (txt.value &gt; MaxInt)) {
        txt.value = "";
    }
}

function floatMin(txt, MinInt) {
    txt.value = txt.value.replace(/[^0-9\n\r.]+/g, '');
    if ((txt.value &lt; MinInt)) {
        txt.value = "";
    }
}

function IntMax(txt, MinInt, MaxInt) {
    txt.value = txt.value.replace(/[^0-9\n\r]+/g, '');
    if ((txt.value &lt; MinInt) || (txt.value &gt; MaxInt)) {
        txt.value = "";
    }
}




function ValidateTextBox(TextboxName, Msg) {
    var _retval = true;
    var getVal = TextboxName.val().trim();
    if (getVal === "")
    {
        alert(Msg);
        TextboxName.focus();
        _retval = false;
    }
    return _retval;
}


function ValidateTextBoxbyDiv(TextboxName, Msg) {
    var _retval = true;
    var getVal = TextboxName.val().trim();
    if (getVal === "") {
        showtoastrMSg(Msg, 0);
        TextboxName.focus();
        _retval = false;
    }
    return _retval;
}

function showHide() {
    var PayMethod = document.getElementById('cboPayMethod')
    if (PayMethod.value == 2) {
        document.getElementById('hidden-panel').style.display = 'block'
        document.getElementById('hidden-panel1').style.display = 'none'
    }
    else if (PayMethod.value == 3) {
        document.getElementById('hidden-panel1').style.display = 'block'
        document.getElementById('hidden-panel').style.display = 'none'
    }

    else {
        document.getElementById('hidden-panel').style.display = 'none'
        document.getElementById('hidden-panel1').style.display = 'none'
    }
}

function GetcheckboxVal(chboxIsown) {
    var IsOwn = "";
    if ($("#" + chboxIsown).prop('checked')) {
        IsOwn = 1;
    } else {
        IsOwn = 0;
    }
    return IsOwn;
}

function IssessionConnected(sessionvalue) {
    if (sessionvalue&gt;0) {
        return true;
    }
    else {
        return false;
    }
    // if sesssion empty then login page
    //and resturn false
    // else true
}

 function not67(types,msgs) {
            notif({
                type: types,
                msg: msgs,
                position: "center",
                opacity: 0.8
            });
}


function GetDataGrid(dt,SucessFunction, ParamVal, Spname)
{
    $.ajax({
        type: "POST",
        dataType: "json",
        url: "WSLNDasmx.asmx/PostBack?dt=" + dt +"&amp;Spname=" + Spname,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify({ values: ParamVal }),
        success: SucessFunction,
        failure: function (response) {
            showtoastrMSg(response.d, 0);
        },
        error: function (responce) {
            showtoastrMSg(response.d, 0);
        }
    });
}

function GetnvarcharDataGrid(dt, SucessFunction, ParamVal, Spname) {
    $.ajax({
        type: "POST",
        dataType: "json",
        url: "WSLNDasmx.asmx/PostBacknvarchar?dt=" + dt + "&amp;Spname=" + Spname,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify({ values: ParamVal }),
        success: SucessFunction,
        failure: function (response) {
            showtoastrMSg(response.d, 0);
        },
        error: function (responce) {
            showtoastrMSg(response.d, 0);
        }
    });
}
function getJsonData(SucessFunction, ParamVal, Spname)
{
    $.ajax({
        type: "POST",
        dataType: "json",
        url: "WSLNDasmx.asmx/getDashboardCharts?Spname=" + Spname,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify({ values: ParamVal }),
        success: SucessFunction,
        failure: function (response) {
            showtoastrMSg(response.d, 0);
        },
        error: function (responce) {
            showtoastrMSg(response.d, 0);
        }
    });
}
 


function GetJsonObjData(SucessFunction, ParamVal, Spname) {
    $.ajax({
        type: "POST",
        dataType: "json",
        url: "WSLNDasmx.asmx/GetJsonObjectData?Spname=" + Spname,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify({ values: ParamVal }),
        success: SucessFunction,
        failure: function (response) {
            showtoastrMSg(response.d, 0);
        },
        error: function (responce) {
            showtoastrMSg(response.d, 0);
        }
    });
}

function GetRedirect(PrimaryID, PageName) {

    $.ajax({
        type: "POST",
        url: "WSLNDasmx.asmx/RedirectURL",
        data: '{id:' + PrimaryID + ',pagename:"' + PageName + '"}',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (response) {
            location.href = response.d;
        },
        failure: function (response) {
            showtoastrMSg(response.d, 0);
        }
    });
}
  
function GetProDefaults()
{
    $.ajax({
        type: "GET",
        url: "project.xml", // Path to the XML file
        dataType: "xml",
        success: function (xml) {
            const project = $(xml).find("Project");
           
            if (project.find("LogoPath").text().length &gt; 0)
            {
                $("#Project_Name_Site").html(' &lt;img class="img-responsive" width="120" height="90" src="' + project.find("LogoPath").text() + '" alt="' + project.find("Name").text() + '" /&gt;' + project.find("Name").text());
            }
            else {
                $("#Project_Name_Site").text(project.find("Name").text());
            }
        },
        error: function () {
            showtoastrMSg("Failed to load XML file.", 0);   
        }
    });
}



 </pre></body></html>