curel=null; curindx=0; maxrow=0; curoperation=1; curctrl=null; curcctrl=''; function Unlock(el,uuid,reptype) { var islocked=$(el).attr("islocked"); curel=el; if(islocked==1) { $(el).attr("src","/matrix/images/loading_small.gif"); $(el).attr("width","16"); $(el).attr("height","16"); QueryStr="val0="+uuid+"&val1="+reptype+"&val2="+$("#usid").val(); RunAjax('POST','unlockcase', QueryStr, 1); } else { CallMessage('UNLC:info:Already unlocked.',2000,200,300); } } function InitPage() { maxrow=$('#tabbody tr').length-1; $('#tabbody tr').click(function (event) { rindx=$(this).index(); if(event.target.id != "chkcol"+rindx) { if($("#chkcol"+rindx).attr("checked")=="checked") { $(this).removeClass('rowhover'); $("#chkcol"+rindx).attr("checked",false); } else { $(this).addClass('rowhover'); $("#chkcol"+rindx).attr("checked",true); } checkList("chkcol","chkparent"); } }); } function manageRowSelection(ischecked) { $("#tabbody tr").each(function(){ rindx=$(this).index(); if($("#chkcol"+rindx).attr("checked")=="checked") { $(this).addClass('rowhover'); } else { $(this).removeClass('rowhover'); } }); } // DELETE CASE function DeleteCases(operation,ctrl,cctrl) { curctrl=ctrl; curoperation=operation; curcctrl=cctrl; if(ValidateList('chkcol')>0) { var msg= operation==1 ? "You can recover all deleted case under one month.\nAre you sure to delete this case(s)?":"Are you sure to recover this case(s)?"; if(confirm(msg)) { $("#"+curcctrl).hide(); PerformOperation(); } } else { CallMessage('VLFRM:error:Please select atleast one case to start deletion process.',3000,200,300); } } function PerformOperation() { if(curindx < maxrow) { $(curctrl).hide(); if($("#chkcol"+curindx).length > 0) { var chk=$("#chkcol"+curindx); if($(chk).attr("checked")=="checked") { uuid=$("#uuid"+curindx).val(); userid=$("#userid"+curindx).val(); $("#td"+curindx).html(""); RunAjax("POST","droprecovercases","val0="+uuid+"&val1="+userid+"&val2="+curoperation,3); } else { curindx=curindx+1; PerformOperation() } } else { curindx=curindx+1; PerformOperation(); } CallMessage('1001IRNG:info:Operation completed successfully',3000,200,300); $(curctrl).show(); $("#"+curcctrl).show(); } else { curindx=0; } } function ValidateDeletecase() { var k=0; var mvcode=$("#mvcode").val(); var applno=$("#applno").val(); var name=$("#name").val(); if(mvcode != '') { k=k+1; } if(applno != '') { k=k+1; } if(name != '') { k=k+1; } if(k==0) { CallMessage('1020MQRY:error:Please provide any search key.',3000,200,300); } else { maxrow=0; $("#tabbody").html(""); RunAjax("POST","8a71870167107e8aad82cb145b2681f4","val0="+mvcode+"&val1="+applno+"&val2="+name,2); CallMessage('1001IRNG:info:Please Wait Searching is continue... .',3000,200,300); } } function AfterResponse(response,oprID) { if(oprID==1) { if(response.trim().search('Error')==-1) { CallMessage('UNLC:info:Case Unlocked.',500,200,300); $(curel).attr("src","/matrix/images/unlocked.png"); $(curel).attr("islocked","0"); $(curel).attr("title",""); } else { CallMessage(response,2000,200,300); $(curel).attr("src","/matrix/images/locked.png"); $(curel).attr("title",response); } } if(oprID==2) { if(response.trim().search('Error') == -1) { var userid=$("#usid").val(); var rows=response.split(RowDelim); maxrow = rows.length-1; var respHtml=''; for(rindx=0;rindx"; respHtml+=""+cols[0]+""; respHtml+=""+cols[1]+""; respHtml+=""+cols[12]+""; respHtml+=""+cols[2]+""; respHtml+=""+cols[5]+""; respHtml+=""+cols[6]+""; respHtml+=""+cols[7]+""; respHtml+=""+cols[8]+""; respHtml+=""+cols[9]+""; respHtml+=""+cols[10]+""; respHtml+=""+cols[11]+""; respHtml+=""; respHtml+=""+cols[4]+""; respHtml+=""; } if(maxrow > 0) { $("#tabbody").html(respHtml); } } else { CallMessage(response,3000,200,300); } } if(oprID==3) { if(response.trim().search("success")>=0) { $("#td"+curindx).html(""); } else { $("#td"+curindx).html(""); } curindx=curindx+1; PerformOperation(); } }