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


Current Path : /proc/thread-self/root/var/www/html/gfgcg/phdadm/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/gfgcg/phdadm/js/kusPhdAdm.js

if (location.protocol != 'https:') {
  var $host_url = "http://" + window.location.host + "/" + window.location.pathname.split('/')[1] + "/" + window.location.pathname.split('/')[2] + "/app.php?a=";

  var $photo_url = "http://" + window.location.host + "/" + window.location.pathname.split('/')[1] + "/" + window.location.pathname.split('/')[2];

} else {
  var $host_url = "https://" + window.location.host + "/" + window.location.pathname.split('/')[1] + "/" + window.location.pathname.split('/')[2] + "/app.php?a=";

  var $photo_url = "https://" + window.location.host + "/" + window.location.pathname.split('/')[1] + "/" + window.location.pathname.split('/')[2];

}

var gRgPerinfo;

function login() {

  $.ajax({
    type: "POST",
    async: true,
    url: $host_url + 'login',
    success: isLoggedInResponce
  });

  function isLoggedInResponce($responce) {
    $responce = eval('(' + $responce + ')');
    if ($responce.error_code == -1) {
      alert("please login");
      window.location.href = "index.html";
    }
  }
}

function logout() {

  $.ajax({
    type: 'post',
    url: $host_url + 'logout',
    success: function (response) {
      window.location.href = "index.html";
    }
  });
}



function loadMasters() {
  $('#personal_det').show();
  $('#success_card').hide();

  verify = 1;
  login();

  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + 'getcmsdropdownmenuvalues' + "&formtype=" + getCookie("formab"),
    success: function GetCMSDropDownMenuValuesResponce(responce) {
      responce = eval('(' + responce + ')');
      var serv_arr = responce.data['category'];
      var serv_title = '';
      FillDropdownValues(serv_arr, 'fcategory', serv_title);

      var serv_arr = responce.data['degree'];
      var serv_title = '';
      FillDropdownValues(serv_arr, 'fdegree', serv_title);

      var option = '<option value="">--Select--</option>';
      for (var j = 2019; j > 1970; j--) {
        option += "<option value='" + j + "'>" + j + "</option>";
      }
      $("#fqyear").append(option);

      if (responce.data.percnt > 0) {
        if (getCookie("formab") == "B")
          loadedituploads(responce.data.perdetl['fdegree'], 'PHD', responce.data.perdetl['fappno']);
        else
          $("#upload_table").hide();


        if (responce.data.perdetl['fphotopath'] != "") {
          photo_path = responce.data.perdetl['fphotopath'];
          $("#frmFileUpload").hide();
          $("#studphoto").attr('src', $photo_url + '/' + responce.data.perdetl['fphotopath'])
          $("#studphoto").show();
          photo_filename = '';
        }

        var serv_arr = responce.data['research'];
        var serv_title = '';
        // FillDropdownValues(serv_arr,'fcollcode',serv_title);

        $("#personal_det input[type=text],#personal_det select").each(function () {
          if ($(this).attr('id') != 'stuMobileno' && $(this).attr('id') != 'idDob')
            $(this).val(responce.data.perdetl[$(this).attr('id')]);
        });

        var radio_names = ['gender', 'handicap', 'HK']
        for (var i = 0; i < radio_names.length; i++) {
          $('input[name="' + radio_names[i] + '"][value="' + responce.data.perdetl[radio_names[i]] + '"]').prop("checked", true);
        }

        $('#fappno').val(responce.data.perdetl['fappno']);
        // loadedituploads(responce.data.perdetl['idDegree'],responce.data.perdetl['idCollege'],responce.data.perdetl['fappno']);
        // $("#idDegree").val(responce.data.fdegree);

        // loadpgmarks(responce.data.perdetl['idDegree'],responce.data.perdetl['idCollege'],responce.data.perdetl['fappno']);

      }
      else {
        if (getCookie("formab") == "B")
          loaduploads();
        else
          $("#upload_table").hide();
      }

    }
  });
}

function homeLink() {
  var r = confirm("Do you want to go to homepage!!!. The entered values will be cleared.");
  if (r == true) {
    window.location.href = "home.html";
  } else {

  }
}

function gomainpage(formab) {
  setCookie("formab", formab, 1);
  window.location.href = "MainPage.html";
}


function getFeeDetail() {
  var category = $('#fcategory').val();
  var nation = $('#fnational').val();

  if ($('#fcategory').val() == '') {
    return;
  }

  if (nation == 'Foreign') {
    sum = 10000;
    $('#ftotfee').val(sum);
  } else {
    var datastring = "&category=" + category + "&formtype=" + getCookie("formab");
    $.blockUI({ message: "<img src='img/Loading_icon.gif' border='0'>" });
    $.ajax({
      type: "POST",
      data: datastring,
      url: $host_url + 'getfeedetl',
      success: function getFeeDetailResponce(responce) {
        $.unblockUI();
        responce = eval('(' + responce + ')');
        sum = responce.data['sum'];
        $('#ftotfee').val(sum);
      }
    });
  }
}

var gSubarray;
function getDept() {
  var degree = $('#fdegree').val();

  if ($('#fdegree').val() == '') {
    return;
  }
  var datastring = "&fdegree=" + degree;
  $.blockUI({ message: "<img src='img/Loading_icon.gif' border='0'>" });

  $.ajax({
    type: "POST",
    data: datastring,
    url: $host_url + 'getDept',
    success: function getDeptResponce(responce) {
      $.unblockUI();
      responce = eval('(' + responce + ')');
      var serv_arr = responce.data['research'];
      var serv_title = '';
      FillDropdownValues(serv_arr, 'fcollcode', serv_title);
    }
  });
}

var html_string = '';
var missing_fields;
function validateApplication() {
  var errcount = 0;
  jsonObj = [];
  missing_fields = [];
  //validate and read values of text and select boxes
  $("#body input[type=text],#body select").each(function () {
    if ($(this).val() == "") {
      $(this).closest('.form-group').find('.fieldError').addClass('hasError');
      missing_fields.push($(this).attr('name'));
      item = {};
      item["id"] = $(this).attr('id');
      item["value"] = '';
      jsonObj.push(item);
      errcount++;
    }
    else {
      $(this).closest('.form-group').find('.fieldError').removeClass('hasError');
      item = {};
      item["id"] = $(this).attr('id');
      item["value"] = $(this).val();
      jsonObj.push(item);
    }
  });
  var flag = 'T';
  $("#body input[type=hidden]").each(function () {
    if ($(this).val() != '')
      flag = 'F';
    var item = {};
    item["id"] = $(this).attr('id');
    item["value"] = $(this).val();
    jsonObj.push(item);
  });

  if (getCookie("formab") == 'B' && flag == 'T') {
    missing_fields.push("Document to be uploaded");
    errcount++;
  }

  //validate and read values of Radio buttons
  var radio_names = ['gender', 'handicap', 'HK']
  for (var i = 0; i < radio_names.length; i++) {
    if (!$('input[name="' + radio_names[i] + '"]').is(':checked')) {

      $('input[name="' + radio_names[i] + '"]').closest('.form-group').find('.fieldError').addClass('hasError');
      missing_fields.push(radio_names[i]);
      item = {}
      item["id"] = radio_names[i];
      item["value"] = '';
      jsonObj.push(item);
      errcount++;
    }
    else {

      $('input[name="' + radio_names[i] + '"]').closest('.form-group').find('.fieldError').removeClass('hasError');
      value = $('input[name="' + radio_names[i] + '"]:checked').val();
      item = {}
      item["id"] = radio_names[i];
      item["value"] = value;
      jsonObj.push(item);
    }
  }

  if (photo_filename === undefined) {
    $('#photo_err').addClass('hasError');
    missing_fields.push("Student Photo");
    item = {}
    item["id"] = 'photo_path';
    item["value"] = '';
    jsonObj.push(item);
    errcount++;
  }
  else {
    $('#photo_err').removeClass('hasError');
    item = {}
    item["id"] = 'photo_path';
    item["value"] = photo_filename;
    //console.log(photo_filename);
    jsonObj.push(item);
  }

  console.log(jsonObj);
  gRgPerinfo = JSON.stringify(jsonObj);
  return errcount;
}

var gAppNo;
function saveApplication(finsub) {
  //let error = validateApplication();
  if (validateApplication() > 0 && finsub == 'T') {
    html_string = '';
    for (let field of missing_fields) {
      html_string += "<li style='padding: 0px; margin: 0px;'>" + field + "</li>";
    }
    if (missing_fields.length > 0) {
      swal({
        title: "The following fields are missing",
        text: `<div class="col-md-12">
				<ol style="color: red;text-align:left;">${html_string}</ol></div>`,
        html: true,
        showCancelButton: false,
        confirmButtonColor: "#5495ff",
        confirmButtonText: "OK",
        closeOnConfirm: false
      });
    }
    return;
  }
  console.log(gRgPerinfo);

  var datastring = 'personal_info=' + gRgPerinfo + '&ffinsub=' + finsub + "&formtype=" + getCookie("formab") + "&fappno=" + $("#fappno").val();
  $.blockUI({ message: "<img src='img/Loading_icon.gif' border='0'>" });

  $.ajax({
    type: "POST",
    data: datastring,
    url: $host_url + 'savephdApplication',
    success: function (responce) {
      $.unblockUI();
      var { error_code, data } = JSON.parse(responce);
      // console.log(res);
      if (error_code == 0 && finsub == 'F') {
        if (missing_fields.length > 0) {
          html_string = 'The following fields are missing';
          for (let field of missing_fields) {
            html_string += "<li style='padding: 0px; margin: 0px;'>" + field + "</li>";
          }

        }
        swal({
          title: "Unless the final submission is not made the application will not be recieved at the university",
          text: `<div class="col-md-12">
					<p><br/></p>
					<ol style="color: red;text-align:left;">${html_string}</ol></div>`,
          html: true,
          showCancelButton: false,
          confirmButtonColor: "#5495ff",
          confirmButtonText: "OK",
          closeOnConfirm: false
        });
      }
      else if (error_code == 0 && finsub == 'T') {
        // var { error_code, data } = JSON.parse(responce);
        var { message, app_no } = data;
        var { app_no } = data;
        $('#sbmchallan').hide();
        $('#makepayment').show();
        $('#dapp_no').append(app_no);
        gAppNo = app_no;
        $('#app_msg').append(message);
        $('#personal_det').hide();
        $('#success_card').show();
      }
      else {
        swal({
          title: data.message,
          type: "warning",
          html: false,
          showCancelButton: false,
          confirmButtonColor: "#5495ff",
          confirmButtonText: "OK",
          closeOnConfirm: false
        });
      }
    }
  });
}

function FillDropdownValues(arr, ele_name, def_title) {
  document.getElementById(ele_name).options.length = 0;
  if (ele_name == 'S4') {
    var op1 = new Option('  All  ' + def_title, 'all');
    op1.id = '00';
    op1.selected = 'selected';
    document.getElementById(ele_name).options.add(op1);
  }
  var option = "<option value=''>--Select--</option>";
  for (let value of arr) {
    option += "<option value='" + value.int_code + "'>" + value.val + "</option>";
  }
  $("#" + ele_name).append(option);
}


function acceptNumbersOnlyForModule(evt) {
  var charCode;
  if (window.event)
    charCode = window.event.keyCode;   //if IE
  else
    charCode = evt.which; //if firefox
  if (charCode > 31 && (charCode < 48 || charCode > 57))
    return false;
  return true;
}

function charKeydown(evt) {
  var charCode;
  if (window.event)
    charCode = window.event.keyCode;  //for IE
  else
    charCode = evt.which;  //for firefox
  if (charCode == 32) //for &lt;space&gt; symbol
    return true;
  if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table
    return false;
  if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table
    return false;
  if (charCode > 122) //for characters beyond 'z' in ASCII Table
    return false;
  return true;
}

function autoFilladd() {
  if ($('#basic_checkbox_1').is(':checked')) {
    $('#fcurradd1').val($('#fpermadd1').val());
    $('#fcurradd2').val($('#fpermadd2').val());
    $('#fcurradd3').val($('#fpermadd3').val());
    $('#fcurrdist').val($('#fpermdist').val());
    $('#fcurrpin').val($('#fpermpin').val());
    $('#fcurrstate').val($('#fpermstate').val());
  }
  else {
    $('#fcurradd1').val('');
    $('#fcurradd2').val('');
    $('#fcurradd3').val('');
    $('#fcurrdist').val('');
    $('#fcurrpin').val('');
    $('#fcurrstate').val('');
  }
}

/*
function makePayment()
{
	window.location.href="Paytm/pgRedirect.php?productinfo="+gAppNo;
}*/


function makepayment() {
  var rappno = gAppNo;
  //  console.log(rappno);

  $.ajax({
    type: "POST",
    url: $host_url + 'masbankdet',
    success: function (responce) {
      responce = eval('(' + responce + ')');

      if (responce.error_code == 0) {

        var button = '';
        $.ajax({
          type: "POST",
          async: false,
          data: "appno=" + rappno + "&funivcode=" + '041',
          url: "razorpay/pay.php",
          success: function (responce) {
            button = responce;
          }
        });


        var table = `<table class="payment" width = "60%" border = "1" cellspacing="0" cellpadding="5" style = "margin:1% auto;">
                <thead>
                    <th style = "text-align: center;width = 20%;">
                        Logo
                    </th>
                    <th style = "text-align: center;width = 20%;" >
                        Action
                    </th>
                </thead>
                <tbody>`;
        var masbank = responce.data['masbank'];

        for (var i = 0; i < masbank.length; i++) {
          if (masbank[i]['fbank'] == 'razorpay' || masbank[i]['fbank'] == 'paytm') {
            table += `<tr>
							<td width = "12%;" style = "text-align: center;">
								<img height="60" width="150" src = "${masbank[i]['fbanklog']}" />
							</td>`;


            if (masbank[i]['fbank'] == 'razorpay') {
              table += `<td width = "20%;">
									<center>${button}</center>
							</td>`;
            } else {
              table += `<td width = "20%;" >
							<center><span class="button" onclick="makepaymentdet('${masbank[i]['fbank']}','${rappno}','${masbank[i]['funivcode']}')">Make Payment</span></center>
								</td>
							</tr>`;
            }
          }
        }

        $('#bankdet').show();
        $('#bankdet').html(table);
        return;
      }
    }
  });


  //window.location.href="Paytm/pgRedirect.php?productinfo="+rappno;
}


function makepaymentdet(payment, id, funivcode) {

  if (payment == 'paytm')
    window.location.href = "Paytm/pgRedirect.php?productinfo=" + id + "&funivcode=" + funivcode;

  if (payment == 'axis')
    window.location.href = "axis/sampleEasyPay.php?productinfo=" + id + "&funivcode=" + funivcode;

  if (payment == 'hdfc') {
    window.location.href = "hdfc/ccavRequestHandler.php?productinfo=" + id + "&funivcode=" + funivcode;
  }

}

function PrintApplicationFormpaytmNETBANKING(pAppNo) {
  $host_url = "http://oasis.logisys.org/kus/phdadm/app.php?&a=";
  window.location.href = $host_url + "PrintApplicationFormSBM&app_no=" + pAppNo;
}

function setCookie(c_name, value, expiredays) {
  var exdate = new Date()
  exdate.setDate(exdate.getDate() + expiredays)
  document.cookie = c_name + "=" + escape(value) +
    ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString())
}

function getCookie(c_name) {
  if (document.cookie.length > 0) {
    c_start = document.cookie.indexOf(c_name + "=")

    if (c_start != -1) {
      c_start = c_start + c_name.length + 1
      c_end = document.cookie.indexOf(";", c_start)

      if (c_end == -1) c_end = document.cookie.length
      return unescape(document.cookie.substring(c_start, c_end))
    }
  }
  return "";
}



function getreprint() {
  var rappno = $('#rappno').val();
  var rdob = $('#rdob').val();
  var datastring = "&rappno=" + rappno + "&rdob=" + rdob;

  $.ajax({
    type: "POST",
    url: $host_url + 'getreprint',
    data: datastring,
    success: function (responce) {
      responce = eval('(' + responce + ')');
      if (responce.error_code == 0) {

        console.log(responce.data.html.ffinsub);

        if (responce.data.html.fpaymentstatus == 'success') {
          window.location.href = $host_url + "PrintApplicationFormSBM&app_no=" + rappno;
        }
        else if (responce.data.html.ffinsub == 'T') {
          alert('Payment not made.');
          return;
        }
        else {
          alert('Final submission not made');
          return;
        }

      }
      else {
        alert('Invalid Details.');
        return;
      }
    }
  });
}