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


Current Path : /var/www/html/pgadm/js/admin/
Upload File :
Current File : /var/www/html/pgadm/js/admin/invigdiary.js

function loadInvigDiary() {
  $.ajax({
    type: "POST",
    url: $host_url + "loadRange",
    async: false,
    success: function (response) {
      //  console.log(response);
      var { error_code, data, status } = JSON.parse(response);
      console.log(data);
      if (error_code == "0") {
        $("#loadTab").load("invigdiary.html", function () {
          var degrees = data;
          var dept_opt = `<option value=" ">--Select--</option>`;
          for (let deg of degrees) {
            dept_opt += `<option value="${deg.fdegree}">${deg.fdescpn}</option>`;
          }
          $("#fdeptt").html(dept_opt);
        });
        // var date = getDate();
        // console.log(date);
        // document.getElementById('dtfrom').value = date;
        // document.getElementById('dtto').value = date;
        // $('#dtfrom').val(date);
        // $('#dtto').val(date);
      } else {
        alert("Please try after some time");
        return;
      }
    },
  });
}

function reporttype() {
  var reporttype = document.getElementById("retype").value;

  console.log(reporttype);
}

function genInvigDiary() {
  var fdeptt = $("#fdeptt").val();
  var afrom = $("#afrom").val();
  var ato = $("#ato").val();
  var retype = $("#retype").val();

  if (retype == "indy") {
    window.open(
      $host_url +
        "GenerateInvigilatorDairy" +
        "&fdept=" +
        fdeptt +
        "&afrom=" +
        afrom +
        "&ato=" +
        ato,
      "_blank"
    );
  } else {
    window.open(
      $host_url +
        "GenerateNoticeBoardChart" +
        "&fdept=" +
        fdeptt +
        "&afrom=" +
        afrom +
        "&ato=" +
        ato,
      "_blank"
    );
  }
}


function loadSeatAllotSingal()
{
  console.log("a");
  $("#loadTab").load("dudseatallotsingal.html", function() {
  });
}

function loadDudStuddet()
{
  
  let regno = $('#regno').val();
  if(regno == '')
  {
    alert("Please Enter Reg. No. or Application No.");
    document.getElementById('regno').focus();
    return;
  }

  $.ajax({
    type: "POST",
    url: $host_url + "loadDudStuddet",
    async: false,
    data:"regno="+$('#regno').val(),
    success: function(response) {
      var { error_code, data, status } = JSON.parse(response);
      if (error_code == "0") {
       let studdet = data.studdet;
       let colldet = data.colldet;
       let degdet = data.degcode;
       
       document.getElementById('regno').disabled = true;

       $('#appno').val(studdet['fappno']);
       $('#regno').val(studdet['fregno']);
       $('#name').val(studdet['fname']);
       $('#catcode').val(studdet['fcategory']);
       $('#unistud').val(studdet['funiv']);
       
       $('#hdegree').val(studdet['fdegree']);

       let collopt = "<option value = ''>--Select--</option>";

       for(let i =0;i<colldet.length;i++)
       {
        collopt +=`<option value = '${colldet[i]['fcollcode']}'>${colldet[i]['fcollname']}</option>`;
       }


       $('#college').html(collopt);

       let degopt = "<option value = ''>--Select--</option>";

       for(let i =0;i<degdet.length;i++)
       {
        degopt +=`<option value = '${degdet[i]['fdegree']}'>${degdet[i]['degname']}</option>`;
       }


       $('#degree').html(degopt);


      } else {
        alert(data);
        return;
      }
    }
  }); 
}

function getstudfee()
{

  let hdegree = $('#degree').val();
  let seattype = $('#seattype').val();
  let studfrom = $('#studfrom').val();
  let catcode = $('#catcode').val();
  let funiv = $('#unistud').val();
  let college = $('#college').val();

  if(college == '')
  {
    return;
  }

  if(hdegree == '')
  {
    alert("Please Degree Not Selected");
    document.getElementById('degree').focus();
    return;
  }

  if(seattype == '')
  {
    alert("Please Merit Type");
    document.getElementById('seattype').focus();
    return;
  }

  if(studfrom == '')
  {
    alert("Please Student From");
    document.getElementById('studfrom').focus();
    return;
  }
  
  if(college == '')
  {
    alert("Please Select College");
    document.getElementById('college').focus();
    return;
  }
  

  $.ajax({
    type: "POST",
    url: $host_url + "getstudfee",
    async: false,
    data:"hdegree="+hdegree+"&seattype="+seattype+"&studfrom="+studfrom+"&catcode="+catcode+"&funiv="+funiv+"&college="+college,
    success: function(response) {
      var { error_code, data, status } = JSON.parse(response);
      if (error_code == "0") {
       let fee = data.fee;
       let feeedit = data.feeedit;
      
       $('#amount').val(fee);
       $('#pamount').val(fee);
        if(feeedit == 'T')
          document.getElementById('pamount').disabled = false;

        

      } else {
        alert(data);
        return;
      }
    }
  }); 

}

function SaveDudSeatAllot()
{
  let regno = $('#regno').val();
  let appno = $('#appno').val();
  let hdegree = $('#degree').val();
  let seattype = $('#seattype').val();
  let studfrom = $('#studfrom').val();
  let catcode = $('#catcode').val();
  let amount = $('#amount').val();
  let pamount = $('#pamount').val();
  let college = $('#college').val();
  let paytype = $('#paytype').val();


if(hdegree == '')
  {
    alert("Please Degree Not Selected");
    document.getElementById('degree').focus();
    return;
  }

  if(college == '')
  {
    alert("Please College Not Selected");
    document.getElementById('college').focus();
    return;
  }

  if(seattype == '')
  {
    alert("Please Merit Type");
    document.getElementById('seattype').focus();
    return;
  }

  if(studfrom == '')
  {
    alert("Please Student From");
    document.getElementById('studfrom').focus();
    return;
  }

  // if(amount == '')
  // {
  //   alert("Amount cant be zero");
  //   document.getElementById('amount').focus();
  //   return;
  // }

  // if(pamount == '')
  // {
  //   alert("Amount cant be zero");
  //   document.getElementById('pamount').focus();
  //   return;
  // }

  if(paytype == '')
  {
    alert("Select Payment Type");
    document.getElementById('paytype').focus();
    return;
  }

  $.ajax({
    type: "POST",
    url: $host_url + "SaveDudSeatAllot",
    async: false,
    data:"hdegree="+hdegree+"&seattype="+seattype+"&studfrom="+studfrom+"&catcode="+catcode+"&amount="+amount+"&pamount="+pamount+"&college="+college+"&regno="+regno+"&appno="+appno+"&paytype="+paytype,
    success: function(response) {
      var { error_code, data, status } = JSON.parse(response);
      if (error_code == "0") {
        alert(data.msg);
        if(data.paytype =='Challan')
        {
          window.open(
            $host_url +
              "PrintApplicationFormBankChallan" +
              "&app_no=" +
              data.appno +
              "&regno=" +
              data.regno,
            "_blank"
          );
        }
        loadSeatAllotSingal();
      } else {
        alert(data);
        return;
      }
    }
  }); 


}