<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.Adv.UI_List"  CodePage="65001" %>

<script>

function PicManage(id)
{
	SetActive(id);
	addDialogbox("#Div_AdminEdit","图片管理",10001,600);
	//quitScreenMask();
	$.ajax({
		type: "POST",
		url: APP+"/Admin/Adv_Pic_UI_List&PhotoType=3&PhotoUserType=2",
		data:{"InfoId":id},//2产品编号,3广告类,4晒图类
		cache: false,
		success: function(msg){
			$("#Div_AdminEdit .dialogboxContent").html(msg);
			$("#Div_AdminEdit .dialogboxContent").addClass("regWrap");
			//mbsimajax(APP+"/Admin/Product_List","mbAjaxShow");//ajax_list
		}
	});
}


//编辑
function Edit_Info(id)
{
	SetActive(id);
	addDialogbox("#Div_AdminEdit","编辑广告信息",10001,560);
	//quitScreenMask();
	$.ajax({
		type: "POST",
		url: APP+"/Admin/Adv_Add_UI",
		data:{"id":id},
		cache: false,
		success: function(msg){
			$("#Div_AdminEdit .dialogboxContent").html(msg);
			$("#Div_AdminEdit .dialogboxContent").addClass("regWrap");
			LoadEditor("Details");
		}
	});
}

//增加
function Add_Info()
{
	addDialogbox("#Div_AdminEdit","请填写广告信息",10001,560);
	//quitScreenMask();
	$.ajax({
		type:"POST",
		url: APP+"/Admin/Adv_Add_UI/",
		cache: false,
		"data":'',
		success: function(msg){
			$("#Div_AdminEdit .dialogboxContent").html(msg);
			$("#Div_AdminEdit .dialogboxContent").addClass("regWrap");
			LoadEditor("Details");
		}
	});
}

//删除
function Del_Info(id)
{
	SetActive(id);
	addDialogbox("#Div_AdminEdit","你确认删除本广告信息吗?",10001,250);
	msg='删除本广告信息将不能恢复!<br><br>	'+
			'<div class="paragraph">'+
				'<button type="button" class="button" class="f12" onclick="Del_Info_Yes('+id+')">确认删除本广告信息</button>'+
				'<button type="button" class="button" class="f12" onclick="Del_Info_No()">返回</button>'+
			'</div>';
	$("#Div_AdminEdit .dialogboxContent").html(msg);
}

function Del_Info_No(){
	removeDialogbox("#Div_AdminEdit");
}

function Del_Info_Yes(id){
	$.ajax({
		type: "POST",
		url: APP+"/Admin/Adv_Update",
		data:{"Id":id,"DeleteType":3,"AdvType":1},//DeleteType==2:删除
		cache: false,
		success: function(msg){
			//alert(msg)
			var urlParam = "&AdvType=<%=AdvType%>";
			SimpleAjax(APP+"/Admin/Adv_List"+client_GetPageNoToUrlParam()+urlParam);//ajax_list
			removeDialogbox("#Div_AdminEdit");
		}
	});

}

//11:43 2010-9-29
$(document).ready(function(){
	client_SetPageNo(<%=intPageNo%>);//记录页码
});


</script>



<table border="0" class="chart" style="width:100%;">

<tr style="height:30px;	font-weight: bold;">
<TH style="width:30px">编号</TH>
<TH style="width:200px">标题</TH>
<TH style="width:220px;text-align:left">广告位编号 | 广告位  </TH>
<TH style="width:70px">链接</TH>
<TH style="width:70px">图片</TH>
<TH style="width:100px">状态</TH>
<TH style="">操作</TH>
</tr>

<asp:Repeater id="rpList" runat="server">
<ItemTemplate>

<tr  id="tr_<%#Eval("id")%>">
		<td><%#Eval("id")%></TD>
		<TD title="<%#Eval("Explain")%>"><%#Eval("title")%></td>
		<TD style="text-align:left" title="<%#Eval("Explain")%>"><%#Eval("AdvSubType")%> | <%#GetParentClassName(Eval("AdvSubType"))%></td>		
		<td title="<%#Eval("Href")%>" style="text-align:center"> 
		<a  href="<%#Eval("Href")%>" target="_blank">预览</a>
		</td>
		<td title="<%#Eval("PhotoPath")%>" style="text-align:center"> 
		<a id="td_a_<%#Eval("id")%>" href="<%#Eval("PhotoPath")%>" target="_blank">预览</a>
		|
		<a href="javascript:" onclick="PicManage(<%#Eval("Id")%>)">管理</a>
		</td>
		<td ><%#Eval("IsChecked").Equals(1)?"<font color='green'>启用</font>":"<font color='red'>停用</font>"%></td>
		<td>
				<button type="button" class="button" style="width:50px;height:22px;margin:2px;" onclick="Edit_Info('<%#Eval("id")%>')" >编辑</button>
				<button type="button" class="button" style="width:50px;height:22px;margin:2px;" onclick="Del_Info('<%#Eval("id")%>')" >删除</button>
		</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<div class="page"  style="margin-left:-13px"><%=strPageInfo%>    

<a href="#" class="A_Add" onclick="Add_Info()" >添加</a>
</div>

<div class="Warning">
&nbsp;&nbsp;注：广告位依需求不同而不同，前台应用也与之相关，因此，如您有广告的需求，若无任何文档说明时请先与研发商联系，从而为您的个性广告量身订做。
</div>