<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>
<div class="content">
	<form method='post' action='#' name='searchForm'>
		<input type='hidden' name='ticket_id' value='{$this->ticket_id}' />
		<table class="table list-table">
			<colgroup>
				<col width="35px" />
				<col width="90px" />
				<col width="90px" />
				<col width="110px" />
				<col width="330px" />
				<col width="70px" />
				<col width="70px" />
				<col width="70px" />
				<col />
			</colgroup>
			<caption>
                <a class="btn btn-default" href='{url:/market/ticket_list}'>
                    <i class="fa fa-reply"></i>优惠券列表
                </a>
                <a class="btn btn-default" onclick="selectAll('id[]')">
                    <i class="fa fa-check"></i>全选
                </a>
                <a class="btn btn-default" onclick="delModel({msg:'是否修改删除？',form:'searchForm',link:'{url:/market/ticket_more_del}'});">
                    <i class="fa fa-close"></i>批量删除
                </a>
                <a class="btn btn-default" onclick="delModel({msg:'是否修改发放状态？',form:'searchForm',link:'{url:/market/ticket_status/status/is_send}'});">
                    <i class="fa fa-share-square-o"></i>批量发放
                </a>
                <a class="btn btn-default" onclick="delModel({msg:'是否修改禁用状态？',link:'{url:/market/ticket_status/status/is_close}',form:'searchForm'});">
                    <i class="fa fa-minus-circle"></i>批量禁用
                </a>
			</caption>
			<thead>
				<tr>
					<th></th>
					<th>卡号</th>
					<th>密码</th>
					<th>面值</th>
					<th>有效期</th>
					<th>已被使用</th>
					<th>是否发放</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>

			<tbody>
				{set:$queryObj=Api::run('getListByProp',array('ticket_id'=>$this->ticket_id));$resultData=$queryObj->find()}
                {foreach:items=$resultData}
				<tr>
					<td><input type='checkbox' name='id[]' value='{$item['id']}' /></td>
					<td>{$item['card_name']}</td>
					<td>{$item['card_pwd']}</td>
					<td>{$item['value']} 元</td>
					<td>{$item['start_time']} ～ {$item['end_time']}</td>
					<td>{if:$item['is_userd']==1}<span class="text-green">是</span>{else:}<span class="text-red">否</span>{/if}</td>
					<td>{if:$item['is_send']==1}<span class="text-green">是</span>{else:}<span class="text-red">否</span>{/if}</td>
					<td>
						{if:$item['is_close'] == 1}
						<span class="text-red">禁用</span>
						{elseif:$item['is_close'] == 2}
						<span class="text-primary">被占用</span>
						{else:}
						<span class="text-green">正常</span>
						{/if}
					</td>
					<td>
						<a href='{url:/market/ticket_status/ticket_id/$this->ticket_id/status/is_close/id/$item['id']}' title="修改禁用状态">
							<i class='operator fa fa-minus-circle'></i>
						</a>

						<a href='{url:/market/ticket_status/ticket_id/$this->ticket_id/status/is_send/id/$item['id']}' title="修改发放状态">
							<i class='operator fa fa-share-square-o'></i>
						</a>

						<a href="javascript:delModel({link:'{url:/market/ticket_more_del/ticket_id/$this->ticket_id/id/$item['id']}'});" title="删除">
							<i class='operator fa fa-close'></i>
						</a>
					</td>
				</tr>
				{/foreach}
			</tbody>
		</table>
	</form>
</div>
{$queryObj->getPageBar()}