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


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

const { Alert } = require("react-native");

function attendanceentrydaywise() {
  $("#page_main_div").load(
    "../html_modules/attendanceentrydaywise.html?v=1123",
    function () {
      document.getElementById("display_module_name").innerHTML =
        "Attendance Entry Daywise";
      document.getElementById("module_name_for_save").value =
        "Attendance Entry Daywise";
      getDefaultHeadFooterLinks("Attendance Entry Daywise");
      loaddayteachcode();

      if (db == "demo") {
        $("#period").val("2");
        $("#classcnt").val("3");
        $("#syllabus").val("Kannada 1st Chapter Completed");
      }
    }
  );

  // loadclassname1();
}

function loaddayteachcode() {
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "GET",
    url: $host_url + "loaddayteachcode",
    success: function (response) {
      var res = JSON.parse(response);
      // if (res.data.length == 1) {
      //   var teachnameday = "";
      //   $("#teachnameday").prop("disabled", true);
      // } else {
      //   $("#teachnameday").prop("disabled", false);
      // }

      var teachnameday = "<option value=''>---Select Teacher---</option>";
      for (var i = 0; i < res.data.length; i++) {
        teachnameday += `<option value='${res.data[i].fteachcode}'>${res.data[i].fteachcode} - ${res.data[i].fteachname}</option>`;
      }

      $("#teachnameday").html(teachnameday);
      $.unblockUI();
    },
  });

  if (db == "demo") {
    $("#period").val("2");
    $("#classcnt").val("3");
    $("#syllabus").val("Kannada 1st Chapter Completed");
  }
}

function changedayteachcode() {
  var teachcode = document.getElementById("teachnameday").value;
  $.ajax({
    type: "GET",
    url: $host_url + "loadclassnameday",
    data: "&teachcode=" + teachcode,
    success: function (response) {
      var res = JSON.parse(response);
      var classnameoptions =
        "<option value=''>---Select Class Name---</option>";
      for (var i = 0; i < res.data.length; i++) {
        classnameoptions += `<option value='${res.data[i].fclassid}'>${res.data[i].fclassname}</option>`;
      }

      $("#classnameoption").html(classnameoptions);
    },
  });
}

function loaddegreedaywise() {
  var todaydate = new Date();
  var day = todaydate.getDate();
  var month = todaydate.getMonth() + 1;
  var year = todaydate.getFullYear();
  var datestring = day + "/" + month + "/" + year;
  // document.getElementById("date").value = datestring;
  $("#date").html(datestring);
  $.ajax({
    type: "POST",
    url: $host_url + "getDegreeDaywise",
    success: function (response) {
      var res = JSON.parse(response);
      var degreeOptions = "<option value=''>---Select---</option>";
      for (var i = 0; i < res.data.length; i++) {
        degreeOptions += `<option value='${res.data[i].fdegree}'>${res.data[i].fdegree}-${res.data[i].fdescpn}</option>`;
      }
      $("#degree").html(degreeOptions);
    },
  });
}

function getexamno() {
  var degree = document.getElementById("degree").value;
  $.ajax({
    type: "POST",
    data: "&degree=" + degree,
    url: $host_url + "getExamnoDaywise",
    success: function (response) {
      var res = JSON.parse(response);
      var examnoOptions = "<option value=''>---Select---</option>";
      for (var i = 0; i < res.data.length; i++) {
        examnoOptions += `<option value='${res.data[i].fexamno}'>${res.data[i].fexamno}-${res.data[i].fexamname}</option>`;
      }
      $("#examno").html(examnoOptions);
    },
  });
}

function getsubjects() {
  var degree = document.getElementById("degree").value;
  var examno = document.getElementById("examno").value;
  $.ajax({
    type: "POST",
    data: "&degree=" + degree + "&examno=" + examno,
    url: $host_url + "getSubjectDaywise",
    success: function (response) {
      var res = JSON.parse(response);
      var subjectOptions = "<option value=''>---Select---</option>";
      for (var i = 0; i < res.data.length; i++) {
        subjectOptions += `<option value='${res.data[i].fsubcode}'>${res.data[i].fsubcode}-${res.data[i].fsubname}</option>`;
      }
      $("#subject").html(subjectOptions);
    },
  });
}

function viewattendanceentry() {
  var period = document.getElementById("period").value;
  var date = document.getElementById("date").value;
  var noofclass = document.getElementById("classcnt").value;
  var classnameoption = document.getElementById("classnameoption").value;
  var fsort = document.getElementById("fsort").value;

  if (period == "") {
    alert("Select period");
    $("#period").focus();
    return;
  }

  if (date == "") {
    alert("Enter Date");
    $("#date").focus();
    return;
  }

  if (noofclass == "") {
    alert("Enter Number of Classes");
    $("#classcnt").focus();
    return;
  }

  if (classnameoption == "") {
    alert("Enter Class Name");
    $("#classnameoption").focus();
    return;
  }

  var descpn = "";
  if (window.db == "jssu") {
    descpn = "Reg. No.";
  } else {
    descpn = "USN";
  }

  $.ajax({
    type: "POST",
    data:
      "&noofclass=" +
      noofclass +
      "&period=" +
      period +
      "&date=" +
      date +
      "&fclassid=" +
      classnameoption +
      "&fsort=" +
      fsort,
    url: $host_url + "viewattendanceentry",
    success: function (response) {
      var res = JSON.parse(response);
      console.log(res, "res");
      var slno = 1;

      var table = `<table align="center" width="100%" cellspacing="0" cellpadding="1" border="1" style="border-radius:5px" id="myTable">
      <tbody>`;

      table += `<tr style="position: sticky;
      top: 0;background: white;">
        <td colspan="6"><input type="text" style="width:98%; padding:4px;margin:2px; border-radius:20px;" id="myInput" onkeyup="searchReg()" placeholder="Search by Name...."></td>
      </tr>`;
      table += `<tr class="ui-state-default ui-jqgrid-hdiv" style="position: sticky;
      top: 30px;">
        <th 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.</th>

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

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

        <th align="center" style="width:85px; font-size:12px; 
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">${descpn}</th>

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

        <th align="center" style="width:70px; font-size:12px;  
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Action<br/>
        <input type="checkbox" onclick="checkAll(this);" /></th>
        </tr>`;

      if (res.error_code == 0) {
        for (var i = 0; i < res.data.length; i++) {
          if (res.data[i].fpresent == "A") {
            checked = "";
          } else {
            checked = "checked";
          }
          table += `<tr class="ui-widget-content jqgrow">
            <td class="tbl_row_new" style="border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${slno++}</td>

            <td class="tbl_row_new" style="text-align:center !important; text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fdegree
            }</td>

            <td class="tbl_row_new" style="text-align:center !important; text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fexamno
            }</td>

            <td class="tbl_row_new" style="text-align:initial;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${
              res.data[i].fregno
            }</td>

            <td class="tbl_row_new" style="text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fname
            }</td>
            <td id = "present" class="tbl_row_new" style="text-align:center; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">
            <input type="checkbox" ${checked}  id="present_${
            res.data[i].fregno
          }" ></td>`;

          table += `</tr>`;
        }
        table += `</table>`;
        $("#daywisedata").html(table);
      } else {
        alert(res.data);
        return;
      }
    },
  });
}

function checkAll(source) {
  var checkData = document.querySelectorAll('input[type="checkbox"]');
  for (var i = 0; i < checkData.length; i++) {
    if (checkData[i] != source) {
      let idvalue = checkData[i].id.split("_");
      document.getElementById(`present_${idvalue[1]}`).value = "U";
      checkData[i].checked = source.checked;
    }
  }
}

function searchReg() {
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");
  for (i = 0; i < tr.length; i++) {
    // td1 = tr[i].getElementsByTagName("td")[3];
    td2 = tr[i].getElementsByTagName("td")[4];
    if (td2) {
      txtValue =
        // (td1.textContent || td1.innerText) &&
        td2.textContent || td2.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function saveattendanceentry() {
  var syllabus = trim(document.getElementById("syllabus").value);
  if (syllabus == "") {
    alert("Enter Syllabus Covered Today");
    document.getElementById("syllabus").focus();
    return;
  }

  var win_width = window.screen.width;
  $("#batch_dialog").dialog("open");
  $("#batch_dialog").data("width.dialog", 400);
  $("#batch_dialog").data("position.dialog", [(win_width - 400) / 2, 90]);
  $("#ui-dialog-title-batch_dialog").html("Attendance Summary");
  var path = "../html_modules/attend_popup.html";
  $("#batch_dialog").load(path, function () {
    var classnameoption = document.getElementById("classnameoption").value;

    var convertedIntoArray = [];
    var findata = [];
    $("#daywisedata tr").each(function () {
      var rowDataArray = {};
      var actualData = $(this).find("td");

      let i = 0;
      if (actualData.length > 0) {
        let regno = "";
        actualData.each(function () {
          if (i == 3) {
            regno = $(this).text();
            rowDataArray["regno"] = $(this).text();
          }
          if (i == 4) {
            rowDataArray["name"] = $(this).text();
          }

          if (i == 5) {
            if (document.getElementById(`present_${regno}`).checked == true)
              rowDataArray["present"] = "P";
            else rowDataArray["present"] = "A";
          }
          i++;
        });

        convertedIntoArray.push(rowDataArray);
        findata = convertedIntoArray.filter(
          (value) => JSON.stringify(value) !== "{}"
        );
      }
    });

    var confirmregno = [];
    var countabsent;

    for (var i = 0; i < findata.length; i++) {
      if (findata[i]["present"] == "A") {
        let tmpobj = {};
        tmpobj.name = findata[i]["name"];
        tmpobj.regno = findata[i]["regno"];
        confirmregno.push(tmpobj);
      }
    }

    var totalcount = findata.length;
    var countabsent = confirmregno.length;
    var countpresent = parseInt(totalcount) - parseInt(countabsent);

    let regno = confirmregno.toString();
    var fregno = "";
    if (countabsent !== 0) {
      fregno = `Reg No. : ${regno}`;
    } else {
      fregno = "";
    }
    var descpn = "";
    if (window.db == "jssu") {
      descpn = "Reg. No.";
    } else {
      descpn = "USN No.";
    }

    let text = `Total No. of Students : ${totalcount} | Total Present : ${countpresent} | Total Absent : ${countabsent}
    ${fregno}`;
    let table = ``;

    table = ` <h4>Following are Absentees<h4>
    <table border = '1'>
    <tr>
      <th>Sl. No.</th>
      <th>${descpn}</th>
      <th>Name</th>
    </tr>`;
    if (countabsent !== 0) {
      let x = 1;
      for (let i = 0; i < confirmregno.length; i++) {
        table += `<tr >
      <td style = 'text-align: center;'>${x}</td>
      <td>${confirmregno[i].regno}</td>
      <td>${confirmregno[i].name}</td>
    </tr>`;
        x++;
      }
      table += `</table>`;
    } else {
      table += `<tr colspan="3">
      <th colspan="3">No Absentees</th>
    </tr></table>`;
    }

    table += `<br>
    <table border = '1'>
    <tr>
      <th>Total Students</th>
      <th>Total Present</th>
      <th>Total Absent</th>
    </tr>
    <tr>
    <td style = 'text-align: center;'>${totalcount}</td>
    <td style = 'text-align: center;'>${countpresent}</td>
    <td style = 'text-align: center;'>${countabsent}</td>
    </tr></table>`;
    $("#attsum").html(table);
  });
}

function saveAttendDaewsie() {
  $("#batch_dialog").dialog("close");
  var period = document.getElementById("period").value;
  var date = document.getElementById("date").value;
  var syllabus = trim(document.getElementById("syllabus").value);
  var noofclass = document.getElementById("classcnt").value;
  var classnameoption = document.getElementById("classnameoption").value;
  // var split = classnameoption.split("-");

  syllabus = syllabus.replace("'", "`");
  syllabus = syllabus.replace("&", "and");

  if (syllabus == "") {
    alert("Enter Syllabus Covered Today");
    document.getElementById("syllabus").focus();
    return;
  }

  var convertedIntoArray = [];
  var findata = [];
  $("#daywisedata tr").each(function () {
    var rowDataArray = {};
    var actualData = $(this).find("td");

    let i = 0;
    if (actualData.length > 0) {
      let regno = "";
      actualData.each(function () {
        if (i == 3) {
          regno = $(this).text();
          rowDataArray["regno"] = $(this).text();
        }
        if (i == 5) {
          if (document.getElementById(`present_${regno}`).checked == true)
            rowDataArray["present"] = "P";
          else rowDataArray["present"] = "A";
        }
        i++;
      });
      convertedIntoArray.push(rowDataArray);
      findata = convertedIntoArray.filter(
        (value) => JSON.stringify(value) !== "{}"
      );
    }
  });

  var confirmregno = [];
  var countabsent;

  for (var i = 0; i < findata.length; i++) {
    if (findata[i]["present"] == "A") {
      confirmregno.push(findata[i]["regno"]);
    }
  }

  var totalcount = findata.length;
  var countabsent = confirmregno.length;
  var countpresent = parseInt(totalcount) - parseInt(countabsent);

  let regno = confirmregno.toString();
  var fregno = "";
  if (countabsent !== 0) {
    fregno = `Reg No. : ${regno}`;
  } else {
    fregno = "";
  }

  $.ajax({
    type: "POST",
    data:
      "&noofclass=" +
      noofclass +
      "&fclassid=" +
      classnameoption +
      "&period=" +
      period +
      "&date=" +
      date +
      "&data=" +
      JSON.stringify(findata) +
      "&syllabus=" +
      syllabus,
    url: $host_url + "saveattendanceentry",
    success: function (response) {
      var res = JSON.parse(response);
      if (res.error_code == 0) {
        alert(res.data.msg);
        attendanceentrydaywise();
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function deleteattendanceentry() {
  $("#page_main_div").load(
    "../html_modules/deleteattendanceentrydaywise.html?v=1122",
    function () {
      document.getElementById("display_module_name").innerHTML =
        "Delete Attendance Entry Daywise";
      document.getElementById("module_name_for_save").value =
        "Delete Attendance Entry Daywise";
      getDefaultHeadFooterLinks("Attendance Entry Daywise");
      viewDeleteAddStudDet();
    }
  );
}

function viewDeleteAddStudDet() {
  let teachfrom = $("#dteachfrom").val();
  let teachto = $("#dteachto").val();

  $.ajax({
    type: "POST",
    data: "&teachfrom=" + teachfrom + "&teachto=" + teachto,
    url: $host_url + "viewDeleteAddStudDet",
    success: function (response) {
      var res = JSON.parse(response);
      var slno = 1;

      var table = `<table align="center" width="100%" cellspacing="0" cellpadding="1" border="1" style="border-radius:5px">
      <tbody>
        <tr>
        <th align="left" colspan="10" class="ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper" 
        style="font-size:12px; padding-left:6px; height:24px;">Delete Attendance Entry Daywise</th>
        </tr>

        <tr class="ui-state-default ui-jqgrid-hdiv">
        <th 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.</th>

         <th align="center" style="width:350px; font-size:12px; padding:5px 5px; 
         border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Teacher name</th>

         <th align="center" style="width:50px; font-size:12px; padding:5px 5px; 
         border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Class ID</th>

         <th align="center" style="width:250px; font-size:12px; padding:5px 5px; 
         border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Class Name</th>

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

        <th align="center" style="width:30px; font-size:12px; 
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Period</th>

        <th align="center" style="width:30px; font-size:12px; padding:5px 5px; 
         border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">No. of Class</th>

        <th align="center" style="width:30px; font-size:12px;  
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Present</th>
        <th align="center" style="width:30px; font-size:12px;  
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Absent</th>
        <th align="center" style="width:30px; font-size:12px;  
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Delete</th>
        </tr>`;

      if (res.error_code == 0) {
        for (var i = 0; i < res.data.length; i++) {
          table += `<tr class="ui-widget-content jqgrow">
            <td class="tbl_row_new" style="border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${slno++}</td>

            <td class="tbl_row_new" style=" text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fteach
            }</td>

            <td class="tbl_row_new" style="text-align:center !important; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fclassid
            }</td>

            <td class="tbl_row_new" style="text-align:center !important; text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fclassname
            }</td>

            <td class="tbl_row_new" style="text-align:center !important;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fdate
            }</td>

            <td class="tbl_row_new" style="text-align:initial;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${
              res.data[i].fperiod
            }</td>

            <td class="tbl_row_new" style="text-align:center; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fnoclass
            }</td>
            <td class="tbl_row_new" style="text-align:center; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].pcnt
            }</td>
            <td class="tbl_row_new" style="text-align:center; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].acnt
            }</td>
            <td class="tbl_row_new" style="text-align:center; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">
              <span
            style="
              background-color: red;
              border: none;
              color: white;
              padding: 5px 20px;
              text-align: center;
              text-decoration: none;
              display: inline-block;
              font-size: 12px;
              cursor: pointer;
            "
            onclick="deleteAddstudentry('${res.data[i].fclassid}','${
            res.data[i].fperiod
          }','${res.data[i].fnoclass}','${res.data[i].fdate}')"
            >Delete</span>
            <span
            style="
              background-color: green;
              border: none;
              color: white;
              padding: 5px 20px;
              text-align: center;
              text-decoration: none;
              display: inline-block;
              font-size: 12px;
              cursor: pointer;
            "
            onclick="modifyAddstudentry('${res.data[i].fteachcode}','${
            res.data[i].fteachname
          }','${res.data[i].fclassid}','${res.data[i].fperiod}','${
            res.data[i].fnoclass
          }','${res.data[i].fdate}','${res.data[i].fclassname}')"
            >Modify</span>
            </td>`;
          table += `</tr>`;
        }
        table += `</table>`;
        $("#deletedaywisedata").html(table);
      }
    },
  });
}

function deleteAddstudentry(fclassid, fperiod, fnoclass, fdate) {
  let parameters =
    "&fclassid=" +
    fclassid +
    "&fperiod=" +
    fperiod +
    "&fnoclass=" +
    fnoclass +
    "&fdate=" +
    fdate;

  let text = "Are You Sure...!";
  if (confirm(text) == true) {
    $.ajax({
      type: "GET",
      url: $host_url + "deleteAddstudentry",
      data: parameters,
      success: function (response) {
        var res = JSON.parse(response);
        if (res.error_code == 0) {
          alert("Deleted Successfully...!");
          deleteattendanceentry();
        } else {
          alert("Failed to Delete...!");
          return;
        }
      },
    });
  } else {
    return;
  }
}

function modifyAddstudentry(
  fteachcode,
  fteachname,
  fclassid,
  fperiod,
  fnoclass,
  fdate,
  fclassname
) {
  let parameters =
    "&fteachcode=" +
    fteachcode +
    "&fclassid=" +
    fclassid +
    "&fperiod=" +
    fperiod +
    "&fnoclass=" +
    fnoclass +
    "&fdate=" +
    fdate;

  $.ajax({
    type: "GET",
    url: $host_url + "modifyAddstudentry",
    data: parameters,
    success: function (response) {
      var res = JSON.parse(response);
      if (res.error_code == 0) {
        $("#page_main_div").load(
          "../html_modules/attendanceentrydaywise.html?v=1122",
          function () {
            document.getElementById("display_module_name").innerHTML =
              "Attendance Entry Daywise";
            document.getElementById("module_name_for_save").value =
              "Attendance Entry Daywise";
            getDefaultHeadFooterLinks("Attendance Entry Daywise");

            $("#teachnameday").append(
              `<option value="${fteachcode}">${fteachcode} - ${fteachname}</option>`
            );
            $("#classnameoption").append(
              `<option value="${fclassid}">${fclassid} - ${fclassname}</option>`
            );
            $("#period").val(fperiod);

            var dateAr = fdate.split("/");
            var newDate =
              dateAr[2] + "-" + dateAr[1] + "-" + dateAr[0].slice(-2);
            $("#date").val(newDate);
            $("#classcnt").val(fnoclass);

            var slno = 1;

            var table = `<table align="center" width="100%" cellspacing="0" cellpadding="1" border="1" style="border-radius:5px">
      <tbody>
        <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;">Attendance Entry Daywise</th>
        </tr>

        <tr class="ui-state-default ui-jqgrid-hdiv">
        <th 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.</th>

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

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

        <th align="center" style="width:85px; font-size:12px; 
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">USN</th>

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

        <th align="center" style="width:70px; font-size:12px;  
        border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Action</th>
        </tr>`;
            let fsyllabus = "";
            if (res.error_code == 0) {
              for (var i = 0; i < res.data.length; i++) {
                if (res.data[i].fpresent == "A") {
                  checked = "";
                } else {
                  checked = "checked";
                }
                fsyllabus = res.data[i].fsyllabus;
                table += `<tr class="ui-widget-content jqgrow">
            <td class="tbl_row_new" style="border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${slno++}</td>

            <td class="tbl_row_new" style="text-align:center !important; text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fdegree
            }</td>

            <td class="tbl_row_new" style="text-align:center !important; text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fexamno
            }</td>

            <td class="tbl_row_new" style="text-align:initial;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${
              res.data[i].fregno
            }</td>

            <td class="tbl_row_new" style="text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${
              res.data[i].fname
            }</td>
            <td id = "present" class="tbl_row_new" style="text-align:center; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">
            <input type="checkbox" ${checked}  id="present_${
                  res.data[i].fregno
                }" ></td>`;

                table += `</tr>`;
              }
              table += `</table>`;
              $("#daywisedata").html(table);
            }
            $("#syllabus").val(fsyllabus);
          }
        );
      }
    },
  });
}