var childCnt=''; var curProc='ear'; var curStatus='Waiting'; function ExpandList(elmId) { $("#"+elmId+"child").toggle(); } function showDedupePanel(cutList) { var optDiv=document.createElement("div"); optDiv.setAttribute("id","FormPanel"); optDiv.setAttribute("class","FormPanel"); optDiv.setAttribute("style","font-family:Tahoma;overflow:visible;padding-right:3px;width:480px"); var ControlsPanel=""; ControlsPanel=ControlsPanel+""; ControlsPanel=ControlsPanel+""; ControlsPanel=ControlsPanel+""; ControlsPanel=ControlsPanel+""; ControlsPanel=ControlsPanel+"
Checking for EarlierWaiting...
Checking for NegativeWaiting...
"; optDiv.innerHTML=ControlsPanel; ShowInputDialog(optDiv,"Checking Earlier and Negative","dedupe","ProcDialog"); } function StartDedupeRun(cutList,ProcDialog) { StartEarlierRun(cutList); } function StartEarlierRun(cutList) { curProc='ear'; curStatus='Checking for Earlier'; var label=" "+curStatus+""; $("#tdearlabel").html(label); ProgressBar("tdearrun","Record",cutList,12,"REGULAR"); StartDedupeProcess(cutList,'ear',1); } function StartNegativeRun(cutList) { curProc='neg'; curStatus='Checking for Negative'; var label=" "+curStatus+""; $("#tdneglabel").html(label); ProgressBar("tdnegrun","Record",cutList,12,"REGULAR"); StartDedupeProcess(cutList,'neg',2); } function updateLabels(Proc) { var label=" "+curStatus+""; $("#td"+Proc+"label").html(label); $("#td"+Proc+"run").html("Processed : "+nextPos+" Success : "+success+" Failed : "+failed+" Skipped : "+skipped+""); } function StartDedupeProcess(cutList,Childid,OprID) { success=0; failed=0; nextPos=1; skipped=0; progresswidth=0; curPos=1; SourceTable=cutList; RowId=''; found=$("#"+SourceTable+" tr").length-1; progbarwidth=$("#progressbar").width(); ProgPerRec=(progbarwidth/found).toFixed(2); if(found>0) { ExtractSendRecord(Childid,OprID); } else { CallMessage('EMPTOBX:info:List is empty or already processed.',3000,200,300); } } function ExtractSendRecord(Childid,oprId) { RowId=$("#"+SourceTable+" tr:eq("+curPos+")").attr("id").replace("row",""); var uuid=$("#uuid"+RowId).val(); var process=$("#row"+RowId+""+Childid); var val3=$("#curu").val(); childCnt=Childid; if($(process).val()=="Y") { QryStr="val="+uuid+"&val1="+oprId+"&val2=Y&val3="+val3; RunAjax("GET","checkdedupe",QryStr,oprId); } else { AfterResponse('skipped:',oprId); } } function AfterResponse(AjaxResponse,OprID) { if(OprID==1 || OprID==2) { if(AjaxResponse.search("success:")==0) { success=success+1; $("#td"+RowId+""+childCnt).attr("bgcolor", '#a6fc8e'); $("#sp"+RowId+""+childCnt).html("D"); $("#row"+RowId+""+childCnt).val("D"); } else if(AjaxResponse.search("skipped:")==0) { skipped=skipped+1; /*if(OprID==1) { curPos=curPos+1; } else { $("#row"+RowId).remove(); }*/ } else { failed=failed+1; ///$("#imgstatus"+RowId).attr("src", "/matrix/images/smsfailed.png"); $("#row"+RowId).attr("title", AjaxResponse); $("#sp"+RowId+""+childCnt).html("F"); $("#td"+RowId+""+childCnt).attr("bgcolor", "#ffcabf"); } if((nextPos==found)) { if(OprID==1) { curStatus='Earlier Check Completed.'; updateLabels(curProc); StartNegativeRun(SourceTable); } else { curStatus='Negative Check Completed.'; updateLabels(curProc); } return 0; } curPos=curPos+1; UpdateProgress(); nextPos=nextPos+1; ExtractSendRecord(childCnt,OprID); } }