<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
		<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js'></script>
		<script type="text/javascript" src="/media/js/w3d.common.js"></script>
		<script type="text/javascript" src="/media/js/css_browser_selector.js"></script>
		<link rel='stylesheet' href='/media/css/pages/manager.css' />
	</head>
	<body>
		<div class='managerWrapper'>
			<div class='managerTab'>
				<ul class='tabList'>
					<a href='/manager/product'>
						<li class='menu'>製品</li>
					</a>
					<a href='/manager/fabric'>
						<li class='menu'>織物</li>
					</a>
					<a href='/manager/user'>
						<li class='menu'>ユーザー</li>
					</a>
					<a href='/manager/clientgroup'>
						<li class='menu'>お客様 Group</li>
					</a>
					<li class='menu selected'>Simulation</li>
					<li class='loginInfo'>
						<span>{{ user.username }}</span>
						<a href='/' class='viewer'>Viewer</a>
						<a href='/logout' class='logout'>Logout</a>
					</li>
				</ul>
			</div>
			<div class='managerContent' id='user_page'>
				<div class='userForm'>
					<div class='userList'>
						<label class='top bold'>Simulation クリーンアップ</label>
						<div class='functions'>
							<div class='manager_button simulationFunc cleanup right_end'>クリーンアップ</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script type='text/javascript'>
			$(function() {
				$('.simulationFunc.cleanup').click(function() {
					$.ajax({
						url: '/manager/simulation/cleanup',
						type: 'POST',
						cache: false,
						dataType: 'json',
						async: false,
						success: function(jsonResponse) {
							if (jsonResponse.success) {
								alert('Cleanup has been completed.');
							}
							else {
								alert('Cleanup has been failed.');
							}
						},
						error: function() {
							alert('Cleanup has been failed.');
						}
					});
				});
			});
		</script>
	</body>
</html>