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


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

function callRvRtAcknoeledge() {
  $("#page_main_div").load(
    "../html_modules/RvRtAcknowledge.html?v=1001",
    function () {
      document.getElementById("display_module_name").innerHTML =
        "RV/RT Acknowledge";
      document.getElementById("module_name_for_save").value =
        "RV/RT Acknowledge";
      getDefaultHeadFooterLinks("RV/RT Acknowledge");
      loadGegree();
    }
  );
}

function loadGegree() {
  $.ajax({
    type: "GET",
    url: $host_url + "resstuddegree",
    success: function (res) {
      let response = JSON.parse(res);
      console.log(response, "hiii");
      if (response.error_code == 0) {
        var option = `<option value='all' id='alll'>All</option>`;

        for (i = 0; i < response.data.length; i++) {
          option += `<option value='${response.data[i].fdegree}'>${response.data[i].fdegree}-${response.data[i].FDESCPN}</option>`;
        }

        document.getElementById("rv_rt_ack_degree").innerHTML = option;
      }
    },
  });
}

function DisplayAllAckExamApplications() {
  var degree = document.getElementById("rv_rt_ack_degree").value;
  var rtype = document.getElementById("rtype").value;
  var regfrom = document.getElementById("reg_no_from").value;
  var regto = document.getElementById("reg_no_to").value;
  var appfrom = document.getElementById("app_no_from").value;
  var appto = document.getElementById("app_no_to").value;
  console.log(rtype, degree, regfrom, regto, appfrom, appto, "helo");

  if (rtype == "") {
    alert("Select Type");
    return;
  }

  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "POST",
    url: $host_url + "rvrtackexamapp",
    data:
      "rv_rt_ack_degree=" +
      degree +
      "&rtype=" +
      rtype +
      "&reg_no_from=" +
      regfrom +
      "&reg_no_to=" +
      regto +
      "&app_no_from=" +
      appfrom +
      "&app_no_to=" +
      appto,
    success: function (res) {
      //   console.log(res);
      let response = JSON.parse(res);
      console.log(response);

      if (response.error_code == 0) {
        var table = "";
        table += `<table class="tables">`;
        table += `<tr class='tr_table' style="position:sticky;top:0">
              <th align="center" class='column' >SI.NO</th>
              <th align="center" class='column' >Application No</th>
              <th align="center" class='column' >Degree</th>
               <th align="center" class='column'>Reg. No.</th>
               <th align="center" class='column'>Student Name</th>
              <th align="center" class='column' >App. Date</th>
              <th align="center" class='column' >Amount</th>
              <th align="center" class='column' >Action</th> 
            
              </tr>`;
        for (let i = 0; i < response.data.length; i++) {
          var buttonText =
            response.data[i].fackdate !== ""
              ? `<p>Acknowledged</p>`
              : `<span
            style="
              background-color: #008cba;
              color: white;
              padding: 5px 10px;
              text-align: center;
              text-decoration: none;
              display: inline-block;
              cursor: pointer;
              border-radius: 3px;margin:3px;"
              
            onclick="addacknowledge('${response.data[i].FREGNO}','${response.data[i].APPNO}')"
            id="buttonid_${i}">Acknowledge
            </span
          >`;
          var rowClass = i % 2 == 0 ? "tbl_row1" : "tbl_row_alter1";
          table += `<tr align='center' id='row_${i}' >
        
          <td  class='${rowClass}'  style=' font-size:12px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-top:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC; text-align:center;'>${
            i + 1
          }</td>
          <td class='${rowClass}'  style=' font-size:12px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; text-align:center;'>
          <a href="#" id="app_no" onclick="downloadPdf('${
            response.data[i].APPNO
          }')" style='color:blue; '>${response.data[i].APPNO}</a>
          </td>
          
          <td class='${rowClass}'  style=' font-size:12px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-top:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC; text-align:center;'>${
            response.data[i].FDEGREE
          }</td>
          <td class='${rowClass} ' style=' font-size:12px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-top:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC; text-align:center;'>${
            response.data[i].FREGNO
          }</td>
          <td class='${rowClass}'  style=' font-size:12px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-top:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>${
            response.data[i].FNAME
          }</td>
        
          <td class='${rowClass}'  style=' font-size:12px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-top:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC; text-align:center;'>${
            response.data[i].FAPPDATE
          }</td>
          <td class='${rowClass}'  style=' font-size:12px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-top:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC; text-align:center;'>${
            response.data[i].FTOTAL
          }</td>
        
          <td class='${rowClass}' style=" font-size:12px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-top:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC; text-align:center;"  id='ack_${
            response.data[i].APPNO
          }'>${buttonText} </td>
              </tr>`;
        }
        table += `</table>`;
        document.getElementById("datatable").innerHTML = table;
      }
      if (response.data.length === 0) {
        alert("No Acknowledgement Pending");
      }
      $.unblockUI();
    },
  });
}
function addacknowledge(reg, app) {
  let data = "&regno=" + reg + "&appno=" + app;
  let app1 = app;
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "POST",
    url: $host_url + "acknokledgementbutton",
    data: data,
    success: function (res) {
      let response = JSON.parse(res);
      $.unblockUI();
      console.log(response, "reaponse");
      if (response.error_code == -1) {
        alert(response.data.msg);
        return;
      } else {
        console.log("ack_" + app1);
        document.getElementById("ack_" + app1).innerHTML = `Acknowledged`;
      }
    },
  });
}

function downloadPdf(content) {
  var app_no = (document.getElementById("app_no").value = content);

  window.open($host_url + "PrintRevaluationApplicationForm&app_no=" + app_no);
}