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


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

function callAdmissionTicketJsstu() {
  $("#page_main_div").load(
    "../html_modules/admission_ticket_jsstu.html?v=24091642",
    function () {
      getDefaultHeadFooterLinks("Admission Ticket New");
      document.getElementById("display_module_name").innerHTML =
        "Admission Ticket";
    }
  );
  getAdmissionDegreeJsstu();
}

function getAdmissionDegreeJsstu() {
  $.ajax({
    type: "GET",
    url: $host_url + "getAdmissionDegreeJsstu",
    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res.data.length);
      let examdata = res.data.exam;
      // return;
      if (res.error_code == 0) {
        var degree = `<option>---Select---</option>`;
        for (var i = 0; i < examdata.length; i++) {
          degree += `<option value='${examdata[i].fyear}*${examdata[i].fexamtype}'>${examdata[i].fexamdate}</option>`;
        }
        $("#exammonth").html(degree);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function getAdmissionDegeeJsstu() {
  $.ajax({
    type: "GET",
    url: $host_url + "getAdmissionDegeeJsstu",
    data: "exammonth=" + $("#exammonth").val(),
    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res.data.length);
      let degdata = res.data.degcode;
      // return;
      if (res.error_code == 0) {
        var degree = `<option>---Select---</option>`;
        for (var i = 0; i < degdata.length; i++) {
          degree += `<option value='${degdata[i].fdegree}'>${degdata[i].fdegree} - ${degdata[i].fdescpn}</option>`;
        }
        $("#report_admission_ticket_degree_code").html(degree);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function getAdmissionExamnoJsstu() {
  let degree = $("#report_admission_ticket_degree_code").val();
  // console.log(degree);
  // return;
  $.ajax({
    type: "GET",
    data: "&degree=" + degree,
    url: $host_url + "hallExam",
    data: "&degree=" + degree,
    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res);
      // return;
      if (res.error_code == 0) {
        var sem = `<option value = 'All'>All</option>`;
        for (var i = 0; i < res.data.length; i++) {
          sem += `<option value='${res.data[i].fexamno}'>${res.data[i].fexamno} - ${res.data[i].fexamname}</option>`;
        }
        $("#exam").html(sem);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function GenerateAdmissionTicketJsstu() {
  if (trim($("#report_admission_ticket_degree_code").val()) == "") {
    alert("Please Enter Degree Code!!");
    $("#report_admission_ticket_degree_code").focus();
    return;
  }

  if (trim($("#report_admission_ticket_start").val()) == "")
    $adm_reg_starts = "00000000";
  else $adm_reg_starts = $("#report_admission_ticket_start").val();

  if (trim($("#report_admission_ticket_End").val()) == "")
    $adm_reg_ends = "ZZZZZZZZ";
  else $adm_reg_ends = $("#report_admission_ticket_End").val();

  //if(trim($("#report_adt_one_per_page").checked == true))
  if (document.getElementById("report_adt_one_per_page").checked == true) {
    $print_hall_ticket_val = "1";
  } else {
    $print_hall_ticket_val = "2";
  }

  $.ajax({
    type: "POST",
    //async:false,
    url: $host_url + "checkdateforhalticket.demo",
    data: "degree=" + trim($("#report_admission_ticket_degree_code").val()),
    success: checkdateforhalticketJsstuResponse,
  });
}

function checkdateforhalticketJsstuResponse($responce) {
  $responce = eval("(" + $responce + ")");
  if ($responce.error_code == "-1") {
    $("#report_admission_ticket_degree_code").val("");
    $("#report_admission_ticket_degree_name").val("");
    document.getElementById("report_admission_ticket_degree_code").focus();
    alert($responce.data);
    return false;
  } else {
    if (trim($("#report_admission_ticket_degree_code").val()) == "") {
      alert("Please Enter Degree Code!!");
      $("#report_admission_ticket_degree_code").focus();
      return;
    }

    if (trim($("#report_admission_ticket_start").val()) == "")
      $adm_reg_starts = "00000000";
    else $adm_reg_starts = $("#report_admission_ticket_start").val();

    if (trim($("#report_admission_ticket_End").val()) == "")
      $adm_reg_ends = "ZZZZZZZZ";
    else $adm_reg_ends = $("#report_admission_ticket_End").val();
    $rptype = $("#rptype").val();
    $exam = $("#exam").val();
    //alert($rptype);
    //if(trim($("#report_adt_one_per_page").checked == true))
    if (document.getElementById("report_adt_one_per_page").checked == true) {
      $print_hall_ticket_val = "1";
    } else {
      $print_hall_ticket_val = "2";
    }

    let exammonth = $("#exammonth").val();

    window.open(
      $host_url +
        "generateAdmissionTicketJsstu.demo&degree_code=" +
        trim($("#report_admission_ticket_degree_code").val()) +
        "&reg_starts=" +
        $adm_reg_starts +
        "&reg_ends=" +
        $adm_reg_ends +
        "&print_hall_ticket=" +
        $print_hall_ticket_val +
        "&rptype=" +
        $rptype +
        "&exam=" +
        $exam +
        "&exammonth=" +
        exammonth,
      "_blank"
    );
  }
}