0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.119.133.214


Current Path : /proc/thread-self/root/var/www/oasis/js_old/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/js_old/admchallanpreparation.js

function CallAdmChallanPreparation() {
  $("#page_main_div").load(
    "../html_modules/admchallanpreparation.html",
    function() {
      document.getElementById("display_module_name").innerHTML =
        "Prepare Admission Document";
      document.getElementById("module_name_for_save").value =
        "Admission Challan Preparation";
      getDefaultHeadFooterLinks("Admission Challan Preparation");
      $(".ui-tabs .ui-tabs-panel").css("padding", "0px");
      $("#totappno").hide();
      $(".ui-tabs .ui-tabs-panel").css("padding-top", "21px");
    }
  );
}

function DisplayAdmChallanPreparationDetails() {
  $("#totapp").val(0);
  $("#totamount").val(0);
  var degree_from = $("#report_from_degree_code").val();
  //var degree_to   = $('#report_to_degree_code').val();
  var appfrom = $("#appfrom").val();
  var appto = $("#appto").val();

  if (degree_from == "") {
    alert("Please enter degree from");
    return;
  } else if (appfrom == "") {
    /*else if(degree_to == '')
	{
		alert('Please enter degree to');
		return;
	}*/
    alert("Please enter application from");
    return;
  } else if (appto == "") {
    alert("Please enter application to");
    return;
  }

  $.ajax({
    type: "POST",
    data:
      "&appfrom=" + appfrom + "&appto=" + appto + "&degree_from=" + degree_from,
    url: $host_url + "DisplayAdmChallanPreparationDetails",
    success: DisplayAdmChallanPreparationDetailsResponce
  });
}

function DisplayAdmChallanPreparationDetailsResponce(responce) {
  responce = eval("(" + responce + ")");
  $("#totappno").show();
  $("#ack_rv_rt_application_details").html("");
  $("#ack_rv_rt_application_details").html(responce.data["html"]);
}

function DeleteAckowledgedApplications(APPNO) {
  var flag = confirm("Do you want to Delete Ackowledgement");
  if (flag) {
    $.ajax({
      type: "POST",
      data: "&APPNO=" + APPNO,
      url: $host_url + "DeleteAckowledgedApplications",
      success: function DeleteAckowledgedApplicationsResponce(responce) {
        responce = eval("(" + responce + ")");
        DisplayChallanPreparationDetails();
      }
    });
  }
}

function SelectAllChallanPreparationCheckBox() {
  var obj = $("input[id*='ack_check_box_']");
  var amount = 0;
  var totappno = 0;
  var totamount = 0;

  jQuery.each(obj, function(k, v) {
    if ($(this).is(":checked")) {
      $(this).attr("checked", false);
      totamount = 0;
      totappno = 0;
    } else {
      $(this).attr("checked", true);
      amount = $("#amount_" + $(this).val()).html();
      totappno = parseInt(totappno) + 1;

      totamount = parseInt(totamount) + parseInt(amount);
    }
  });

  $("#totapp").val(totappno);
  $("#totamount").val(totamount);
}

function gettotalchallanamount(app_no) {
  var amount = $("#amount_" + app_no).html();
  var totappno = $("#totapp").val();
  var totamount = $("#totamount").val();

  if ($("#ack_check_box_" + app_no).is(":checked")) {
    totappno = parseInt(totappno) + 1;
    totamount = parseInt(totamount) + parseInt(amount);
  } else {
    totappno = parseInt(totappno) - 1;
    totamount = parseInt(totamount) - parseInt(amount);
  }

  $("#totapp").val(totappno);
  $("#totamount").val(totamount);
}

function PrepareAdmChallanDetails() {
  checked_app_nos = new Array();

  var FAPPCNT = $("#totapp").val();
  var FCHALAMT = $("#totamount").val();

  var obj = $("input[id*='ack_check_box_']");
  jQuery.each(obj, function(k, v) {
    row_id = v["id"].split("_")[3];
    if ($(this).is(":enabled:checked"))
      checked_app_nos.push("'" + row_id + "'");
  });

  if (empty(checked_app_nos)) {
    alert("Please select minumum one application to Prepare Challan.");
    return false;
  }

  $.ajax({
    type: "POST",
    data:
      "checked_app_nos=" +
      checked_app_nos +
      "&FCHALAMT=" +
      FCHALAMT +
      "&FAPPCNT=" +
      FAPPCNT,
    url: $host_url + "PrepareChallanDetailsForAdm",
    success: PrepareChallanDetailsForAdmResponce
  });
}

function PrepareChallanDetailsForAdmResponce(responce) {
  responce = eval("(" + responce + ")");
  //alert(responce.data);

  var amount = $("#challamt").html();
  var totapp = $("#totapp").html();
  var docno = $("#docno").html();
  var FPAYMENTYPE = "POSTOFFICE";
  var parameters = `&amount=${amount}&totapp=${totapp}&docno=${docno}&FPAYMENTYPE=${FPAYMENTYPE}`;

  $("#challan_dialog").remove();
  $(".contents").append(
    "  <div id='challan_dialog' title='Challan Prepared Successfully'></div>"
  );
  $("#challan_dialog").dialog({
    autoOpen: false,
    modal: true,
    width: 400,
    buttons: {
      Ok: function() {
        $(this).dialog("close");
        CallAdmChallanPreparation();
        window.location.href =
          $host_url + "PrintApplicationFormAdmPOSTOFFICE.demo" + parameters;
      },
      Cancel: function() {
        $(this).dialog("close");
        CallAdmChallanPreparation();
        window.location.href =
          $host_url + "PrintApplicationFormAdmPOSTOFFICE.demo" + parameters;
      },
      Print: function() {
        $(this).dialog("close");
        CallAdmChallanPreparation();
        window.location.href =
          $host_url + "PrintApplicationFormAdmPOSTOFFICE.demo" + parameters;
      }
    }
  });
  $("#challan_dialog").dialog("open");
  $("#challan_dialog").html(responce.data["html"]);
}

function CloseChallanDialog() {
  //$('#challan_dialog').dialog('close');
  var amount = $("#challamt").html();
  var totapp = $("#totapp").html();
  var docno = $("#docno").html();
  var FPAYMENTYPE = "POSTOFFICE";
  var parameters = `&amount=${amount}&totapp=${totapp}&docno=${docno}&FPAYMENTYPE=${FPAYMENTYPE}`;
  window.location.href =
    $host_url + "PrintApplicationFormAdmPOSTOFFICE.demo" + parameters;
}

function printchallan() {
  var amount = $("#challamt").html();
  var totapp = $("#totapp").html();
  var docno = $("#docno").html();
  var FPAYMENTYPE = "POSTOFFICE";
  var parameters = `&amount=${amount}&totapp=${totapp}&docno=${docno}&FPAYMENTYPE=${FPAYMENTYPE}`;
  console.log(parameters);
  window.location.href =
    $host_url + "PrintApplicationFormAdmPOSTOFFICE.demo" + parameters;
}