<!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}-->
<!--{include file=elements/header.js.html type=valid}-->
<script>
function newscreen(){
	$.popbox({title:"新增手机屏幕", content:popstr_search});
	$.post("index.php?r=MobileSet.addscreen", function(str){
		$.popbox.setcontent({title:"新增手机屏幕", content:str});
	});
}

function editscreen(id, returnParams){
	$.popbox({title:"修改手机屏幕", content:popstr_search});
	$.post("index.php?r=MobileSet.editscreen", {id: id, returnParams: returnParams}, function(str){
		$.popbox.setcontent({title:"修改手机屏幕", content:str});
	});
}

function deletescreen(id, returnParams){
	if(confirm("删除之后，信息无法恢复，是否确定删除？")){
		$.popbox({title:"删除手机屏幕", content:popstr_delete, height:100});

		$.ajax({url:"./index.php", 
			data:{r:"MobileSet.deletescreen",
				  id:id
				  },
			cache:false,
			type:"GET",
			dataType:"json",
			success:function(data){
				if(data.flag == 1){
					window.location = 'index.php?'+returnParams;
				} else if(data.flag == -1){
					var str = "<table height=\"100%\" width=\"100%\"><tr><td align=\"center\">屏幕 <b>"+data.screen.screen_size+"</b> 下已存在游戏资源，不能删除！</td></tr></table>"
					$.popbox({title:"删除手机屏幕", content:str, height:100});
				} else if(data.flag == -2){
					var str = "<table height=\"100%\" width=\"100%\"><tr><td align=\"center\">屏幕 <b>"+data.screen.screen_size+"</b> 下已存在软件资源，不能删除！</td></tr></table>"
					$.popbox({title:"删除手机屏幕", content:str, height:100});
				} else if(data.flag == -3){
					var str = "<table height=\"100%\" width=\"100%\"><tr><td align=\"center\">屏幕 <b>"+data.screen.screen_size+"</b> 下已存在主题资源，不能删除！</td></tr></table>"
					$.popbox({title:"删除手机屏幕", content:str, height:100});
				} else {
					var str = "<table height=\"100%\" width=\"100%\"><tr><td align=\"center\">屏幕删除失败！</td></tr></table>"
					$.popbox({title:"删除手机屏幕", content:str, height:100});
				}
			}
		});
	}
}
</script>
</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=MobileSet.phone" class="link">手机机型</a>
				<a href="index.php?r=MobileSet.brand" class="link">手机品牌</a>
				<a href="index.php?r=MobileSet.screen" class="nolink">屏幕大小</a>
				<a href="index.php?r=MobileSet.platform" class="link">软件平台</a>
				<a href="index.php?r=MobileSet.serial" class="link">游戏系列</a>
			</div>
			<div id="secrightContent">
				<div class="tableContent2">
					<form name="searchForm" action="index.php" onSubmit="setDisabled(':button',window.document);">
						<input type="hidden" name="r" value="MobileSet.screen"/>
						<input type="hidden" id="sort" name="sort" value="<!--{$sort}-->"/>
						<div class="searchbar">
							屏幕大小&nbsp;<input type="text" class="text" name="search_screen_size" value="<!--{$search_screen_size}-->"/>
							&nbsp;<button type="submit" class="but2font">查询</button>
						</div>
					</form>
					<div class="operation"><button type="button" class="butAdd" onClick="newscreen()">新增</button></div>
					<table class="tbl_list" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr class="thead">
							<td width="60%">屏幕大小</td>
							<td width="30%"><!--{if $sort == 1}--><a class="link" onClick="$('#sort').val(2);document.forms['searchForm'].submit();">排列顺序↓</a><!--{elseif $sort == 2}--><a class="link" onClick="$('#sort').val(1);document.forms['searchForm'].submit();">排列顺序↑</a><!--{else}--><a class="link" onClick="$('#sort').val(2);document.forms['searchForm'].submit();">排列顺序</a><!--{/if}--></td>
							<td width="10%">操作</td>
						</tr>
						<!--{foreach from=$data item=data }-->
						<tr onMouseOver="chgTrColor(this)" onMouseOut="chgTrColor(this)">
							<td><!--{$data.screen_size}--></td>
							<td><!--{$data.show_order}--></td>
							<td><a href="javascript:editscreen(<!--{$data.id}-->, '<!--{$returnParams}-->')">修改</a>&nbsp;<a href="javascript:deletescreen(<!--{$data.id}-->, '<!--{$returnParams}-->')">删除</a></td>
						</tr>
						<!--{foreachelse}-->
						<tr><td colspan="4">没有对应数据</td></tr>
						<!--{/foreach}-->			
					</table>
					<div class="operation"><button type="button" class="butAdd" onClick="newscreen()">新增</button></div>
					<div class="page"><!--{$pager}--></div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>