Server : Apache System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 User : apache ( 48) PHP Version : 8.0.28 Disable Function : NONE Directory : /var/www/html/mmishra/erp19-7-2019/js/ |
//AJAX function
window.onload = maxWindow();
function maxWindow() {
window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth, screen.availHeight);
} else if (document.layers || document.getElementById) {
if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
function inner(str) {
//alert(str);
var id1 = "";
var id2 = "";
var str1 = "";
var str2 = "";
var url = str.split("/");
if (url[1] == "module" && url[2] == "render") {
/* set action to render */
id1 = "module";
str1 = str.replace(url[2], "render");
/* set menu to menu */
id2 = "menu";
str2 = str.replace("module", "menu").replace(url[2], "render");
} else {
id1 = "content";
str1 = str;
/* set menu to xupdate */
id2 = "xupdate";
str2 = str.replace(url[1], "xupdate");
}
/* set menu to clock/error */
var str3 = str.replace(url[1], "clock").replace(url[2], "render");
var str4 = str.replace(url[1], "error").replace(url[2], "render");
var data = $('#erpForm').serialize();
$.ajax({
type: "POST",
url: "/inner/"+str1,
dataType: "html",
data: data,
success: function(content1){
var content = content1.split(":|:");
$("#"+id1+"bar").html(content[0]);
//alert(content[1]+'mm');
$("#errorbar").html(content[1]);
}
});
$.ajax({
type: "POST",
url: "/inner/"+str2,
data: str2,
success: function(content2){
$("#"+id2+"bar").html(content2);
}
});
$.ajax({
type: "POST",
url: "/inner/"+str3,
data: str3,
success: function(content3){
$("#clockbar").html(content3);
}
});
/* for non numeric value in url[3] */
/*
if (isNaN(url[3])) {
$.ajax({
type: "POST",
url: "/inner/"+str4,
data: str4,
success: function(content4){
$("#errorbar").html(content4);
}
});
}
*/
}
function printMe(divName) {
var d = new Date();
var pageHeader = "<div class='logo'><img src='images/iLogo.png' width='75' height='75' border='0'></div><h2 class='title'>INDIAN<br>INSTITUTE OF<br>INFORMATION<br>TECHNOLOGY<br>ALLAHABAD</h2><div class='version'>( Version 1.0 <sub style='color:grey; font-size:10px'><i>beta</i></sub> )</div><div class='clockbar' id='clockbar'><i style='font-size:14px;' class='far fa-clock'></i> " + d.toString() + "</div>";
var pageFooter = "<div class='footer'><hr style='border: 0; border-top: 1px solid #247BBB'><b><span style='font-size:14px; color:#247BBB'>©</span>2017 ERP & Automation, IIIT Allahabad, Devghat, Jhalwa, Allahabad-211015 (UP) INDIA<br>Institute ERP system is under development by internal automation team.<br>Contact: 0532-2922011/2042/2238, erp.support@iiita.ac.in<hr style='border: 0; border-top: 1px solid #247BBB'></div>";
var printContent = document.getElementById(divName).innerHTML;
var originalContent = document.body.innerHTML;
document.body.innerHTML = pageHeader + "<div class='contentbar'>" + printContent + "</div>" + pageFooter;
window.print();
document.body.innerHTML = originalContent;
}