<!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=Game.resource" class="nolink">内管管理</a>
				<a href="index.php?r=SiteSet.gameset" class="link">属性设置</a>
				<a href="index.php?r=Game.gameListLayout" class="link">列表页布局</a>
					<a href="index.php?r=Game.gamePageLayout" 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=$channels item=channel}-->
								<a href="index.php?r=Game.channel&channel_id=<!--{$channel.id}-->">[<!--{$channel.id}-->]<!--{$channel.channel_text}--></a>
							<!--{/foreach}-->
						</div></td>
						<td>
							<form name="searchForm" action="index.php" onSubmit="setDisabled(':button',window.document);">
								<input type="hidden" name="r" value="Game.resource"/>
								<input type="hidden" name="recommend_level" id="recommend_level" value="<!--{$recommend_level}-->"/>
								<input type="hidden" name="fee_type" id="fee_type" value="<!--{$fee_type}-->"/>
								<input type="hidden" name="comment_flag" id="comment_flag" value="<!--{$comment_flag}-->"/>
								<input type="hidden" name="orderby" id="orderby" value="<!--{$orderby}-->"/>
								<input type="hidden" name="publish_status" id="publish_status" value="<!--{$publish_status}-->"/>
								<div class="searchbar">
									游戏名称&nbsp;<input type="text" class="text" name="game_title" value="<!--{$game_title}-->"/>
									&nbsp;厂商&nbsp;<input type="text" class="text" name="game_manufacturer" value="<!--{$game_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=Game.addgameinfo&returnParams=<!--{$returnParams}-->'">新增</button>
								<button type="button" class="but2font" onClick="publishgame('recordId','<!--{$returnParams}-->')">发布</button>
								<button type="button" class="but2font" onClick="batchOperate('index.php?r=Game.gameoffline&returnParams=<!--{$returnParams}-->', 'recordId', 'gameids', '是否确认下线所选游戏？')">下线</button>
								<button type="button" class="but2font" onClick="batchOperate('index.php?r=Game.deletegame&returnParams=<!--{$returnParams}-->', 'recordId', 'ids', '删除之后，信息无法恢复，是否确定删除？')">删除</button>
							</div>
							<table class="tbl_list" cellpadding="0" cellspacing="0" border="0" width="100%">
								<tr class="thead">
									<td width="5%"><input type="checkbox" class="checkall"/></td>
									<td width="5%">ID</td>
									<td width="15%">游戏名称</td>
									<td width="10%">发布频道</td>
									<td width="11%">
										<select onChange="document.getElementById('publish_status').value=this.value;document.forms['searchForm'].submit();">
										<option value="">状态</option>
										<option value="1" <!--{if $publish_status == 1}-->selected="selected"<!--{/if}-->>已发布</option>
										<option value="2" <!--{if $publish_status == 2}-->selected="selected"<!--{/if}-->>未发布</option>
										</select>
									</td>
									<td width="8%">
										<select onChange="document.getElementById('comment_flag').value=this.value;document.forms['searchForm'].submit();">
											<option value="">评论</option>
											<option value="1" <!--{if $comment_flag == 1}-->selected="selected"<!--{/if}-->>开启</option>
											<option value="0" <!--{if $comment_flag == '0'}-->selected="selected"<!--{/if}-->>关闭</option>
										</select>
									</td>
									<td width="8%">
										<select onChange="document.getElementById('fee_type').value=this.value;document.forms['searchForm'].submit();">
										<option value="">资费</option>
										<option value="1" <!--{if $fee_type == 1}-->selected="selected"<!--{/if}-->>免费</option>
										<option value="2" <!--{if $fee_type == 2}-->selected="selected"<!--{/if}-->>收费</option>
										<option value="3" <!--{if $fee_type == 3}-->selected="selected"<!--{/if}-->>其他</option>
										</select>
									</td>
									<td width="8%">
										<select onChange="document.getElementById('recommend_level').value=this.value;document.forms['searchForm'].submit();">
											<option value="">等级</option>
											<option value="1" <!--{if $recommend_level == 1}-->selected="selected"<!--{/if}-->>1</option>
											<option value="2" <!--{if $recommend_level == 2}-->selected="selected"<!--{/if}-->>2</option>
											<option value="3" <!--{if $recommend_level == 3}-->selected="selected"<!--{/if}-->>3</option>
											<option value="4" <!--{if $recommend_level == 4}-->selected="selected"<!--{/if}-->>4</option>
											<option value="5" <!--{if $recommend_level == 5}-->selected="selected"<!--{/if}-->>5</option>
										</select>
									</td>
									<td width="10%">
									<!--{if $orderby == null}--><a class="link" onClick="document.getElementById('orderby').value=3;document.forms['searchForm'].submit();">下载</a><!--{elseif $orderby == 3}--><a class="link" onClick="document.getElementById('orderby').value=4;document.forms['searchForm'].submit();">下载</a>↓<!--{elseif $orderby == 4}--><a class="link" onClick="document.getElementById('orderby').value=3;document.forms['searchForm'].submit();">下载</a>↑<!--{else}--><a class="link" onClick="document.getElementById('orderby').value=3;document.forms['searchForm'].submit();">下载</a><!--{/if}-->/<!--{if $orderby == null}--><a class="link" onClick="document.getElementById('orderby').value=1;document.forms['searchForm'].submit();">人气</a><!--{elseif $orderby == 1}--><a class="link" onClick="document.getElementById('orderby').value=2;document.forms['searchForm'].submit();">人气</a>↓<!--{elseif $orderby == 2}--><a class="link" onClick="document.getElementById('orderby').value=1;document.forms['searchForm'].submit();">人气</a>↑<!--{else}--><a class="link" onClick="document.getElementById('orderby').value=1;document.forms['searchForm'].submit();">人气</a><!--{/if}-->
									</td>
									<td width="10%"><!--{if $orderby == null}--><a class="link" onClick="document.getElementById('orderby').value=5;document.forms['searchForm'].submit();">创建时间</a>↓<!--{elseif $orderby == 5}--><a class="link" onClick="document.getElementById('orderby').value='';document.forms['searchForm'].submit();">创建时间</a>↑<!--{else}--><a class="link" onClick="document.getElementById('orderby').value='';document.forms['searchForm'].submit();">创建时间</a><!--{/if}--></td>
									<td width="10%">操作</td>
								</tr>
								<!--{foreach from=$data item=data name=foo}-->
								<tr onMouseOver="chgTrColor(this)" onMouseOut="chgTrColor(this)">
									<td><input type="checkbox" class="checkid" name="recordId" value="<!--{$data.id}-->"/></td>
									<td><!--{$data.id}--></td>
									<td class="left"><a href="index.php?r=Game.editgameinfo&id=<!--{$data.id}-->&returnParams=<!--{$returnParams}-->"><!--{$data.title}--></a></td>
									<td><!--{$data.channel_text}--></td>
									<td><!--{if $data.publish_status == 1}-->已发布<!--{elseif $data.publish_status == 2}-->未发布<!--{/if}--></td>
									<td><!--{if $data.comment_flag == 1}-->开启<!--{elseif $data.comment_flag == 0}-->关闭<!--{/if}--></td>
									<td><!--{if $data.fee_type == 1}-->免费<!--{elseif $data.fee_type == 2}-->收费<!--{elseif $data.fee_type == 3}-->其他<!--{/if}--></td>
									<td><!--{$data.recommend_level}--></td>
									<td><!--{$data.down_count}-->/<!--{$data.click_count}--></td>
									<td><!--{$data.create_date|date_format:"%Y-%m-%d"}--></td>
									<td><a href="index.php?r=Game.editgameinfo&id=<!--{$data.id}-->&returnParams=<!--{$returnParams}-->">修改</a>&nbsp;<a href="index.php?r=Game.editgamepackage&id=<!--{$data.id}-->&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=Game.addgameinfo&returnParams=<!--{$returnParams}-->'">新增</button>
								<button type="button" class="but2font" onClick="publishgame('recordId','<!--{$returnParams}-->')">发布</button>
								<button type="button" class="but2font" onClick="batchOperate('index.php?r=Game.gameoffline&returnParams=<!--{$returnParams}-->', 'recordId', 'gameids', '是否确认下线所选游戏？')">下线</button>
								<button type="button" class="but2font" onClick="batchOperate('index.php?r=Game.deletegame&returnParams=<!--{$returnParams}-->', 'recordId', 'ids', '删除之后，信息无法恢复，是否确定删除？')">删除</button>
							</div>
							<div class="page"><!--{$pager}--></div>
						</td>
					</tr></table>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script>
function publishgame(itemName,returnParams){
	var item = $("[name="+itemName+"]");
	var ids = "";
	if (item.size() > 0) {
		item.each(function(){
			if ($(this).attr("checked") == true) {
				ids += $(this).val();
				ids += ",";
			}
		});
	}
	ids = ids.substr(0, ids.lastIndexOf(","));
	if (ids == "") {
		alert("请选择记录");
		return false;
	} else {
		$.popbox({title:"游戏发布", content:popstr_search});
		$.post("index.php?r=Game.publishgame", {returnParams:returnParams, ids:ids}, function(data){
			$.popbox.setcontent({title:"游戏发布", content:data});
		});
	}
}
</script>
</html>