<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--{include file=elements/header.css.html}-->
<!--{include file=elements/header.js.html type=common}-->
<!--{include file=elements/header.js.html type=popbox}-->
</head>
<body>
<div id="outside">
	<!--{include file=frame/top.html}-->
	<div id="mainareaContent">
		<!--{include file=frame/left.html}-->
		<div id="rightContent">
			<div id="topContent">
				<div class="sitmap">
					<span class="r"><!--{include file="elements/uuadvad.html"}--></span>模块管理&nbsp;&gt;&nbsp;软件模块&nbsp;&gt;&nbsp;内管管理
				</div>
			</div>
			<div class="tabcontent">
				<a href="index.php?r=Software.softwarelist" class="nolink">内管管理</a>
				<a href="index.php?r=SiteSet.softwareset" class="link">属性设置</a>
				<a href="index.php?r=Software.softwareListLayout" class="link">列表页布局</a>
					<a href="index.php?r=Software.softwarePageLayout" class="link">内容页布局</a>
			</div>
			<div id="secrightContent">
				<div class="tableContent3">
					<table class="tbl_leftnav" width="100%"><tr>
						<td class="td_channel"><div class="leftnav">
							<span class="ontitle">软件资源库</span>
							<span class="sectitle">频道分类</span>
							<!--{foreach from=$channel item=item name=channellist}-->
								<a href="index.php?r=Software.channelsoftwarelist&channel_id=<!--{$item.id}-->">[<!--{$item.id}-->]<!--{$item.channel_text}--></a>
							<!--{/foreach}-->
						</div></td>
						<td>
							<form name="searchForm" action="index.php" method="get" onSubmit="setDisabled('button', window.document);">
								<input type="hidden" name="r" value="Software.softwarelist"/>
								<input type="hidden" id="comment_flag" name="comment_flag" value="<!--{$comment_flag}-->"/>
								<input type="hidden" id="fee_type" name="fee_type" value="<!--{$fee_type}-->"/>
								<input type="hidden" id="recommend_level" name="recommend_level" value="<!--{$recommend_level}-->"/>
								<input type="hidden" id="publish_status" name="publish_status" value="<!--{$publish_status}-->"/>
								<input type="hidden" id="orderby" name="orderby" value="<!--{$orderby}-->"/>
								<div class="searchbar">
									软件名称&nbsp;<input type="text" class="text" name="title" value="<!--{$title}-->"/>
									&nbsp;厂商&nbsp;<input type="text" class="text" name="manufacturer" value="<!--{$manufacturer}-->"/>
									&nbsp;<button type="submit" class="but2font">查询</button>
								</div>
							</form>
							<div class="operation">
								<button type="button" class="but2font" onClick="window.location.href='index.php?r=Software.add&returnParams=<!--{$returnParams}-->'">新增</button>
								<button type="button" class="but2font" onClick="publish('<!--{$returnParams}-->')">发布</button>
								<button type="button" class="but2font" onClick="batchOperate('index.php?r=Software.deletechannelsoftware&returnParams=<!--{$returnParams}-->', 'recordId', 'software_ids', '确定下线？')">下线</button>
								<button type="button" class="but2font" onClick="batchOperate('index.php?r=Software.delete&returnParams=<!--{$returnParams}-->', 'recordId', 'ids', '确定删除？')">删除</button>
							</div>
							<table class="tbl_list" width="100%" cellpadding="0" cellspacing="0" border="0">
								<tr class="thead">
									<td width="5%"><input type="checkbox" class="checkall"/></td>
									<td width="5%">ID</td>
									<td width="15%">软件名称</td>
									<td width="12%">发布频道</td>
									<td width="10%"><select onChange="$('#publish_status').val(this.value);document.forms['searchForm'].submit();">
										<option value="">状态</option>
										<option value="1" <!--{if $publish_status eq 1}-->selected<!--{/if}-->>已发布</option>
										<option value="2" <!--{if $publish_status eq 2}-->selected<!--{/if}-->>未发布</option>
									</select></td>
									<td width="8%"><select onChange="$('#comment_flag').val(this.value);document.forms['searchForm'].submit();">
										<option value="">评论</option>
										<option value="1" <!--{if $comment_flag eq 1}-->selected<!--{/if}-->>开启</option>
										<option value="0" <!--{if $comment_flag eq '0'}-->selected<!--{/if}-->>关闭</option>
									</select></td>
									<td width="8%"><select onChange="$('#fee_type').val(this.value);document.forms['searchForm'].submit();">
										<option value="">资费</option>
										<option value="1" <!--{if $fee_type eq 1}-->selected<!--{/if}-->>免费</option>
										<option value="2" <!--{if $fee_type eq 2}-->selected<!--{/if}-->>收费</option>
										<option value="3" <!--{if $fee_type eq 3}-->selected<!--{/if}-->>其他</option>
									</select></td>
									<td width="7%"><select onChange="$('#recommend_level').val(this.value);document.forms['searchForm'].submit();">
										<option value="">等级</option>
										<option value="1" <!--{if $recommend_level eq 1}-->selected<!--{/if}-->>1</option>
										<option value="2" <!--{if $recommend_level eq 2}-->selected<!--{/if}-->>2</option>
										<option value="3" <!--{if $recommend_level eq 3}-->selected<!--{/if}-->>3</option>
										<option value="4" <!--{if $recommend_level eq 4}-->selected<!--{/if}-->>4</option>
										<option value="5" <!--{if $recommend_level eq 5}-->selected<!--{/if}-->>5</option>
									</select></td>
									<td width="10%">
										<!--{if $orderby eq down_count0}-->
										<a class="link" onClick="$('#orderby').val('down_count1');document.forms['searchForm'].submit();">下载↑</a><!--{elseif $orderby eq down_count1}--><a class="link" onClick="$('#orderby').val('down_count0');document.forms['searchForm'].submit();">下载↓</a><!--{else}--><a class="link" onClick="$('#orderby').val('down_count0');document.forms['searchForm'].submit();">下载</a><!--{/if}-->/<!--{if $orderby eq click_count0}--><a class="link" onClick="$('#orderby').val('click_count1');document.forms['searchForm'].submit();">人气↑</a><!--{elseif $orderby eq click_count1}--><a class="link" onClick="$('#orderby').val('click_count0');document.forms['searchForm'].submit();">人气↓</a><!--{else}--><a class="link" onClick="$('#orderby').val('click_count0');document.forms['searchForm'].submit();">人气</a><!--{/if}-->
									</td>
									<td width="10%">
										<!--{if $orderby eq create_date0}-->
										<a class="link" onClick="$('#orderby').val('create_date1');document.forms['searchForm'].submit();">创建时间↑</a>
										<!--{elseif $orderby eq create_date1}-->
										<a class="link" onClick="$('#orderby').val('create_date0');document.forms['searchForm'].submit();">创建时间↓</a>
										<!--{else}-->
										<a class="link" onClick="$('#orderby').val('create_date0');document.forms['searchForm'].submit();">创建时间</a><!--{/if}-->
									</td>
									<td width="10%">操作</td>
								</tr>
								<!--{foreach from=$datalist item=item name=list}-->
								<tr onMouseOver="chgTrColor(this)" onMouseOut="chgTrColor(this)">
									<td><input type="checkbox" class="checkid" name="recordId" value="<!--{$item.id}-->"/></td>
									<td><!--{$item.id}--></td>
									<td class="left"><!--{if $item.top_flag eq 1}-->[顶]<!--{/if}--><a href="index.php?r=Software.edit&id=<!--{$item.id}-->&returnParams=<!--{$returnParams}-->"><!--{$item.title}--></a></td>
									<td class="left"><!--{$item.channel_text}--></td>
									<td><!--{if $item.publish_status eq 1}-->已发布<!--{elseif $item.publish_status eq 2}-->未发布<!--{/if}--></td>
									<td><!--{if $item.comment_flag eq 1}-->开启<!--{elseif $item.comment_flag eq 0}-->关闭<!--{/if}--></td>
									<td>
										<!--{if $item.fee_type eq 1}-->免费
										<!--{elseif $item.fee_type eq 2}-->收费
										<!--{elseif $item.fee_type eq 3}-->其他<!--{/if}-->
									</td>
									<td>
										<!--{if $item.recommend_level eq 1}-->1
										<!--{elseif $item.recommend_level eq 2}-->2
										<!--{elseif $item.recommend_level eq 3}-->3
										<!--{elseif $item.recommend_level eq 4}-->4
										<!--{elseif $item.recommend_level eq 5}-->5<!--{/if}-->
									</td>
									<td><!--{$item.down_count}-->/<!--{$item.click_count}--></td>
									<td><!--{$item.create_date|date_format:"%Y-%m-%d"}--></td>
									<td><a href="index.php?r=Software.edit&id=<!--{$item.id}-->&returnParams=<!--{$returnParams}-->">修改</a>
										<a href="index.php?r=Software.packagelist&software_id=<!--{$item.id}-->&backFlag=1&returnParams=<!--{$returnParams}-->">软件包</a></td>
								</tr>
								<!--{foreachelse}-->
								<tr><td colspan="11">没有对应数据</td></tr>
								<!--{/foreach}-->
							</table>
							<div class="operation">
								<button type="button" class="but2font" onClick="window.location.href='index.php?r=Software.add&returnParams=<!--{$returnParams}-->'">新增</button>
								<button type="button" class="but2font" onClick="publish('<!--{$returnParams}-->')">发布</button>
								<button type="button" class="but2font" onClick="batchOperate('index.php?r=Software.deletechannelsoftware&returnParams=<!--{$returnParams}-->', 'recordId', 'software_ids', '确定下线？')">下线</button>
								<button type="button" class="but2font" onClick="batchOperate('index.php?r=Software.delete&returnParams=<!--{$returnParams}-->', 'recordId', 'ids', '确定删除？')">删除</button>
							</div>
							<div class="page"><!--{$pager}--></div>
						</td>
					</tr></table>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script>
function publish(returnParams){
	var item = $("[name=recordId]");
	var id = "";
	if (item.size() > 0) {
		item.each(function(){
			if ($(this).attr("checked") == true) {
				id += $(this).val();
				id += ",";
			}
		});
	}
	id = id.substr(0, id.lastIndexOf(","));
	if (id == "") {
		alert("请选择记录");
		return false;
	} else {
		$.popbox({title:"软件发布", content:popstr_search});
		$.ajax({
			type: "get",
			url: "index.php?r=Software.publish&id="+id+"&returnParams="+returnParams,
			cache: false,
			success: function(data){
				$.popbox.setcontent({title:"软件发布", content:data});
			}
		});
	}
}
</script>
</html>