<!--<?php
require($this->getSegmentFile('dianpu.nav'));
$keyword = ($_viewer->keyword) ? stripslashes($_viewer->keyword) : '';
print <<<EOT
-->
<h2 class="h1">商品搜索</h2>
<div class="admin_table mb10">
	<form action="{$_viewer->baseUrl}&action=searchproduct" method="post" />
	<input type="hidden" name="step" value="2" />
	<table width="100%">
		<tr class="tr1">
			<td class="td2">
				<input name="act_title" type="text" class="input input_wa mr10" value="{$keyword}" />
				<label class="mr10"><input name="type" type="radio" value="1" {$_viewer->checked[1]} />店铺名</label>
				<label class="mr10"><input name="type" type="radio" value="2" {$_viewer->checked[2]} />商品名</label>
				<span class="btn2"><span><button type="submit">搜索</button></span></span>
			</td>
		</tr>
	</table>
	</form>
</div>
<h2 class="h1">商品列表</h2>
<div class="admin_table mb10">
<!--
EOT;
if($_viewer->products){
print <<<EOT
-->
	<form action="{$_viewer->baseUrl}&action=deleteproducts" method="post" name="FORM" onsubmit="return products.doConfirm();" />
	<input type="hidden" name="step" value="2" />
	<script type="text/javascript">
		var products = {
				doConfirm : function(url,id){
					if(confirm("你确定要删除吗?")){
						return true;
					}
					return false;
				},
				doDelete : function(url){
					if(this.doConfirm()){
						setTimeout(function(){
							window.location.href = url;
						},100);
					}
					return false;
				}
		};
	</script>
	<table width="100%">
		<tr class="tr2">
			<td width="60"><label><span onClick="CheckAll(document.FORM)" style = "cursor:pointer;">全选</span></label></td>
			<td>商品名称</td>
			<td>店铺</td>
			<td>上架时间</td>
			<td>市场价</td>
			<td>会员价</td>
			<td width="100">操作</td>
		</tr>
<!--
EOT;
foreach($_viewer->products as $product){
print <<<EOT
-->		
		<tr class="tr1">
			<td class="td2"><input name="products[]" type="checkbox" value="$product[productid]" /></td>
			<td class="td2"><a target="_blank" href="{$_viewer->indexUrl}&c=product&id={$product[objectid]}&productid={$product[productid]}&a=detail">$product[title]</a></td>
			<td class="td2"><a target="_blank" href="{$_viewer->indexUrl}&c=product&id={$product[objectid]}">$product[dianpu]</a></td>
			<td class="td2">$product[format_createdtime]</td>
			<td class="td2">$product[market_price]</td>
			<td class="td2">$product[member_price]</td>
			<td class="td2"><a target="_blank" href="{$_viewer->indexUrl}&c=pmanage&a=edit&dianpuid={$product[objectid]}&productid={$product[productid]}" class="mr10">编辑</a><a href="javascript:;" onclick="products.doDelete('{$_viewer->baseUrl}&action=deleteproduct&productid={$product[productid]}&dianpuid={$product[objectid]}');">删除</a></td>
		</tr>
<!--
EOT;
}
print <<<EOT
-->		
		<tr class="tr2">
			<td width="50"><input type="checkbox" onclick="PW.selectAll('products[]',this)"/><span onClick="CheckAll(document.FORM)" style = "cursor:pointer;"> 全选</span></td>
			<td><span class="bt2"><span><button type="submit">批量删除</button></span></span></td>
			<td colspan="6">&nbsp;</td>
		</tr>
	</table>
	</form>
	<div class="cc">{$_viewer->pager}</div>
<!--
EOT;
}else{
print <<<EOT
-->		
	<div class="admin_tips">啊哦，没有你要的信息！</div>
<!--
EOT;
}
print <<<EOT
-->	
</div>
<!--
EOT;
?>