220 lines
5.7 KiB
JavaScript
220 lines
5.7 KiB
JavaScript
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("<img src='/matrix/images/loading_small.gif' width='16' height='7' title='please wait, it will take few minutes' />");
|
|
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<maxrow;rindx++)
|
|
{
|
|
cols=rows[rindx].split(ColDelim);
|
|
respHtml+="<tr style='cursor:pointer' id='row'>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+(rindx+1)+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'><input type='hidden' id='uuid"+rindx+"' value='"+cols[3]+"'/><input type='hidden' id='userid"+rindx+"' value='"+userid+"'/>"+cols[0]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[1]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[12]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[2]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[5]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[6]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[7]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[8]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[9]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[10]+"</td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal'>"+cols[11]+"</td>";
|
|
respHtml+="<td id='td"+rindx+"'><input type='checkbox' id='chkcol"+rindx+"' onclick='manageRowSelection(this.checked);checkList('chkcol','chkcolmain')' /></td>";
|
|
respHtml+="<td style='font-size:9pt;font-weight:normal;text-color:red';>"+cols[4]+"</td>";
|
|
respHtml+="</tr>";
|
|
}
|
|
if(maxrow > 0)
|
|
{
|
|
$("#tabbody").html(respHtml);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
CallMessage(response,3000,200,300);
|
|
}
|
|
}
|
|
if(oprID==3)
|
|
{
|
|
|
|
if(response.trim().search("success")>=0)
|
|
{
|
|
$("#td"+curindx).html("<img src='/matrix/images/check.png' title='success' />");
|
|
|
|
}
|
|
else
|
|
{
|
|
$("#td"+curindx).html("<img src='/matrix/images/exclm_red.png' title='"+response+"' />");
|
|
}
|
|
curindx=curindx+1;
|
|
PerformOperation();
|
|
}
|
|
} |