<?php
	define("EXCEL_FILE_UPLOAD", 1);
	define("EXCEL_FILE_EXIST", 2);
	define("EXCEL_FILE_NAME", $_SESSION['login_id']."-excel.xls");
?>
<?php
function post_check($filename) {
	if ($_POST['upload']) {
		if (strtolower(strrchr($_FILES[$filename]['name'], '.')) == '.xls') {
			return EXCEL_FILE_UPLOAD;
		} else {
			return false;
		}
	} elseif ($_POST['clear']) {
		return false;
	} elseif ($_POST['redraw']) {
		if (file_exists(ATTACH_FILE_FOLDER.EXCEL_FILE_NAME)) {
			return EXCEL_FILE_EXIST;
		} else {
			return false;
		}
	} else {
		if (file_exists(ATTACH_FILE_FOLDER.EXCEL_FILE_NAME)) {
			return EXCEL_FILE_EXIST;
		} else {
			return false;
		}
	}
}
?>
