<div class="breadcrumbs" id="breadcrumbs">
	<ul class="breadcrumb">
		<li>
			<i class="home-icon fa fa-home"></i>
			<a href="#">会员</a>
		</li>
		<li>
			<a href="#">信息处理</a>
		</li>
		<li class="active">营销短信</li>
	</ul>
</div>
<form action="{url:/message/marketing_sms_del}" method="post" name="marketing_sms_list" onsubmit="return checkboxCheck('check[]','尚未选中任何记录！')">
<div class="content">
	<table id="list_table" class="table list-table">
		<colgroup>
			<col width="35px" />
			<col />
			<col width="120px" />
			<col width="300px" />
			<col width="100px" />
		</colgroup>
		<caption>
            <a class="btn btn-default" onclick="sendMarketingSms()">
                <i class="fa fa-send"></i>发送短信
            </a>
            <a class="btn btn-default" onclick="selectAll('check[]')">
                <i class="fa fa-check"></i>全选
            </a>
            <a class="btn btn-default" onclick="delModel({'form':'marketing_sms_list',msg:'确定要删除选中的记录吗？'})">
                <i class="fa fa-close"></i>批量删除
            </a>
		</caption>
		<thead>
			<tr>
				<th></th>
				<th>接收条件</th>
				<th>发送成功数</th>
				<th>时间</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody>
            {set:$queryObj=Api::run('getListByMarketing');$resultData=$queryObj->find()}
            {foreach:items=$resultData}
			<tr>
				<td><input name="check[]" type="checkbox" value="{$item['id']}" /></td>
				<td>{$item['rev_info']}</td>
				<td>{$item['send_nums']}</td>
				<td>{$item['time']}</td>
				<td>
					<a href="{url:/message/marketing_sms_show/id/$item['id']}"><i class='operator fa fa-eye'></i></a>
					<a onclick="delModel({link:'{url:/message/marketing_sms_del/check/$item['id']}'})"><i class='operator fa fa-close'></i></a>
				</td>
			</tr>
			{/foreach}
		</tbody>
	</table>
</div>
{$queryObj->getPageBar()}
</form>

<script language="javascript">
//发送营销短信
function sendMarketingSms()
{
	art.dialog.open('{url:/message/marketing_sms_send}',{
		'id':'sendWindow',
		'title':'营销短信',
		'width':'790px',
		'ok':function(iframeWin, topWin)
		{
			var iframeObj = $(iframeWin.document);
			iframeObj.find('form').submit();
	    	return false;
		}
	});
}

//发送营销短信后回调
function startMarketingSmsCallback(msg)
{
	if(msg == 'success')
	{
		tips('发送营销短信成功');
		setTimeout(function(){
			window.location.reload();
		},1200);
	}
	else
	{
		alert(msg);
	}
	art.dialog({'id':'sendWindow'}).close();
}
</script>