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


Current Path : /var/www/html/pget/js/admin/
Upload File :
Current File : /var/www/html/pget/js/admin/seatmatrix.js

// var $host_url =
//   "http://" +
//   window.location.host +
//   "/" +
//   window.location.pathname.split("/")[1] +
// 	"/app.php?a=";

function loadSeatMatrix() {
  $.ajax({
    type: "POST",
    url: $host_url + "loadSeatMatrix",
    async: false,
    success: function(response) {
      var { error_code, data, status } = JSON.parse(response);
      console.log(data);
      var res = [];
      var arrof100 = [];
      var arrof90 = [];
      var arrof80 = [];
      var arrof70 = [];
      var arrof60 = [];
      var arrof55 = [];
      var arrof50 = [];
      var arrof45 = [];
      var arrof40 = [];
      var arrof35 = [];
      var arrof30 = [];
      var arrof25 = [];
      var arrof20 = [];
      var arrof10 = [];
      var arrof5 = [];
      if (error_code == "0") {
        for (var i = 0; i < data.length; i++) {
          if (data[i].fintake == "100") {
            arrof100.push(data[i]);
          }
          if (data[i].fintake == "90") {
            arrof90.push(data[i]);
          }
          if (data[i].fintake == "80") {
            arrof80.push(data[i]);
          }

          if (data[i].fintake == "70") {
            arrof70.push(data[i]);
          }

          if (data[i].fintake == "60") {
            arrof60.push(data[i]);
          }

          if (data[i].fintake == "55") {
            arrof55.push(data[i]);
          }

          if (data[i].fintake == "50") {
            arrof50.push(data[i]);
          }

          if (data[i].fintake == "45") {
            arrof45.push(data[i]);
          }

          if (data[i].fintake == "40") {
            arrof40.push(data[i]);
          }

          if (data[i].fintake == "35") {
            arrof35.push(data[i]);
          }

          if (data[i].fintake == "30") {
            arrof30.push(data[i]);
          }

          if (data[i].fintake == "25") {
            arrof25.push(data[i]);
          }

          if (data[i].fintake == "20") {
            arrof20.push(data[i]);
          }

          if (data[i].fintake == "10") {
            arrof10.push(data[i]);
          }

          if (data[i].fintake == "5") {
            arrof5.push(data[i]);
          }
        }
        res.push(
          arrof100,
          arrof90,
          arrof80,
          arrof70,
          arrof60,
          arrof55,
          arrof50,
          arrof45,
          arrof40,
          arrof35,
          arrof30,
          arrof25,
          arrof20,
          arrof10,
          arrof5
        );
        //  console.log(res);
        //  console.log(arrof100,arrof5,arrof20,arrof30,arrof35);

        $("#loadTab").load("seatmatrix.html", function() {
          var str = ` <thead style="text-align: center;">
              <tr class="bg-cyan">
                  <td class="qaltablefisrtrd" style="width: 100px;" rowspan="3">Degree Code</td>
                  <td class="qaltablefisrtrd"style="width: 500px;" rowspan="3">Degree</td>
                  <td class="qaltablefisrtrd" style="width: 100px;" rowspan="3">College Code</td>
                  <td class="qaltablefisrtrd" style="width: auto;" rowspan="3">College</td>
                  <td class="qaltablefisrtrd" style="width: 525px;" colspan="32">HK-REGION</td>
                  <td class="qaltabletd" style="width: 525px;" colspan="32">NHK-REGION</td>  
              </tr>
              <tr class="bg-cyan">
                
                <td class="qaltablefisrtrd" colspan="4">GM</td>
                <td class="qaltabletd" colspan="4" >SC</td>
                <td class="qaltabletd" colspan="4" >ST</td>
                <td class="qaltabletd" colspan="4" >CAT-1</td>
                <td class="qaltabletd" colspan="4" >IIA</td>
                <td class="qaltabletd" colspan="4" >IIB</td>
                <td class="qaltabletd" colspan="4" >IIIA</td>
                <td class="qaltabletd" colspan="4" >IIIB</td>
                <td class="qaltabletd" colspan="4" >GM</td>
                <td class="qaltabletd" colspan="4" >SC</td>
                <td class="qaltabletd" colspan="4" >ST</td>
                <td class="qaltabletd" colspan="4" >CAT-1</td>
                <td class="qaltabletd" colspan="4" >IIA</td>
                <td class="qaltabletd" colspan="4" >IIB</td>
                <td class="qaltabletd" colspan="4" >IIIA</td>
                <td class="qaltabletd" colspan="4" >IIIB</td>
              </tr>
              <tr  class="bg-cyan">
                
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>                
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
                <td class="qaltablefisrtrd">Total</td>
                <td class="qaltablefisrtrd">Allotted</td>
                <td class="qaltablefisrtrd">Pending</td>
                <td class="qaltablefisrtrd">Cancel</td>
              </tr>
            </thead>
            <tbody style="text-align: center;">`;

          // var subdet = res;
          var i = 0;
          data.forEach(element => {
            // var subname = element.subname;
            // console.log(data[i].fcollcode);

            // var value = subname.split("-");
            str += `
              <tr class="ui-widget-content jqgrow">
                <td class="tbl_row_new"><b>${data[i].fdegree}</b></td>
                <td class="tbl_row_new" width="500"><b>${data[i].fdescpn}</b></td>  
                <td class="tbl_row_new">${data[i].fcollcode}</td>
                <td class="tbl_row_new">${data[i].fcollname}</td>

                <td class="tbl_row_new">${data[i].HKGMTOT}</td>
                <td class="tbl_row_new">${data[i].HKGMALLOT}</td>
                <td class="tbl_row_new">${data[i].HKGMPEND}</td>
                <td class="tbl_row_new">${data[i].HKGMCAN}</td>
                <td class="tbl_row_new">${data[i].HKSCTOT}</td>
                <td class="tbl_row_new">${data[i].HKSCALLOT}</td>
                <td class="tbl_row_new">${data[i].HKSCPEND}</td>
                <td class="tbl_row_new">${data[i].HKSCCAN}</td>
                <td class="tbl_row_new">${data[i].HKSTTOT}</td>
                <td class="tbl_row_new">${data[i].HKSTALLOT}</td>
                <td class="tbl_row_new">${data[i].HKSTPEND}</td>
                <td class="tbl_row_new">${data[i].HKSTCAN}</td>
                <td class="tbl_row_new">${data[i].HKCATITOT}</td>
                <td class="tbl_row_new">${data[i].HKCATIALLOT}</td>
                <td class="tbl_row_new">${data[i].HKCATIPEND}</td>
                <td class="tbl_row_new">${data[i].HKCATICAN}</td>
                <td class="tbl_row_new">${data[i].HKIIATOT}</td>
                <td class="tbl_row_new">${data[i].HKIIAALLOT}</td>
                <td class="tbl_row_new">${data[i].HKIIAPEND}</td>
                <td class="tbl_row_new">${data[i].HKIIACAN}</td>
                <td class="tbl_row_new">${data[i].HKIIBTOT}</td>
                <td class="tbl_row_new">${data[i].HKIIBALLOT}</td>
                <td class="tbl_row_new">${data[i].HKIIBPEND}</td>
                <td class="tbl_row_new">${data[i].HKIIBCAN}</td>
                <td class="tbl_row_new">${data[i].HKIIIATOT}</td>
                <td class="tbl_row_new">${data[i].HKIIIAALLOT}</td>
                <td class="tbl_row_new">${data[i].HKIIIAPEND}</td>
                <td class="tbl_row_new">${data[i].HKIIIACAN}</td>
                <td class="tbl_row_new">${data[i].HKIIIBTOT}</td>
                <td class="tbl_row_new">${data[i].HKIIIBALLOT}</td>
                <td class="tbl_row_new">${data[i].HKIIIBPEND}</td>
                <td class="tbl_row_new">${data[i].HKIIIBCAN}</td>              

                <td class="tbl_row_new">${data[i].NHKGMTOT}</td>
                <td class="tbl_row_new">${data[i].NHKGMALLOT}</td>
                <td class="tbl_row_new">${data[i].NHKGMPEND}</td>
                <td class="tbl_row_new">${data[i].NHKGMCAN}</td>
                <td class="tbl_row_new">${data[i].NHKSCTOT}</td>
                <td class="tbl_row_new">${data[i].NHKSCALLOT}</td>
                <td class="tbl_row_new">${data[i].NHKSCPEND}</td>
                <td class="tbl_row_new">${data[i].NHKSCCAN}</td>
                <td class="tbl_row_new">${data[i].NHKSTTOT}</td>
                <td class="tbl_row_new">${data[i].NHKSTALLOT}</td>
                <td class="tbl_row_new">${data[i].NHKSTPEND}</td>
                <td class="tbl_row_new">${data[i].NHKSTCAN}</td>
                <td class="tbl_row_new">${data[i].NHKCATITOT}</td>
                <td class="tbl_row_new">${data[i].NHKCATIALLOT}</td>
                <td class="tbl_row_new">${data[i].NHKCATIPEND}</td>
                <td class="tbl_row_new">${data[i].NHKCATICAN}</td>
                <td class="tbl_row_new">${data[i].NHKIIATOT}</td>
                <td class="tbl_row_new">${data[i].NHKIIAALLOT}</td>
                <td class="tbl_row_new">${data[i].NHKIIAPEND}</td>
                <td class="tbl_row_new">${data[i].NHKIIACAN}</td>
                <td class="tbl_row_new">${data[i].NHKIIBTOT}</td>
                <td class="tbl_row_new">${data[i].NHKIIBALLOT}</td>
                <td class="tbl_row_new">${data[i].NHKIIBPEND}</td>
                <td class="tbl_row_new">${data[i].NHKIIBCAN}</td>                
                <td class="tbl_row_new">${data[i].NHKIIIATOT}</td>
                <td class="tbl_row_new">${data[i].NHKIIIAALLOT}</td>
                <td class="tbl_row_new">${data[i].NHKIIIAPEND}</td>
                <td class="tbl_row_new">${data[i].NHKIIIACAN}</td>
                <td class="tbl_row_new">${data[i].NHKIIIBTOT}</td>
                <td class="tbl_row_new">${data[i].NHKIIIBALLOT}</td>
                <td class="tbl_row_new">${data[i].NHKIIIBPEND}</td>
                <td class="tbl_row_new">${data[i].NHKIIIBCAN}</td>                                             
              </tr>`;
            i++;
          });
          str += `</tbody>`;

          $("#colltable").html(str);
        });
      } else {
        alert("Please try after some time");
        return;
      }
    }
  });
}