<%@ Page CodeBehind="User_Favorite.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Typhoto.User_Favorite" enableViewState="False"%>
<%@ Register TagPrefix="uc1" TagName="UIHead" Src="Controls/UIHead.ascx" %>

<%@ Register TagPrefix="uc1" TagName="UIFrameTop" Src="Controls/UIFrameTop.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UIFrameLeft" Src="Controls/UIFrameLeft.ascx" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		
		<script language="JAVASCRIPT">
function checkAll()
{
	var objID;
	objID=document.all.Album;
	for (var i=0 ;i<objID.length-1;i++)
	{
		if(objID[i].checked)
		{
			objID[i].checked=false;
			AddRemoveValues(objID[i]); 
			
		}
		else
		{
			objID[i].checked=true;
			AddRemoveValues(objID[i]);
		}
	}
}
function AddRemoveValues(oChk) { 
if(oChk.checked)
document.Form1.HdnSelectedValues.value += "," + oChk.value; 
else
document.Form1.HdnSelectedValues.value = document.Form1.HdnSelectedValues.value.replace("," + oChk.value,""); 
}
function removechild(delid)
{
	if ((document.Form1.HdnSelectedValues.value=="") && (delid==""))
	{
		alert('请勾选后再进行操作');
		return;
	}
	if (confirm('确定删除选定的收藏？'))
	{
		Init();
		if (delid=="") Typhoto.User_Favorite.DeleteAlbum(document.Form1.HdnSelectedValues.value,IsDel_callback);
		else Typhoto.User_Favorite.DeleteAlbum(","+delid,IsDel_callback);
	}
}
function Init()
{
	document.all.loading.style.top =Math.round((document.body.clientHeight-100)/2)+document.body.scrollTop-50;
	document.all.loading.style.left =Math.round((document.body.clientWidth-100)/2)-100;
	document.all.loading.style.display='';
}
function IsDel_callback(res)
{
	window.location='User_Favorite.aspx';
}
		</script>
	</HEAD>
	<body class="body_1" scroll="no">
<div id="loading" style=" display:none;POSITION: absolute; background-color:#FFFFAE; border-color:DBDCE3; border-style:solid; border-width:1px"><img src="images/loading.gif" width="32" height="32" align="absmiddle"> <b>正在处理，请稍候……</b></div>
		<form runat="server" id=Form1 name=Form1>
			<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td height="60"><uc1:uihead id="UIHead1" runat="server"></uc1:uihead></td>
				</tr>
				<tr>
					<td height="10"><uc1:uiframetop id="UIFrameTop1" runat="server"></uc1:uiframetop></td>
				</tr>
				<tr>
					<td>
						<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
							<tr>
								<td class="frame_left_1" vAlign="top" width="193"><uc1:uiframeleft id="UIFrameLeft1" runat="server"></uc1:uiframeleft></td>
								<td class="frame_body_1" vAlign="top">
									<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td height="32">&nbsp; <input name="button" type="button" class="button1" id="bDelete" onClick="removechild('')"
													value=" 删 除 "> &nbsp;排序：
												<asp:DropDownList id="sort" runat="server" AutoPostBack="True">
													<asp:ListItem Value="filename">按名称</asp:ListItem>
													<asp:ListItem Value="pl">按评论数</asp:ListItem>
													<asp:ListItem Value="click">按点击数</asp:ListItem>
													<asp:ListItem Value="dig">按投票数</asp:ListItem>
													<asp:ListItem Value="lasttime" Selected="True">按更新时间</asp:ListItem>
												</asp:DropDownList></td>
											<td height="32"><div align="right">
													<INPUT class="text1" id="key" type="text" name="Text1" runat="server"> &nbsp; <input class="button1" id="Button1" type="button" value=" 查 询 "
														name="bSearch" runat="server" onserverclick="Button1_ServerClick">
												</div>
											</td>
										</tr>
										<tr>
											<td class="main_title_1" height="32">
												<div style="TEXT-ALIGN: left">&nbsp; <IMG src="images/icon_album.gif" align="absMiddle">&nbsp; 
													我的收藏
												</div>
											</td>
											<td class="main_title_1"><div align="right"><a href="javascript:history.back();"><img src="images/link_back.gif" align="absMiddle"></a></div>
											</td>
										</tr>
										<tr>
											<td colspan="2" vAlign="top" class="main_content_1">
												<div class="main_content_2"><asp:datalist id="dPhotos" runat="server" Width="100%" cellspacing="3" cellpadding="0" RepeatColumns="2">
														<ItemStyle Width="50%"></ItemStyle>
														<ItemTemplate>
															<TABLE cellSpacing="1" cellPadding="3" width="100%" bgColor="#AAC1DE" border="0">
																<TR>
																	<TD width="120" align="center" valign="middle" bgColor="#ffffff">
																		<a href='Photo_Detail.aspx?PhotoID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'>
																			<img src='<%# tuurl(DataBinder.Eval(Container.DataItem, "alias").ToString()) %>' border="0" id="a<%# Container.ItemIndex + 1 %>"></a></TD>
																	<TD bgColor="#ffffff" valign="top">
																		<div style="width:100%;height:100px;line-height:18px;padding:3px;">
																			·<a href='Photo_Detail.aspx?PhotoID=<%# DataBinder.Eval(Container.DataItem, "ID") %>' class="link1">
																				<%# DataBinder.Eval(Container.DataItem, "FileName") %>
																			</a>
																			<br>
																			尺寸：<%# DataBinder.Eval(Container.DataItem, "width").ToString() %>×<%# DataBinder.Eval(Container.DataItem, "height").ToString() %><br>
																			大小：<%# showsize(DataBinder.Eval(Container.DataItem, "filesize").ToString()) %><br>
																			标签：<%# DataBinder.Eval(Container.DataItem, "tag") %><br>
																			所属用户：<a href='user_info.aspx?UserName=<%# DataBinder.Eval(Container.DataItem, "username") %>'><%# DataBinder.Eval(Container.DataItem, "username") %></a><br>
																			评论(<%# DataBinder.Eval(Container.DataItem, "pl") %>) 点击(<%# DataBinder.Eval(Container.DataItem, "click") %>) 
																			投票(<%# DataBinder.Eval(Container.DataItem, "dig") %>)&nbsp;<input name="Album" value='<%# DataBinder.Eval(Container.DataItem, "id") %>' type="checkbox" onClick="AddRemoveValues(this)"><a href="javascript:void(0)" onClick='removechild("<%# DataBinder.Eval(Container.DataItem, "id") %>");'><img src="Images/icon_delete.gif" width="12" height="12" border="0" align="absmiddle"
																					title="删除"></a>
																		</div>
																	</TD>
																</TR>
															</TABLE>
														</ItemTemplate>
													</asp:datalist></div>
											</td>
										</tr>
										<tr>
											<td colspan="2" vAlign="top" class="main_title_1"><table width="100%">
													<tr>
														<td><webdiyer:AspNetPager id="Pager" runat="server" PageSize="24" HorizontalAlign="Right" AlwaysShow="True"
																ShowCustomInfoSection="Left" NumericButtonCount="15" ShowBoxThreshold="21" FirstPageText="<font face=webdings>9</font>"
																PrevPageText="<font face=webdings>3</font>" NextPageText="<font face=webdings>4</font>" LastPageText="<font face=webdings>:</font>"
																Height="20px"></webdiyer:AspNetPager></td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table><INPUT id="HdnSelectedValues" type="hidden" name="HdnSelectedValues">
		</form>
	</body>
</HTML>
