{js:my97date}
<div class="breadcrumbs" id="breadcrumbs">
	<ul class="breadcrumb">
		<li>
			<i class="home-icon fa fa-home"></i>
			<a href="#">会员</a>
		</li>
		<li>
			<a href="{url:/comment/refer_list}">咨询管理</a>
		</li>
		<li class="active">咨询信息列表</li>
	</ul>
</div>
<div class="content">
	<table class="table list-table">
		<colgroup>
			<col width="35px" />
			<col />
			<col width="100px" />
			<col width="120px" />
			<col width="120px" />
			<col width="120px" />
			<col width="110px" />
		</colgroup>

		<caption>
            <a class="btn btn-default" onclick="selectAll('check[]')">
                <i class="fa fa-check"></i>全选
            </a>
            <a class="btn btn-default" onclick="delModel({'form':'refer_list',msg:'确定要删除选中的记录吗？'})">
                <i class="fa fa-close"></i>批量删除
            </a>
			<form class="form-inline pull-right" name="filter_form" method="get" action="{url:/}">
				<input type='hidden' name='controller' value='comment' />
				<input type='hidden' name='action' value='refer_list' />
                <div class="input-group">
                    <span class="input-group-addon">咨询人</span>
                    <input class="form-control" name="search[u.username=]"  type="text" value=""/>
                </div>

                <div class="input-group">
                    <span class="input-group-addon">咨询商品ID</span>
                    <input class="form-control" name="search[goods.id=]"  type="text" value=""/>
                </div>

                <div class="input-group">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    <input class="form-control" name="search[r.time>=]"  type="text" value="" onfocus="WdatePicker()" placeholder="开始时间" />
                </div>

                <div class="input-group">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    <input class="form-control" name="search[r.time<=]"  type="text" value="" onfocus="WdatePicker()" placeholder="截止时间" />
                </div>

                <button class="btn btn-default" type="submit">
                    <i class="fa fa-search"></i> 筛选
                </button>
			</form>
		</caption>
		<thead>
			<tr>
				<th></th>
				<th>咨询商品</th>
				<th>咨询人</th>
				<th>咨询时间</th>
				<th>最后回复人</th>
				<th>回复时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<form action="{url:/comment/refer_del}" method="post" name="refer_list" onsubmit="return checkboxCheck('check[]','尚未选中任何记录！')">

			<tbody>
                {foreach:items=$this->query->find()}
				<tr>
					<td><input name="check[]" type="checkbox" value="{$item['id']}" /></td>
					<td><a title="{$item['goods_name']}" href="{url:/site/products/id/$item['goods_id']}" target='_blank'>{$item['goods_name']}</a></td>
					<td>{if:isset($item['username'])}{$item['username']}{else:}非会员{/if}</td>
					<td>{$item['time']}</td>
					<td>{if:$item['admin_name']}{$item['admin_name']}{elseif:$item['seller_name']}{$item['seller_name']}{/if}</td>
					<td>{if:$item['reply_time']>0}{$item['reply_time']}{else:}未回复{/if}</td>
					<td>
						<a href="{url:/comment/refer_edit/id/$item['id']}"><i class='operator fa fa-edit'></i></a>
						<a href="javascript:delModel({link:'{url:/comment/refer_del/check/$item['id']}'})"><i class='operator fa fa-close'></i></a>
					</td>
				</tr>
				{/foreach}
			</tbody>
		</form>
	</table>
</div>
{$this->query->getPageBar()}

<script type="text/javascript">
$(function()
{
	var searchData = {echo:JSON::encode(IReq::get('search'))};
	for(var index in searchData)
	{
		$('[name="search['+index+']"]').val(searchData[index]);
	}
})
</script>