<!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 newphone(){
	$.popbox({title:"新增手机机型", content:popstr_search});
	$.post("index.php?r=MobileSet.addphone", function(str){
		$.popbox.setcontent({title:"新增手机机型", content:str, height:350});
	});
}

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

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

		$.ajax({url:"./index.php", 
			data:{r:"MobileSet.deletephone",
				  id:id
				  },
			cache:false,
			type:"GET",
			dataType:"json",
			success:function(data){
				if(data.flag == 1){
					window.location = 'index.php?'+returnParams;
				}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="nolink">手机机型</a>
				<a href="index.php?r=MobileSet.brand" class="link">手机品牌</a>
				<a href="index.php?r=MobileSet.screen" class="link">屏幕大小</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.phone"/>
						<input type="hidden" name="brandId" id="brandId" value="<!--{$brandId}-->"/>
						<input type="hidden" name="platformId" id="platformId" value="<!--{$platformId}-->"/>
						<input type="hidden" name="serialId" id="serialId" value="<!--{$serialId}-->"/>
						<input type="hidden" name="screenId" id="screenId" value="<!--{$screenId}-->"/>
						<input type="hidden" id="sort" name="sort" value="<!--{$sort}-->"/>
						<div class="searchbar">
							手机机型&nbsp;<input type="text" class="text" name="search_agent" value="<!--{$search_agent}-->"/>
							&nbsp;<button type="submit" class="but2font">查询</button>
						</div>
					</form>
					<div class="operation"><button type="button" class="butAdd" onClick="newphone()">新增</button></div>
					<table class="tbl_list" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr class="thead">
							<td width="10%">手机机型</td>
							<td width="13%"><select id="brandIdSelect" onChange="document.getElementById('brandId').value=this.value;document.forms['searchForm'].submit();">
								<option value="">手机品牌</option>
								<!--{foreach from=$brands item=brand}-->
								<!--{if $brandId == $brand.id}-->
								<option value="<!--{$brand.id}-->" selected="selected"><!--{$brand.brand_name}--></option>
								<!--{else}-->
								<option value="<!--{$brand.id}-->"><!--{$brand.brand_name}--></option>
								<!--{/if}-->
								<!--{/foreach}-->
							</select></td>
							<td width="13%"><select id="platformIdSelect" onChange="document.getElementById('platformId').value=this.value;document.forms['searchForm'].submit();">
								<option value="">软件平台</option>
								<!--{foreach from=$platforms item=platform}-->
								<!--{if $platformId == $platform.id}-->
								<option value="<!--{$platform.id}-->" selected="selected"><!--{$platform.platform_name}--></option>
								<!--{else}-->
								<option value="<!--{$platform.id}-->"><!--{$platform.platform_name}--></option>
								<!--{/if}-->
								<!--{/foreach}-->
							</select></td>
							<td width="16%"><select id="screenIdSelect" onChange="document.getElementById('screenId').value=this.value;document.forms['searchForm'].submit();">
								<option value="">手机屏幕</option>
								<!--{foreach from=$screens item=screen}-->
								<!--{if $screenId == $screen.id}-->
								<option value="<!--{$screen.id}-->" selected="selected"><!--{$screen.screen_size}--></option>
								<!--{else}-->
								<option value="<!--{$screen.id}-->"><!--{$screen.screen_size}--></option>
								<!--{/if}-->
								<!--{/foreach}-->
							</select></td>
							<td width="13%"><select id="serialIdSelect" onChange="document.getElementById('serialId').value=this.value;document.forms['searchForm'].submit();">
								<option value="">游戏系列</option>
								<!--{foreach from=$serials item=serial}-->
								<!--{if $serialId == $serial.id}-->
								<option value="<!--{$serial.id}-->" selected="selected"><!--{$serial.serial}--></option>
								<!--{else}-->
								<option value="<!--{$serial.id}-->"><!--{$serial.serial}--></option>
								<!--{/if}-->
								<!--{/foreach}-->
							</select></td>
							<td width="10%"><!--{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>
							<td width="15%">操作</td>
						</tr>
						<!--{foreach from=$data item=data name=foo}-->
						<tr onMouseOver="chgTrColor(this)" onMouseOut="chgTrColor(this)">
							<td><!--{$data.agent}--></td>
							<td><!--{$data.brand_name}--></td>
							<td><!--{$data.platform_name}--></td>
							<td><!--{$data.screen_size}--></td>
							<td><!--{$data.serial}--></td>
							<td><!--{$data.show_order}--></td>
							<td><!--{if $data.hot_flag == 1}-->是<!--{else}-->否<!--{/if}--></td>
							<td><a href="javascript:editphone(<!--{$data.id}-->, '<!--{$returnParams}-->')">修改</a>&nbsp;<a href="javascript:deletephone(<!--{$data.id}-->, '<!--{$returnParams}-->')">删除</a></td>
						</tr>
						<!--{foreachelse}-->
						<tr><td colspan="9">没有对应数据</td></tr>
						<!--{/foreach}-->			
					</table>
					<div class="operation"><button type="button" class="butAdd" onClick="newphone()">新增</button></div>
					<div class="page"><!--{$pager}--></div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>