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.137.221.114
var db = window.location.pathname.split("/")[2];
console.log(db);
if (db == "vku-admin") db = "vskub";
if (db == "ru-admin") db = "ru";
if (location.protocol != "https:") {
var protocol = "http://";
} else {
var protocol = "https://";
}
console.log(db);
var $host_url =
protocol +
window.location.host +
"/" +
window.location.pathname.split("/")[1] +
"/app.php?db=" +
db +
"&a=";
console.log($host_url);
function loadCollegeDetails() {
$.ajax({
type: "POST",
url: $host_url + "loadCollegeDetails",
async: false,
success: function(response) {
var { error_code, data, status } = JSON.parse(response);
// console.log(data);
if (error_code == "0") {
$("#loadTab").load("collegedetails.html", function() {
var degers = data;
deglen = degers.length;
var str = `<table class="table table-bordered" style="width: auto;">
<thead>
<tr class="bg-cyan">
<th style = "text-align: center;width: 85px;">Sl. No.</th>
<th style = "text-align: center;width: 115px;">College Code</th>
<th style = "text-align: center;width: 660px;">College Name</th>
</tr>
</thead>
<tbody>`;
for (var i = 1; i < degers.length; i++) {
str += `<tr>
<td style = 'text-align: center;'>${i}</td>
<td style = 'text-align: center;'>${degers[i]["fcollcode"]}</td>
<td>${degers[i]["fcollname"]}</td>
</tr>`;
}
$("#colltable").html(str);
});
} else {
alert("Please try after some time");
return;
}
}
});
}
function loadHomePage() {
$.ajax({
type: "POST",
url: $host_url + "loadPGAD",
async: false,
success: function(response) {
var { error_code, data, status } = JSON.parse(response);
console.log(data);
if (error_code == "0") {
$("#loadTab").load("home.html", function() {
var degers = data;
deglen = degers.length;
console.log(data[0].message);
var str = data[0].message;
$("#home").html(str);
});
} else {
alert("Please try after some time");
return;
}
}
});
}
function loadonload() {
$.ajax({
type: "POST",
url: $host_url + "loadPGAD",
async: false,
success: function(response) {
var { error_code, data, status } = JSON.parse(response);
console.log(data);
if (error_code == "0") {
$("#loadTab").load("home.html", function() {
var degers = data;
deglen = degers.length;
console.log(data.message);
var str = data.message.message;
$("#home").html(str);
});
if (data.user.fusertype == "usr") {
console.log(data.user.fusertype);
$("ul.list li").hide();
$("ul.list li.user").show();
}
console.log(data.user.fname);
var usr = 'USER: ' + data.user.fname + ' (' + data.user.fusertype +')';
console.log(usr);
$('#usrtype').html(usr);
} else {
alert(data);
window.location.href = "index.html";
return;
}
}
});
}
|