<%@Page Language="C#" Inherits="IWMS.Admin.Article" MasterPageFile="admin.master"%>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
	<script type="text/javascript" src="inc/admin_articleadd.js"></script>
	<script type="text/javascript">
	<%BtDelete.Attributes["onclick"] = "return confirm_batch_delete()";%>
	<!--
	iwms.fixNews="<%=fixNews.ClientID%>";
	
	/// 显隐缩略图
	function DispTbn()
	{
		var cb = document.getElementById("cb_tbn");
		var os = document.getElementsByTagName("SPAN");
		for(var i=0; i<os.length; i++){
			if (os[i].id.indexOf("tbn_")==0){
				if (os[i].title.length==0 || os[i].title.lastIndexOf(".swf")>0){
					continue;
				}
				if ((os[i].style.display=="")==cb.checked){
					break;
				}
				os[i].style.display = cb.checked ? "" : "none";
				if (cb.checked && os[i].childNodes.length==0){
					var img = document.createElement("IMG");
					img.src = os[i].title;
					img.align = "absmiddle";
					img.hspace = "3";
					img.width = 120;
					os[i].appendChild(img);
				}
			}
		}
		iwms.cookie("iwms_admin_thumb", cb.checked ? "1" : "0");
	}
	-->
	</script>
</asp:Content>

<asp:Content ContentPlaceHolderId="cphMain" runat="server">

	<div class="tabs">
		<a href="?" class="<%=(Request.QueryString["where"]==null && Request.QueryString["type"]==null) ? "tab_on" : "tab_off"%>">管理新闻</a>
		<a href="?where=memberid&amp;keyword=<%=CurUser.UserID%>" class="<%=(Request.QueryString["where"]=="memberid" && Request.QueryString["keyword"]==CurUser.UserID.ToString()) ? "tab_on" : "tab_off"%>">我添加的内容</a>
		<a href="?type=fix" class="<%=Request.QueryString["type"]=="fix" ? "tab_on" : "tab_off"%>">管理固顶头条</a>
		<a href="?type=img" class="<%=Request.QueryString["type"]=="img" ? "tab_on" : "tab_off"%>">管理图片新闻</a>
	</div>
	<div class="mframe">
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
		<asp:Label id="myLabel" class="msgBar" EnableViewState="false" runat="server"/>
		<table width="98%" cellpadding="0" cellspacing="0" style="line-height:30px"><tr><td>
			<input type="checkbox" id="cb_tbn"  onclick="DispTbn();" /><label for="cb_tbn">显示缩略图</label>
			&nbsp; <asp:Literal id="dropClass" runat="server"/>
		</td><td align="right">
			<form action="" method="get">
			<input type="text" size="15" name="keyword"/>
			<select name="where" >
				<option value="title">标题</option>
				<option value="content">内容</option>
				<option value="id">ID</option>
				<option value="memberid">会员ID</option>
			</select>
			<input type="submit" value="搜索"/>
			</form>
			
		</td>
		</tr></table>

		<form id="myForm" runat="server">
			<asp:ValidationSummary 
				 DisplayMode="BulletList" 
				 EnableClientScript="true"
				 ShowSummary="false"
				 ShowMessageBox="true"                        
				 HeaderText="请正确填写以下内容"
				 runat="server"/>
		<ASP:DataGrid id="MyDataGrid" runat="server"
				Width="100%"
				ShowHeader="true"
				ShowFooter="false"
				AutoGenerateColumns="false"
				DataKeyField="articleid"
				CssClass="grid"
				BorderColor="#cccccc"
				HeaderStyle-CssClass="gridHead"
				ItemStyle-CssClass="tdbg"
				PageSize="15"
				align="center"
				CellPadding="6"
				CellSpacing="0" >
			
			<Columns>
				<asp:TemplateColumn
					HeaderText="ID"
				>
					<ItemTemplate>
					<span style="font-size:9px;font-family:arial"><%#Eval("articleid")%></span>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="40"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="<input type=&quot;checkbox&quot; onclick=&quot;checkFormAll(this)&quot;/>"
					>
					<ItemTemplate>
					<asp:CheckBox id="chk" runat="server"/>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center"/>
					<HeaderStyle Width="20"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="新闻标题(点击修改)"
				>
					<ItemTemplate>
					<span id="tbn_<%#Container.ItemIndex+1%>" style="display:none;float:right" title="<%#Eval("titleimg")%>"></span>
					<%#TitleUrl((System.Data.DataRowView)Container.DataItem) %>
					</ItemTemplate>
				</asp:TemplateColumn>
				<asp:BoundColumn
					HeaderText="日期"
					DataField="dateandtime"
					DataFormatString="{0:yyyy-MM-dd}"
					 >
					<ItemStyle HorizontalAlign="center"  />
					<HeaderStyle Width="70"/>
				</asp:BoundColumn>
				<asp:HyperLinkColumn
					HeaderText="分类"
					DataTextField="class"
					DataNavigateUrlField="classid"
					DataNavigateUrlFormatString="?cid={0}"
					 >
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="80"/>
				</asp:HyperLinkColumn>
				<asp:BoundColumn
					HeaderText="阅读"
					DataField="hits"
					DataFormatString="{0:D}"
					 >
					<ItemStyle HorizontalAlign="right"  />
					<HeaderStyle Width="45"/>
				</asp:BoundColumn>
				<asp:TemplateColumn
					HeaderText=""
					>
					<ItemTemplate>
					<a href="admin_remark.aspx?id=<%#Eval("articleid")%>" title="<%#Eval("remarkNum")%>" target="_self">评论</a>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="40"/>
				</asp:TemplateColumn>
			</Columns>
		</ASP:DataGrid>
		
		<table width="100%" align="center"><tr><td>
		<asp:Literal id="PageList" runat="server"/>
		</td></tr>
		<tr><td>
			<asp:Button id="BtDelete" Text="删除" OnClick="BtDelete_OnClick" runat="server"/>
			&nbsp; &nbsp; &nbsp;
			<asp:Button id="btUnpass" Text="转为待审" OnClick="btUnpass_OnClick" runat="server"/>
			&nbsp; &nbsp; &nbsp;
		</td><td>
			转移到分类 	<asp:DropDownList id="toSort" runat="server"/>
				<script type="text/javascript">
				function setOptionColor()
				{
					var obj=document.getElementById("<%=toSort.ClientID%>");
					// 无值项变色
					for (var i=obj.options.length-1;i>=0;i--)
					{
						if (obj.options[i].value==""){
							obj.options[i].style.color="gray";
							obj.options[i].value="0";
						}
					}
				}
				setOptionColor();
				</script>
			<asp:Button id="btMove" Text="转移" OnClick="btMove_OnClick" runat="server"/>
		
		</td></tr>
		<tr><td>
			<%if (CurUser.HavePower("setTop")){%>
			[<a href="javascript:OpenFix();" style="text-decoration:underline">头条与固顶</a>]
			<%}%>
			<input type="hidden" id="fixNews" runat="server"/>
			<asp:Button id="btSetFix" Text="设置" OnClick="btSetFix_OnClick" runat="server"/>
		</td><td>
			合并新闻id
			<asp:TextBox id="joinID1" size="6" Style="text-align:right" Text="0" maxLength="8" runat="server"/>
			<asp:RequiredFieldValidator
				ControlToValidate="joinID1"
				ErrorMessage="要合并新闻id必填"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				ControlToValidate="joinID1"
				ValidationExpression="\d{1,8}"
				ErrorMessage="要合并新闻id只能为数字"
				Display="None"
				runat="server"/>
			被合并新闻id
			<asp:TextBox id="joinID2" size="6" Style="text-align:right" Text="0"  maxLength="8" runat="server"/>
			<asp:RequiredFieldValidator
				ControlToValidate="joinID2"
				ErrorMessage="被合并新闻id必填"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				ControlToValidate="joinID2"
				ValidationExpression="\d{1,8}"
				ErrorMessage="被合并新闻id只能为数字"
				Display="None"
				runat="server"/>
			<asp:Button id="btJoin" Text="合并" OnClick="btJoin_OnClick" runat="server"/>
		</td></tr>
		<tr><td colspan="2" height="45" valign="bottom">
		注：<img src="pic/canedit.gif" alt=""/>为有权管理文章 &nbsp; <img src="pic/cantedit.gif" alt=""/>为无权管理文章 &nbsp;
		<img src="pic/canedit_soft.gif" alt=""/>为有权管理下载 &nbsp; <img src="pic/cantedit_soft.gif" alt=""/>为无权管理下载 &nbsp;
		分类后“▽”表示类型为下载<br/>
		　　<img src="pic/admin_img.gif" alt=""/>为图片新闻 &nbsp; <img src="pic/admin_lock.gif" alt=""/>为限制阅读新闻 &nbsp; <img src="pic/admin_headline.gif" alt=""/>为头条新闻 &nbsp; <img src="pic/admin_oImg.gif" alt=""/>为有站外图片
		</td></tr></table>
		
		</form>
		
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>
	
	
	
	
	<script type="text/javascript">
		if (iwms.cookie("iwms_admin_thumb")=="1"){
			var o = document.getElementById("cb_tbn");
			o.checked = true;
			DispTbn();
		}
	</script>
</asp:Content>