<%@ Page CodeFileBaseClass="IlgharCMS.Lib.AdminPageBase" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ilghar:Get ID="Invoice" Object="Invoice" InnerID="Request.QueryString['ID']" Validate="True" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>发送发票</title>
<ilghar:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ilghar:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<script type="text/javascript" src="<%=CommonPath%>ajax.js"></script>
<script type="text/javascript" src="<%=JsPath%>common.js"></script>
<script type="text/javascript">
function XmlHttpCallBack(xmlHttp)
{
	if (xmlHttp.status == 200)
		alert("发送成功！");
	else
		alert("发送失败！请查看日志！");

	document.getElementById("Submit").disabled = false;
}

function OnSubmit(form)
{
	var dateTime = /^(\d{1,4})(-|\/)(\d{1,2})(-|\/)(\d{1,2})( (\d{1,2}):(\d{1,2}):(\d{1,2}))?$/;
	if (!dateTime.test(form.UpdateTime.value))
	{
		alert("发送日期格式不正确！");
		form.UpdateTime.select();
		return false;
	}
	
	var data = "Number=" + encodeURIComponent(form.Number.value);
	data += "&UpdateTime=" + encodeURIComponent(form.UpdateTime.value);
	
	document.getElementById("Submit").disabled = true;
	_ajax.Post("<%=WebPath%>ilghar.aspx?Lang=<%=ContentLang%>&Object=Invoice&Operation=Post&ID=<%=Request.QueryString["ID"]%>", data, XmlHttpCallBack);
	return false;
}
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" onclick="OpenCloseLeftFrame()" /></div>
	<div class="Title"><a href="../../Host/invoice/list.aspx?Lang=<%=ContentLang%>">发票列表</a> → <span class="<%=ContentLang%>Font"><%=Request.QueryString["ID"]%></span></div>
	<div class="Right"></div>
</div>
<div class="Block">
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle">发送发票</li>
		<li class="Right"></li>
	</ul>
	<form method="post" onsubmit="return OnSubmit(this)">
		<table border="0" cellpadding="4" cellspacing="1">
			<tbody>
				<tr>
					<th>金额：</th>
					<td><%=Invoice[Amount]%></td>
				</tr>
				<tr>
					<th>发票抬头：</th>
					<td><%=Invoice[InvoiceRise]%></td>
				</tr>
				<tr>
					<th>发票号：</th>
					<td><input type="text" name="Number" size="50" maxlength="255" class="Text" /></td>
				</tr>
				<tr>
					<th>发送日期：</th>
					<td><input type="text" name="UpdateTime" value="<%=DateTime.Now.ToString("yyyy-MM-dd")%>" maxlength="50" class="Text" /></td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="2"><input type="submit" id="Submit" class="Button" value="发送" /></td>
				</tr>
			</tfoot>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script type="text/javascript">
HandleFake404();
</script>
</body>
</html>