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


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

function getData() {
  let url = document.URL;
  urlParams = parseURLParams(url);
  console.log(urlParams);
  $.ajax({
    type: "GET",
    url:
      "https://college.universitysolutions.in/app.php?db=" +
      urlParams.db[0] +
      "&a=deggrpwisestudcount" +
      "&deggrp=" +
      urlParams.deggrp[0] +
      "&degexam=" +
      urlParams.degexam[0] +
      "&yearmode=" +
      urlParams.yearmode[0],
    success: function (res) {
      let response = JSON.parse(res);
      console.log(response);

      google.charts.load("current", { packages: ["corechart"] });
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ["Task", "Hours per Day"],
          ["Work", 11],
          ["Eat", 2],

          ["Game", 7],
        ]);

        var options = {
          title: "My Daily Activities",
          pieSliceText: "label",
        };

        var chart = new google.visualization.PieChart(
          document.getElementById("piechart")
        );

        chart.draw(data, options);
      }
    },
  });
}
function parseURLParams(url) {
  var queryStart = url.indexOf("?") + 1,
    queryEnd = url.indexOf("#") + 1 || url.length + 1,
    query = url.slice(queryStart, queryEnd - 1),
    pairs = query.replace(/\+/g, " ").split("&"),
    parms = {},
    i,
    n,
    v,
    nv;

  if (query === url || query === "") return;

  for (i = 0; i < pairs.length; i++) {
    nv = pairs[i].split("=", 2);
    n = decodeURIComponent(nv[0]);
    v = decodeURIComponent(nv[1]);

    if (!parms.hasOwnProperty(n)) parms[n] = [];
    parms[n].push(nv.length === 2 ? v : null);
  }
  return parms;
}