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.147.82.108


Current Path : /proc/thread-self/root/var/www/html/reva/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/reva/js/iaabsentEntry.js

function CallIAAbsentEntry() {
  $("#page_main_div").load("html_modules/iaabsententry.html", function () {
    document.getElementById("display_module_name").innerHTML =
      "IA Absent Entry";
    document.getElementById("module_name_for_save").value = "IA Absent Entry";
    getDefaultHeadFooterLinks("IA Absent Entry");
  });
}
function calliaabsentenrty(){
    getIaAESession()
}
function getIaAESession() {
  var date = document.getElementById("frm_date").value;
  //   var session = document.getElementById("session").value;
  //   let param = "batch=" + batch + "&date=" + date + "&session=" + session;

  $.ajax({
    type: "GET",
    url: $host_url + "getIaAESession",
    data: "&date=" + date,
    success: function (res) {
      var response = JSON.parse(res);
      if (response.error_code == 0) {
        var session = "";
        session += `<option value="">Select Session</option>`;
        for (var i = 0; i < response.data.length; i++) {
          session += `<option value="${response.data[i].FSESSION}">${response.data[i].FSESSION} </option>`;
        }
        $("#session").html(session);
      } else {
        alert(response.data);
        return;
      }
    },
  });
}

function getRoomsAllotmnt() {
  var date = document.getElementById("frm_date").value;
  var session = document.getElementById("session").value;

  //  "batch=" + batch +
  let param = "&date=" + date + "&session=" + session;
  $.ajax({
    type: "GET",
    url: $host_url + "getRoomsAllotmnt",
    data: param,
    success: function (res) {
      var response = JSON.parse(res);
      if (response.error_code == 0) {
        var room = "";
        room += `<option value="">Select Room No.</option>`;
        for (var i = 0; i < response.data.length; i++) {
          room += `<option value="${response.data[i].froomno}">${response.data[i].froomno}-${response.data[i].froomname} </option>`;
        }
        $("#room").html(room);
      } else {
        alert(response.data);
        return;
      }
    },
  });
}

function viewIAAbsentEntryDet() {
  var date = document.getElementById("frm_date").value;
  var session = document.getElementById("session").value;
  var room = document.getElementById("room").value;
  if(date =='')
  {
    alert("Please Enter the Exam Date");
    return;
  }
  if(session =='')
  {
    alert("Please Enter the Exam conducted timing or Session ");
    return;
  }
  if(room =='')
  {
    alert("Please Enter the Room NO.");
    return;
  }
  $(".loader").show();
  let param = "&date=" + date + "&session=" + session + "&room=" + room;
  $.ajax({
    type: "GET",
    url: $host_url + "viewIAAbsentEntryDet",
    data: param,
    success: function (res) {
      var response = JSON.parse(res);

      var table = `<table align="center" width="100%" cellspacing="0" cellpadding="1" border="1" style="border-radius:5px">
      <thead style="position: sticky;top: 0;">
        <tr>
        <th align="left" colspan="7" class="ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper" 
        style="font-size:12px; padding-left:6px; height:24px;">TAB No. Entry</th>
        </tr>

        <tr class="ui-state-default ui-jqgrid-hdiv">
        <td align="center" style="width:30px; font-size:12px; 
        border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; 
        border-bottom:1px solid #C5DBEC;">Sl. No.</td>

        <td align="center" style="width:96px; font-size:12px; 
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">REG.NO.</td>

        <td align="center" style="width:180px; font-size:12px; padding:5px 5px; 
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">NAME</td>

        <td align="center" style="width:50px; font-size:12px; padding:5px 5px; 
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">ROOM NAME.</td>

        <td align="center" style="width:155px; font-size:12px; padding:5px 5px; 
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">TAB NUMBER</td>

        <td align="center" style="width:155px; font-size:12px; padding:5px 5px; 
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">DUMMY NO. ENTRY</td>

        </tr>
        </thead> <tbody>`;

      if (response.error_code == 0) {
        for (var i = 0; i < response.data.length; i++) {
          table += `<tr class="ui-widget-content jqgrow" value="${
            response.data[i].fhallno
          }">
            <td class="tbl_row_new" style="border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">
            ${i + 1}
            </td >
            <td class="tbl_row_new" style="text-align:center;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">
            ${response.data[i].fregno}
            </td>
            <td class="tbl_row_new" style="text-align:initial;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;padding-left: 11px;">
            ${response.data[i].fname}
            </td>
            <td class="tbl_row_new" style="text-align:center;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">
            ${response.data[i].fhallno}
            </td>
            <td class="tbl_row_new" style="text-align:initial;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;padding-left: 11px;">
            <input type="text" value=" ${
              response.data[i].FLMID
            }" style="width: 95%;" id="tab_no_${i + 1}"  />
            </td>
            <td class="tbl_row_new" style="text-align:initial;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;padding-left: 11px;">
            <input type="text" value=" ${
              response.data[i].FDUMMYNO
            }" style="width: 95%;"  id="dummy_no_${
            i + 1
          }" onblur="handleBlur('${response.data[i].fregno}','${
            response.data[i].fhallno
          }', ${i + 1})"/>
            </td>`;
        }
        table += `</table>`;
        $("#table").html(table);
        $(".loader").hide();
      } else {
        alert(response.data);
        return;
      }
    },
  });
}

var arr = [];

function handleBlur(regno, hallno, index) {
  var tabno = $(`#tab_no_${index}`).val();
  var dummyno = $(`#dummy_no_${index}`).val();

  var arrObj = {};
  arrObj.regno = regno;
  arrObj.hallno = hallno;
  arrObj.tabno = tabno;
  arrObj.dummyno = dummyno;
  arr.push(arrObj);
}

function saveIAabsentenrty() {
  $.ajax({
    type: "POST",
    url: $host_url + "saveIAAbsentEntry",
    data: "data=" + JSON.stringify(arr),
    success: function (res) {
      let response = JSON.parse(res);
      if (response.error_code == 0) {
        alert(response.data.msg);
      } else {
        alert(response.data.msg);
        return;
      }
    },
  });
}

function iaabsentreport() {
    // console.log("vikas");
    var date = document.getElementById("frm_date").value;
    var session = document.getElementById("session").value;
    var room = document.getElementById("room").value;

    window.open(
      $host_url + "getiaabsentreport"+"&date=" + date + "&session=" + session + "&room=" + room,
    );
  }