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


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

function callInvigilators_dairy_new() {
  $("#page_main_div").load(
    "../html_modules/invigilators_dairy_newone.html?v=1001",
    {
      function() {
        document.getElementById("display_module_name").innerHTML =
          "Invigilators Dairy and Roomwise Nos List(New)";
        document.getElementById("module_name_for_save").value =
          "Invigilators Dairy and Roomwise Nos List(New)";
        getDefaultHeadFooterLinks(
          "Invigilators Dairy and Roomwise Nos List(New)"
        );
        // getShortDegee();
      },
    }
  );
}
function loadExam() {
  let date = document.getElementById("date").value;
  $.ajax({
    type: "GET",
    data: "&date=" + date,
    url: $host_url + "getExamMonthRoomAllotment",
    success: function (response) {
      var res = JSON.parse(response);

      var examOptions = "<option value=''>---Select---</option>";
      for (var i = 0; i < res.data.exmmonth.length; i++) {
        examOptions += `<option value='${res.data.exmmonth[i].value}'>${res.data.exmmonth[i].label}</option>`;
      }
      $("#exam").html(examOptions);
    },
  });
}
// function getAllReportForInvigilator() {
//   let date = document.getElementById("date").value;
//   let exam = document.getElementById("exam").value;
//   const reportType = [
//     {
//       key: "register_no_list_notice_board",
//       value: "register_no_list_notice_board",
//       label: "Reg.No(Notice Board)",
//     },
//     {
//       key: "register_no_list_room_board",
//       value: "register_no_list_room_board",
//       label: "Reg.No(Room Board)",
//     },
//     {
//       key: "invigilator_dairy",
//       value: "invigilator_dairy_withphoto",
//       label: "Invigilator WithPhoto",
//     },
//     {
//       key: "invigilator_dairy",
//       value: "invigilator_dairy_without_photo",
//       label: "Invigilator WithOut Photo",
//     },
//     {
//       key: "room_allotmentt_excel",
//       value: "room_allotmentt_excel",
//       label: "Room Allotment(Xl)",
//     },
//   ];

//   $.ajax({
//     type: "GET",
//     data: "&date=" + date + "&exam=" + exam,
//     url: $host_url + "getDegreeSessionOnDateAndYearModeForReports",
//     success: function (response) {
//       var res = JSON.parse(response);
//       console.log(res);

//       if (res.error_code != 0) {
//         let table = "";
//         table += `<h5>No Data Found</h5>`;
//         document.getElementById("attdatatable").innerHTML = table;
//       } else {
//         let table = "";
//         table += `<table style='width: 100%;' cellspacing='0'>`;
//         table += `<thead style='position:sticky; top:0'><tr>
//               <th colspan='7' style='padding:5px;' align='left' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper'>Attendence Shortage</th></tr>
//              <tr align="center" class='ui-state-default ui-jqgrid-hdiv'>
//              <th class='column'>Degree Group</th>
//              <th class='column'>Session</th>
//              <th class='column'>Total Students</th>
//              <th class='column'>Alloted Students</th>
//              <th class='column'>Pending Students</th>
//              <th class='column'>Generate Report</th>
//              </tr>
//           </thead>`;
//         for (let i = 0; i < res.data.degses.length; i++) {
//           table += `<tr align='center'>
//           <td class='column'>${res.data.degses[i].fdeggrp}</td>
//           <td class='column'>${res.data.degses[i].fsession}</td>
//           <td class='column' style='padding:5px;' align='left'>${res.data.degses[i].reg_cnt}</td>
//           <td class='column' style='padding:5px;' align='left'>${res.data.degses[i].fhallno}</td>
//           <td class='column' >${res.data.degses[i].pending}</td>
//           <td class='column' ><span   style="
//           background-color: #008cba;
//           border: none;
//           color: white;
//           padding: 6px 10px;
//           text-align: center;
//           text-decoration: none;
//           display: inline-block;
//           font-size: 13px;
//           cursor: pointer;
//           border-radius: 3px;
//           margin-left: 10.5%;
//         "
//         onclick="reportHandler(${reportType[0].value})">${reportType[0].label}</span><span>${reportType[1].label}</span><span>${reportType[2].label}</span><span>${reportType[3].label}</span></td>`;
//         }
//         // for (let j = 0; j < res.data.degses.length; j++) {
//         //   console.log(reportType[1].label, "hio");
//         //   console.log(reportType[2].label, "hio");
//         //   console.log(reportType[3].label, "hio");
//         // }

//         table += `</tr>`;

//         table += `</table>`;
//         document.getElementById("attdatatable").innerHTML = table;
//       }
//     },
//   });
// }
// function reportHandler(value) {
//   console.log(value, "anita");
// }

function getAllReportForInvigilator() {
  let date = document.getElementById("date").value;
  let exam = document.getElementById("exam").value;
  const reportType = [
    {
      key: "register_no_list_notice_board",
      value: "register_no_list_notice_board",
      label: "Reg.No (Notice Board)",
    },
    {
      key: "register_no_list_room_board",
      value: "register_no_list_room_board",
      label: "Reg.No (Room Board)",
    },
    {
      key: "invigilator_dairy",
      value: "invigilator_dairy_withphoto",
      label: "Invigilator With Photo",
    },
    {
      key: "invigilator_dairy",
      value: "invigilator_dairy_without_photo",
      label: "Invigilator Without Photo",
    },
    {
      key: "room_allotmentt_excel",
      value: "room_allotmentt_excel",
      label: "Room Allotment (Xl)",
    },
  ];

  $.ajax({
    type: "GET",
    data: "&date=" + date + "&exam=" + exam,
    url: $host_url + "getDegreeSessionOnDateAndYearModeForReports",
    success: function (response) {
      var res = JSON.parse(response);
      console.log(res);

      if (res.error_code != 0) {
        let table = `<h5>No Data Found</h5>`;
        document.getElementById("attdatatable").innerHTML = table;
      } else {
        let table = "";
        table += `<table style='width: 100%;' cellspacing='0'>`;
        table += `
          <thead style='position:sticky; top:0'>
            <tr>
              <th colspan='7' style='padding:5px;' align='left' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper'>
               Roomwise List
              </th>
            </tr>
            <tr align="center" class='ui-state-default ui-jqgrid-hdiv' >
              <th class='column'>Degree Group</th>
              <th class='column'>Session</th>
              <th class='column'>Total Students</th>
              <th class='column'>Alloted Students</th>
              <th class='column'>Pending Students</th>
              <th class='column'>Generate Report</th>
            </tr>
          </thead>`;
        for (let i = 0; i < res.data.degses.length; i++) {
          table += `<tr align='center'  style="height: 40px;">
            <td class='column'>${res.data.degses[i].fdeggrp}</td>
            <td class='column'>${res.data.degses[i].fsession}-${res.data.degses[i].FDESCPN}</td>
            <td class='column'>${res.data.degses[i].reg_cnt}</td>
            <td class='column'>${res.data.degses[i].fhallno}</td>
            <td class='column'><span onclick="pendingStudHandler('${res.data.degses[i].fdeggrp}','${res.data.degses[i].fsession}')">${res.data.degses[i].pending}</span></td>
            <td class='column'>`;

          reportType.forEach((report) => {
            table += `<span 
              style="background-color: #008cba; border: none; color: white; padding: 6px 10px; margin: 2px; border-radius: 3px; cursor: pointer;"
              onclick="reportHandler('${report.value}', '${res.data.degses[i].fdeggrp}', '${res.data.degses[i].fsession}', '${res.data.degses[i].reg_cnt}', '${res.data.degses[i].fhallno}')">
              ${report.label}
            </span>`;
          });

          table += `</td></tr>`;
        }
        table += `</table>`;
        document.getElementById("attdatatable").innerHTML = table;
      }
    },
  });
}

function reportHandler(value, degggrp, session, count, hallno) {
  let date = document.getElementById("date").value;
  let api = "";
  if (value == "register_no_list_notice_board") {
    api = "registerNoListNoticeBoard";
  } else if (value == "register_no_list_room_board") {
    api = "registerNoListRoomBoard";
  } else if (value == "room_allotmentt_excel") {
    api = "roomallotmentExcel";
  } else if (value == "invigilator_dairy_withphoto") {
    handlewithphoto(degggrp, session, count, hallno);
    retrun;
  } else if (value == "invigilator_dairy_without_photo") {
    handlewithoutphoto(degggrp, session, count, hallno);
    retrun;
  }
  window.open(
    $host_url +
      api +
      "&degree=" +
      degggrp +
      "&session=" +
      session +
      "&totalStud=" +
      count +
      "&allotStud=" +
      hallno +
      "&fromdate=" +
      date
  );
}
function handlewithphoto(degggrp, session, count, hallno) {
  let date = document.getElementById("date").value;
  window.open(
    $host_url +
      "invigilatorDairy" +
      "&degree=" +
      degggrp +
      "&session=" +
      session +
      "&totalStud=" +
      count +
      "&allotStud=" +
      hallno +
      "&photo=" +
      "withphoto" +
      "&fromdate=" +
      date
  );
}

function handlewithoutphoto(degggrp, session, count, hallno) {
  let date = document.getElementById("date").value;
  window.open(
    $host_url +
      "invigilatorDairy" +
      "&degree=" +
      degggrp +
      "&session=" +
      session +
      "&totalStud=" +
      count +
      "&allotStud=" +
      hallno +
      "&photo=" +
      "Without Photo" +
      "&fromdate=" +
      date
  );
}

function pendingStudHandler(deggrp, session) {
  console.log(deggrp, session, "hii");
  let date = document.getElementById("date").value;
  let exam = document.getElementById("exam").value;
  window.open(
    $host_url +
      "getpendingstudentList" +
      "&date=" +
      date +
      "&exam=" +
      exam +
      "&deggrp=" +
      deggrp +
      "&session=" +
      session
  );
  // $.ajax({
  //   type: "GET",
  //   data:
  //     "&date=" +
  //     date +
  //     "&exam=" +
  //     exam +
  //     "&deggrp=" +
  //     deggrp +
  //     "&session=" +
  //     session,
  //   url: $host_url + "getpendingstudentList",
  //   success: function (response) {
  //     var res = JSON.parse(response);
  //     console.log(res, "anita");
  //   },
  // });
}