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


Current Path : /var/www/html/pget/js/pg/
Upload File :
Current File : //var/www/html/pget/js/pg/loadSavedData_old_12102019.js

const loadSavedData = fappno => {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "getSavedData&fappno=" + fappno,
    success: function getSavedDataResponce(responce) {
      responce = eval("(" + responce + ")");
      var { data, error_code, status } = responce;
      $("#personal_det input[type=text],#personal_det select").each(function() {
        $(this).val(data.student[$(this).attr("id")]);
      });

      $("#prefDet select").each(function() {
        $(this).val(data.student[$(this).attr("id")]);
      });

      if (data.student["fphotopath"] != "") {
        photo_path = data.student["fphotopath"];
        $("#frmFileUpload").hide();
        $("#studphoto_img").attr(
          "src",
          $host_url1 + "" + data.student["fphotopath"]
        );
        $("#studphoto").show();
      }

      table = `
          <table class="table table-bordered table-hover" id='mainTable'>
          <thead style = 'height:40px;background-color: #184F76 !important;color: #fff;'>
            <tr>
              <th>    SL. No.   </th>
              <th>    Head Code   </th>
              <th>    Fee   </th>
            </tr>
          </thead>`;
      data.feedetl.map((el, i) => {
        table += `<tr class="tblRow" id="tblid">
              <td> ${i + 1} </td>
              <td id="fheadcode${i}"> ${el.fheadcode} </td>
              <td id="fmaxfee${i}"> ${el.famount} </td>
              </tr>`;
        totalFee += parseInt(el.famount);
      });
      table += `
        <tr>
          <td colspan="2" class="text-left">Total</td>
          <td id="ttlAmt">${totalFee}</td>
        </tr>
        </table>`;

      $("#FeeTbl").html(table);

      if (data.student["fgender"] != "") {
        var $radios = $("input:radio[name=fgender]");
        $radios
          .filter("[value=" + data.student["fgender"] + "]")
          .prop("checked", true);
      }

      var radio_names = [
        "fgender",
        "fbpl",
        "fogirl",
        "fkarstudy",
        "fkashmir",
        "fhk",
        "fjk",
        "frural",
        "fkannada",
        "fbcue",
        "fpumat",
        "fqutype",
        "fpubio",
        "fbcuetype",
        "fpgdegree",
        "fpgunivtype"
      ];

      for (var i = 0; i < radio_names.length; i++) {
        if (data.student[radio_names[i]] != "") {
          var $radios = $("input:radio[name=" + radio_names[i] + "]");
          var value = data.student[radio_names[i]];
          $radios.filter(`[value="${value}"]`).prop("checked", true);
        }
      }

      var checkbox_names = [
        "fsports",
        "fculture",
        "fncc",
        "fnss",
        "fdefence",
        "fhandicap"
      ];

      // var checkboxes = $("#quota input[type=checkbox]");

      for (var i = 0, n = checkbox_names.length; i < n; i++) {
        var checkbox = $(
          "#quota input[type=checkbox][name=" + checkbox_names[i] + "]"
        );
        var value = data.student[checkbox_names[i]];
        checkbox.filter(`[value="${value}"]`).prop("checked", true);
      }

      $("#prevAcadDet input[type=text],#prevAcadDet select").each(function() {
        $(this).val(data.student[$(this).attr("id")]);
      });
      $("#marksDet input[type=text]").each(function() {
        $(this).val(data.student[$(this).attr("id")]);
      });

      $("#prevAcdMarks input[type=text]").each(() => {
        $(this).val(data.student[$(this).attr("id")]);
      });

      $("#prevPGDet input[type=text],#prevPGDet select").each(function() {
        $(this).val(data.student[$(this).attr("id")]);
      });

      $("#OtherInfo input[type=text],#OtherInfo textarea").each(function() {
        $(this).val(data.student[$(this).attr("id")]);
      });
    }
  });
};