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 : 3.141.192.174


Current Path : /var/www/oasis/js/
Upload File :
Current File : /var/www/oasis/js/colldesp_ack.js

function Enablecolldespack() {
  $("#page_main_div").load("../html_modules/colldesp_ack.html", function () {
    document.getElementById("display_module_name").innerHTML =
      "Bundle Dispatch Acknowledgement";
    document.getElementById("module_name_for_save").value =
      "Bundle Dispatch Acknowledgement";
    getDefaultHeadFooterLinks("Bundale Dispatch Acknowledgement");

    $("#date").hide();
    $("#dates").hide();
  });
}

function Savecolldespack() {
  if (document.getElementById("examdate").value == "") {
    alert("Please Enter Exam Date");
    document.getElementById("examdate").focus();
    $("#examdate").focus();
    return;
  }

  var examdate = document.getElementById("examdate").value;

  var bulkinsert = "F";

  var inputFileds = document.getElementsByTagName("input");
  var chkCnt = 0;
  var rowCnt = 0;
  var date_arr = {};
  for (var counter = 0; counter < inputFileds.length; counter++) {
    if (
      inputFileds[counter].type.toUpperCase() == "TEXT" &&
      inputFileds[counter].name == "date"
    ) {
      ++rowCnt;

      ++chkCnt;
      date_arr[chkCnt] = new Object();
      date_arr[chkCnt]["fqpcode"] = document.getElementById(
        rowCnt + "qpcode"
      ).value;
      date_arr[chkCnt]["examdate"] = document.getElementById(
        rowCnt + "examdate"
      ).value;
      date_arr[chkCnt]["scriptcnt"] = document.getElementById(
        rowCnt + "scriptcnt"
      ).value;
      date_arr[chkCnt]["fbuno"] = document.getElementById(
        rowCnt + "fbuno"
      ).value;
      date_arr[chkCnt]["ackno"] = document.getElementById(
        rowCnt + "ackno"
      ).value;
      date_arr[chkCnt]["ackdate"] = document.getElementById(
        rowCnt + "ackdate"
      ).value;
    }
  }
  //alert(date_arr.length);

  var datastring =
    "&examdate=" +
    examdate +
    "&date_arr=" +
    encodeURIComponent(JSON.stringify(date_arr));
  //if(document.getElementById('ckbox').checked == true)
  //if(confirm('Are you sure you want to update the New date range?'))
  if (Object.size(date_arr) > 0 || bulkinsert == "T") {
    $.ajax({
      type: "POST",
      url: $host_url + "Savecolldespack",
      data: datastring,
      success: SavecolldespackResponse,
    });
  } else {
    alert("No changes made");
    return false;
  }
}

function SavecolldespackResponse($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
  getcolldespackdetails();
}

function getcolldespackdetails() {
  var examdate = document.getElementById("examdate").value;

  if (examdate == "") {
    alert("Please Enter Exam Date");
    document.getElementById("examdate").focus();
    return false;
  }

  var datastring = "&examdate=" + examdate;
  $.blockUI({
    message:
      "<h1 class = 'h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "POST",
    url: $host_url + "getcolldespackdetails",
    data: datastring,
    success: getcolldespackdetailsResponse,
  });
}

function getcolldespackdetailsResponse($responce) {
  $.unblockUI();
  $responce = eval("(" + $responce + ")");
  $("#dates").show();
  $("#date").show();

  $("table").remove("#ftable1");
  if ($responce.error_code == 0) {
    $("#dates").load("html_modules/colldesp_ackheads.html", function () {
      $("#ftable").append($responce.data["table"]);
    });
  } else {
    alert("No records found for given details.");
    $("#date").hide();
    $("#dates").hide();
  }
}

function to_upperx(id) {
  var x = document.getElementById(id).value;
  document.getElementById(id).value = x.toUpperCase();
}

function getid(id) {
  document.getElementById(id + "h").value = "U";
}