365 lines
11 KiB
JavaScript
365 lines
11 KiB
JavaScript
$( document ).ready(function() {
|
|
var userid = $("#userid").val();
|
|
if(!(userid == 81 || userid == 140 || userid == 84 || userid == 21 || userid == 448)){
|
|
$(".col-verifierlimit").hide();
|
|
$(".col-visitdone").hide();
|
|
}
|
|
});
|
|
|
|
function DoOperations()
|
|
{
|
|
if($("#subtotal").val()=='Y')
|
|
{
|
|
$("[id*=num]").each(function(){
|
|
sval=parseInt($(this).html());
|
|
eid=$(this).attr("id").replace("num","tot");
|
|
eval=parseInt($("#"+eid).html().replace('<b>','').replace('</b>',''));
|
|
/*if(eid=='tot-visdone'){
|
|
alert($(this).attr('id')+'-'+sval+'-'+$(this).html());
|
|
alert(eval);
|
|
}*/
|
|
eval=sval+eval;
|
|
$("#"+eid).html("<b>"+eval+"</b>");
|
|
});
|
|
}
|
|
if($("#gtotal").length > 0 && $("#gtotal").val()=='Y')
|
|
{
|
|
$("[id^=tot]").each(function(){
|
|
sval=parseInt($(this).html().replace('<b>','').replace('</b>',''));
|
|
eid=$(this).attr("gparent");
|
|
eval=parseInt($("#"+eid).html().replace('<b>','').replace('</b>',''));
|
|
eval=sval+eval;
|
|
$("#"+eid).html("<b>"+eval+"</b>");
|
|
});
|
|
}
|
|
if($("#misname").length > 0)
|
|
{
|
|
if($("#misname").val()=='VERVMIS')
|
|
{
|
|
var val=parseInt($("#totsbk").html().replace('<b>','').replace('</b>',''));
|
|
var val1=parseInt($("#totbk").html().replace('<b>','').replace('</b>',''));
|
|
if(val!=0 && val1!=0)
|
|
{
|
|
$("#totprbk").html("<b>"+((val*100)/val1).toFixed(0)+"</b>");
|
|
}
|
|
val=parseInt($("#totsam").html().replace('<b>','').replace('</b>',''));
|
|
val1=parseInt($("#totam").html().replace('<b>','').replace('</b>',''));
|
|
if(val!=0 && val1!=0)
|
|
{
|
|
$("#totpram").html("<b>"+((val*100)/val1).toFixed(0)+"</b>");
|
|
}
|
|
val=parseInt($("#totspm").html().replace('<b>','').replace('</b>',''));
|
|
val1=parseInt($("#totpm").html().replace('<b>','').replace('</b>',''));
|
|
if(val!=0 && val1!=0)
|
|
{
|
|
$("#totprpm").html("<b>"+((val*100)/val1).toFixed(0)+"</b>");
|
|
}
|
|
}
|
|
if($("#misname").val()=='OPRMIS')
|
|
{
|
|
$("[id*=totfigures-]").each(function(){
|
|
var suffix=$(this).attr("id").replace("totfigures","");
|
|
var val=parseInt($("#totsbk"+suffix).html().replace('<b>','').replace('</b>',''));
|
|
var val1=parseInt($("#totbk"+suffix).html().replace('<b>','').replace('</b>',''));
|
|
if(val!=0 && val1!=0)
|
|
{
|
|
$("#totprbk"+suffix).html("<b>"+((val*100)/val1).toFixed(0)+"</b>");
|
|
}
|
|
val=parseInt($("#totsam"+suffix).html().replace('<b>','').replace('</b>',''));
|
|
val1=parseInt($("#totam"+suffix).html().replace('<b>','').replace('</b>',''));
|
|
if(val!=0 && val1!=0)
|
|
{
|
|
$("#totpram"+suffix).html("<b>"+((val*100)/val1).toFixed(0)+"</b>");
|
|
}
|
|
val=parseInt($("#totspm"+suffix).html().replace('<b>','').replace('</b>',''));
|
|
val1=parseInt($("#totpm"+suffix).html().replace('<b>','').replace('</b>',''));
|
|
if(val!=0 && val1!=0)
|
|
{
|
|
$("#totprpm"+suffix).html("<b>"+((val*100)/val1).toFixed(0)+"</b>");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
$(".detailheaderbox").each(function(){
|
|
$(this).css("cursor","pointer");
|
|
$(this).attr("title","double click to remove this column");
|
|
$(this).dblclick(function()
|
|
{
|
|
var col = $(this).parent().children().index($(this));
|
|
var tab = $(this).parent().parent().parent();
|
|
$('table:eq(1) td:nth-child('+(col+1)+'),table:eq(1) th:nth-child('+(col+1)+')').hide();
|
|
});
|
|
});
|
|
|
|
}
|
|
function HideCols(colindx)
|
|
{
|
|
|
|
}
|
|
function DateRangeMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split(" ");
|
|
var d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#fromdate").val(d+dt[1]);
|
|
dt=$("#Todate").val().split(" ");
|
|
d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#todate").val(d+dt[1]);
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function PortDateTimeRangeMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split(" ");
|
|
var d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#fromdate").val(d+dt[1]);
|
|
dt=$("#Todate").val().split(" ");
|
|
d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#todate").val(d+dt[1]);
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#bkbranchid").val($("#bkbranch_id").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function PortFromToDateRangeMIS(pageURL){
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split("/");
|
|
var d=dt[2]+"/"+dt[1]+"/"+dt[0];
|
|
$("#fromdate").val(d);
|
|
dt=$("#Todate").val().split("/");
|
|
d=dt[2]+"/"+dt[1]+"/"+dt[0];
|
|
$("#todate").val(d);
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#bkbranchid").val($("#bkbranch_id").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function PortDateOptRangeMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split(" ");
|
|
var d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#fromdate").val(d+dt[1]);
|
|
dt=$("#Todate").val().split(" ");
|
|
d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#todate").val(d+dt[1]);
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#bkbranchid").val($("#bkbranch_id").val());
|
|
$("#searchby").val($("#optfields").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function PortVerifierMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#verifierid").val($("#verifier_id").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function PortwiseVisitMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split("/");
|
|
var d=dt[2]+"/"+dt[1]+"/"+dt[0];
|
|
$("#fromdate").val(d);
|
|
$("#todate").val($("#Todate").val());
|
|
$("#userid").val($("#user_id").val());
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#verifierid").val($("#verifier_id").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function PortBranchMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#bkbranchid").val($("#bkbranch_id").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function BasicPortDTMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split(" ");
|
|
var d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#fromdate").val(d+dt[1]);
|
|
dt=$("#Todate").val().split(" ");
|
|
d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#todate").val(d+dt[1]);
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#mvcode").val($("#mv_code").val());
|
|
$("#applno").val($("#appl_no").val());
|
|
$("#name").val($("#customername").val());
|
|
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function BasicPortUsrDTMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split(" ");
|
|
var d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#fromdate").val(d+dt[1]);
|
|
dt=$("#Todate").val().split(" ");
|
|
d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#todate").val(d+dt[1]);
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#userid").val($("#user_id").val());
|
|
$("#mvcode").val($("#mv_code").val());
|
|
$("#applno").val($("#appl_no").val());
|
|
$("#name").val($("#customername").val());
|
|
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function BasicPortVerDTMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split(" ");
|
|
var d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#fromdate").val(d+dt[1]);
|
|
dt=$("#Todate").val().split(" ");
|
|
d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#todate").val(d+dt[1]);
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#userid").val($("#user_id").val());
|
|
$("#verifierid").val($("#verifier_id").val());
|
|
$("#mvcode").val($("#mv_code").val());
|
|
$("#applno").val($("#appl_no").val());
|
|
$("#name").val($("#customername").val());
|
|
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function MonthlyDetVisitMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split(" ");
|
|
var d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#fromdate").val(d+dt[1]);
|
|
dt=$("#Todate").val().split(" ");
|
|
d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#todate").val(d+dt[1]);
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#userid").val($("#user_id").val());
|
|
$("#verifierid").val($("#verifier_id").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function PSOVDTMIS(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split(" ");
|
|
var d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#fromdate").val(d+dt[1]);
|
|
dt=$("#Todate").val().split(" ");
|
|
d=dt[0].split("/")[2]+"/"+dt[0].split("/")[1]+"/"+dt[0].split("/")[0]+" ";
|
|
$("#todate").val(d+dt[1]);
|
|
$("#portfolioid").val($("#portfolio_id").val());
|
|
$("#verifierid").val($("#verifier_id").val());
|
|
$("#userid").val($("#user_id").val());
|
|
$("#mvcode").val($("#mv_code").val());
|
|
$("#applno").val($("#appl_no").val());
|
|
$("#name").val($("#customername").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function VerDateNTime(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split("/");
|
|
var d=dt[2]+"/"+dt[1]+"/"+dt[0];
|
|
$("#fromdate").val(d);
|
|
$("#todate").val($("#Todate").val());
|
|
$("#verifierid").val($("#verifier_id").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function VerDDTFilter(pageURL)
|
|
{
|
|
if(checkForm())
|
|
{
|
|
var dt=$("#Fromdate").val().split("/");
|
|
var d=dt[2]+"/"+dt[1]+"/"+dt[0];
|
|
$("#fromdate").val(d);
|
|
dt=$("#Todate").val().split("/");
|
|
d=dt[2]+"/"+dt[1]+"/"+dt[0];
|
|
$("#todate").val(d);
|
|
$("#time").val($("#Time").val());
|
|
$("#verifierid").val($("#verifier_id").val());
|
|
SubmitForm(pageURL, "_blank", "filter");
|
|
}
|
|
}
|
|
function Subvisreport(verid,mtype,pageurl,qid,title)
|
|
{
|
|
$("#qid").val(qid);
|
|
$("#title").val(title);
|
|
if(mtype=='opr')
|
|
{
|
|
$("#userid").val(verid);
|
|
}
|
|
else
|
|
{
|
|
$("#verifierid").val(verid);
|
|
}
|
|
$("#mtype").val(mtype);
|
|
SubmitForm(pageurl, "_blank", "filter");
|
|
}
|
|
function Subvismreport(fdt,verid,mtype,pageurl,qid,title)
|
|
{
|
|
var todt=$("#todate").val();
|
|
$("#qid").val(qid);
|
|
$("#fromdate").val(fdt);
|
|
$("#todate").val($("#time").val());
|
|
$("#title").val(title);
|
|
if(mtype=='opr')
|
|
{
|
|
$("#userid").val(verid);
|
|
}
|
|
else
|
|
{
|
|
$("#verifierid").val(verid);
|
|
}
|
|
$("#mtype").val(mtype);
|
|
SubmitForm(pageurl, "_blank", "filter");
|
|
("#todate").val(todt);
|
|
}
|
|
function loadbranch(elval)
|
|
{
|
|
QryStr="val0="+elval;
|
|
RunAjax("POST","branchlist",QryStr,1);
|
|
}
|
|
function AfterResponse(AjaxResponse,OprID)
|
|
{
|
|
if(OprID==1)
|
|
{
|
|
if(AjaxResponse.search('Error')>=0)
|
|
{
|
|
CallMessage(AjaxResponse,3000,200,300);
|
|
}
|
|
else
|
|
{
|
|
$("#bkbranch_id").html("<option value='-1' selected>SELECT</option><option value='0' >ALL</option>");
|
|
recs=AjaxResponse.split(RowDelim);
|
|
for(indx=0;indx<recs.length-1;indx++)
|
|
{
|
|
$("#bkbranch_id").append("<option value='"+recs[indx].split(ColDelim)[0]+"'>"+recs[indx].split(ColDelim)[1]+"</option>");
|
|
}
|
|
}
|
|
}
|
|
} |