Sh3ll
OdayForums


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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/mmishra/erp19-7-2019/js/erp_ajax.js
//AJAX function
function test() {
	alert('hello');
}

function session_checking() {
    $.post( "../inner.php", function(data) {
        if (data == "-1") {
            alert("Your session has been expired!");
            location.reload();
        }
    });
}

var validateSession = setInterval(session_checking, 60000);

function popWindow(url, windowName, w, h) {
	features = 'width='+w+',height='+h+',top=10,left=10,toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no,statusbar=no';
	newWindow = window.open('', windowName, features);

	var html = "";
    html += "<html><head>";
    html += "<title>Close this window gracefully and refresh parent window for updated information.</title>";
	html += "<base href='https://erp.iiita.ac.in/' />";
	html += "<meta charset='utf-8'>";
  	html += "<meta http-equiv='content-type' content='text/html; charset=utf-8' />";
	html += "<meta name='viewport' content='width=device-width, initial-scale=1.0' />";
	html += "<meta name='description' content='enterprise resource planning, institute resource planning, iiita resource planning' />";
	html += "<meta name='author' content='Dr. M.K. Mishra, System Analyst' />";
	
	html += "<link rel='SHORTCUT ICON' href='images/logo.ico' />";
	html += "<link rel='stylesheet' type='text/css' href='css/calendar.css' media='screen' />";
	html += "<link rel='stylesheet' type='text/css' href='css/fontawesome-all.css' media='screen' integrity='sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ' crossorigin='anonymous' />";
	html += "<link rel='stylesheet' type='text/css' href='https://use.fontawesome.com/releases/v5.3.1/css/all.css' integrity='sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU' crossorigin='anonymous' />";
	html += "<link rel='stylesheet' type='text/css' href='css/erp_style.css' media='screen' />";

	html += "<script type='text/javascript' src='js/jquery-3.2.1.min.js' integrity='sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=' crossorigin='anonymous'></script>";
	html += "<script type='text/javascript' src='js/bootstrap.min.js' integrity='sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa' crossorigin='anonymous'></script>";
	html += "<script type='text/javascript' src='js/calendar.js'></script>";
	html += "<script type='text/javascript' src='js/fontawesome-all.js'></script>";
	html += "<script type='text/javascript' src='js/jquery.min.js'></script>";
	html += "</head><body class='form'>";
    
	var r = new XMLHttpRequest();
    r.open('GET', url, false);
    r.send(null); 
	if (r.status == 200) { 
		var $mm = "";
		mm = r.responseText;
	}
	html += mm;
    html += "</body></html>";

	//alert(mm);
    newWindow.document.write(html);

	if (window.focus) {
		newWindow.focus();
	}
	return true;
}

//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) {
	//content format (Module/Content :|:  Menu :|: Xupdate :|: Xlogin :|: Error :|: Clock)
	var url = str.split("/");
	//var data = $('form').serialize();
	//var data = $('#erpForm, #search, #dummy').serialize();
	var data = $('#erpForm').serialize();
	//alert(data);
	$.ajax({
		type: "POST",
		url: "/inner/"+str,
		dataType: "html",
		data: data,
		success: function(stream) {		
			//alert(content1);
			var content = stream.split(":|:");
			if (url[1] == 'helper') {
				$("#helpbar").html(content[0]);
			} else {
				if (url[1] == 'modules') { 
					$("#modulebar").html(content[0]);
				} else { 
					$("#contentbar").html(content[0]);
				}
				$("#menubar").html(content[1]);
				$("#xupdatebar").html(content[2]);
				$("#errorbar").html(content[3]);
				$("#clockbar").html(content[4]);
				$("#loginbar").html(content[5]);
			}
		}
	});
	if (url[1] == "batch") alert('ERP resets batch year to '+url[3]);
}

function popup(url, windowName, w, h) {
	url = 'popup/'+url;
	//alert(url);
	//features = 'width='+w+',height='+h+',top=10,left=10,toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no,statusbar=no';
	features = 'width=' + (parseInt(window.innerWidth) * 0.6) + ',height=' + (parseInt(window.innerHeight) * .7) + ',top=10,left=10,toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no,statusbar=no';
	//features = 'height=' + (parseInt(window.innerHeight) * .7) + ',scrollbars=1';
	newWindow = window.open(url, windowName, features);
	if (window.focus) {
		newWindow.focus();
	}
	
	$(document).ready(function() {
		// For IE
		var h = $('#popup').outerHeight();
		var newH = h + 20;
		window.resizeBy(0, newH - $(window).height());

		// Only works in Firefox/Safari
		$('img').load(function() {
			var h = $('#popup').outerHeight();
			var newH = h + 20;
			window.resizeBy(0, newH - $(window).height());
		});
	});
	return newWindow;
}

function printMe(divName) {
	var d = new Date();

	var pageHeader = "<div class='printbar'><h3 class='title'><img src='images/iLogo.png' width='50' height='50' border='0'> INDIAN INSTITUTE OF INFORMATION TECHNOLOGY ALLAHABAD <img src='images/tricolor.png' width='100' height='22' border='0'></h3>( ERP 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 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'>&copy;</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;
}

$(document).on('click', '[data-column]', function () {
   	var button = $(this),
    header = $(button.data('column')),
    table = header.closest('table'),
    index = header.index() + 1, // convert to CSS's 1-based indexing
    selector = 'tbody tr td:nth-child(' + index + ')',
    column = table.find(selector).add(header);

  	column.toggleClass('hidden');
});

function update_district(stateID) {
    //alert(stateID);
    var xmlhttp=new XMLHttpRequest();
    xmlhttp.onreadystatechange=function() {
    	if (xmlhttp.readyState==4 && xmlhttp.status==200) {
     		document.getElementById("district").innerHTML=xmlhttp.responseText;
    	}
 	}
    xmlhttp.open("GET", "inner/erp/district/list/"+stateID, true);
    xmlhttp.send();
}

// adjust iframe height
function resizeIframe(obj) {
    obj.style.height = 0;
	obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}

function photograph(picname) {
	var picture = document.picname;
	var SRC = document.picture.src;
	var height = document.picture.height + 50;
	var width = document.picture.width + 50;
	window.open(SRC,'Photo','width=' + width + ',height=' + height + ',menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=no,top=50,left=50');
}

ZeroDay Forums Mini