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/erp-22-05-2018/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;
}
}
}
if (!("autofocus" in document.createElement("input"))) {
document.getElementById("filter").focus();
}
function inner(str) {
//alert(str);
//content format (module/content :|: Xupdate :|: Xlogin :|: Error :|: Clock)
var url = str.split("/");
if (url[1] == "module" && url[2] == "render") {
$.ajax({
type: "POST",
url: "/inner/"+str,
dataType: "html",
data: data,
success: function(content1) {
var content = content1.split(":|:");
$("#modulebar").html(content[0]);
$("#menubar").html(content[1]);
$("#xupdatebar").html(content[2]);
$("#errorbar").html(content[3]);
$("#clockbar").html(content[4]);
$("#helpbar").html('');
}
});
} else if (url[1] == "helper" && url[2] == "render") {
$.ajax({
type: "POST",
url: "/inner/"+str,
dataType: "html",
data: data,
success: function(content1) {
var content = content1.split(":|:");
$("#helpbar").html(content[0]);
}
});
} else {
var data = $('#erpForm').serialize();
//alert(data);
$.ajax({
type: "POST",
url: "/inner/"+str,
dataType: "html",
data: data,
success: function(content1) {
//alert(content1);
var content = content1.split(":|:");
$("#contentbar").html(content[0]);
$("#xupdatebar").html(content[1]);
$("#errorbar").html(content[2]);
$("#clockbar").html(content[3]);
$("#helpbar").html('');
}
});
// focus on filterText box, if applicable
$('#filter').focus();
}
/* 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='fixedbar'><div class='logo'><img src='images/iLogo.png' width='75' height='75' border='0'></div><h2 class='title'>INDIAN<img src='images/tricolor.png' width='175' height='22' border='0'><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></div>";
var pageTitle = "<div class='helpbar'>ERP Generated Copy</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 + pageTitle + "<div class='contentbar'>" + printContent + "</div>" + pageFooter;
window.print();
document.body.innerHTML = originalContent;
}