<%@ Page CodeFileBaseClass="IlgharCMS.Lib.AdminPageBase" %>
<%@ Register TagPrefix="IlgharUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<!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="Ad" Object="Ad" InnerID="Request.QueryString['ID']" Validate="True" />
<ilghar:Get ID="Position" Object="Position" Guid="Ad[PositionID]" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑广告</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ilghar:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ilghar:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<ilgharUC:Ime Ime="true" Eot="true" runat="server" />
<script language="c#" runat="server">
protected string FormatDate(object date)
{
	if (Convert.IsDBNull(date))
		return String.Empty;
	else
		return Convert.ToDateTime(date).ToString("yyyy-MM-dd");
}
</script>
<script type="text/javascript">
var _page = "ad_edit";
var _lang = "<%=ContentLang%>";
var _webPath = "<%=WebPath%>";
var _imagePath = "<%=ImagePath%>";
var _id = "<%=Request.QueryString["ID"]%>";
var _positionID = "<%=Position[InnerID]%>";
var _imageRoot = "<%=Manager.GetDataPath((Guid)Channel[IlgharCMS.SystemModule.Alias.Instance.ID], null) + "ad"%>";
var _uploadImage;
var _lang_working = "正在操作...";
var _lang_operation_fail = "操作失败！";
var _lang_operation_success = "操作成功！";
var _lang_image_type_must_be = "图片类型应为：";
var _lang_start_upload_image = "开始上传图片...";
var _lang_uploading_image = "正在上传图片...";
var _lang_start_time_incorrect = "开始日期不正确！";
var _lang_end_time_incorrect = "结束日期不正确！";
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" /></div>
	<div class="Title"><a href="../position/list.aspx?Lang=<%=ContentLang%>">广告位列表</a> → <span class="<%=ContentLang%>Font"><%=Position[Name]%></span></div>
	<div class="Right"></div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left"></li>
		<li class="Middle"><a href="../position/edit.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Position[InnerID]%>">编辑</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../ad/list.aspx?Lang=<%=ContentLang%>&amp;PositionID=<%=Position[InnerID]%>">广告列表</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../ad/add.aspx?Lang=<%=ContentLang%>&amp;PositionID=<%=Position[InnerID]%>">添加广告</a></li>
		<li class="Right"></li>
		<li class="Left Selected"></li>
		<li class="Middle Selected">编辑广告</li>
		<li class="Right Selected"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tfoot>
				<tr><td colspan="2"><input type="submit" value="编辑" /></td></tr>
			</tfoot>
			<tbody>
				<tr>
					<th>标题：</th>
					<td><input type="text" name="Title" value="<%=Ad[Title]%>" size="50" maxlength="255" class="Text <%=ContentLang%>Font" /></td>
				</tr>
				<tr>
					<th>尺寸（宽x高）：</th>
					<td>
						<input type="text" name="Width" value="<%=Ad[Width]%>" size="10" maxlength="10" class="Text" /> x
						<input type="text" name="Height" value="<%=Ad[Height]%>" size="10" maxlength="10" class="Text" />
					</td>
				</tr>
				<tr>
					<th>图片：</th>
					<td>
						<input id="ImageTextbox" type="text" name="Image" value="<%=Ad[Image]%>" size="55" class="Text" />
						<input id="ImageBrowse" type="button" value="浏览..." />
						<input type="button" value="选择..." />
						<input type="hidden" name="ImageAllowedType" value="gif|jpg|png|swf|flv|rm|rmvb|wmv|mpg" />
						<a href="<%=Ad[Image]%>" target="_blank"><img src="<%=Ad[Image]%>" height="22" id="ImageView" alt="图片" style="vertical-align:bottom" /></a>
						<input type="checkbox" id="AddWaterMark" /><label for="AddWaterMark">水印</label>
					</td>
				</tr>
				<tr>
					<th>链接：</th>
					<td><input type="text" name="URL" value="<%=Ad[URL]%>" size="50" maxlength="255" class="Text" /></td>
				</tr>
				<tr>
					<th>代码：</th>
					<td>
						<button type="button" id="Escape">Escape</button>
						<button type="button" id="UnEscape">UnEscape</button>
						<br />
						<textarea name="Code" cols="70" rows="6" wrap="off" class="Text"><%=Ad[Code]%></textarea>
					</td>
				</tr>
				<tr>
					<th>开始时间：</th>
					<td><input type="text" name="StartTime" value="<%=FormatDate(Ad[StartTime])%>" class="Wdate" onfocus="new DatePicker(this)" /></td>
				</tr>
				<tr>
					<th>结束时间：</th>
					<td><input type="text" name="EndTime" value="<%=FormatDate(Ad[EndTime])%>" class="Wdate" onfocus="new DatePicker(this)" /></td>
				</tr>
				<tr>
					<th>是否计费：</th>
					<td>
						<%If Convert.ToBoolean(Ad[Charge])%>
							<input type="radio" name="Charge" id="ChargeYes" checked="checked" /><label for="ChargeYes">是</label>
							<input type="radio" name="Charge" id="ChargeNo" /><label for="ChargeNo">否</label>
						<%Else%>
							<input type="radio" name="Charge" id="ChargeYes" /><label for="ChargeYes">是</label>
							<input type="radio" name="Charge" id="ChargeNo" checked="checked" /><label for="ChargeNo">否</label>
						<%EndIf%>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script type="text/javascript" src="<%=CommonPath%>uploader.js"></script>
<script type="text/javascript" src="<%=CommonPath%>date_picker/date_picker.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=JsPath%>ad.js"></script>
</body>
</html>