<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/datatables/css/DT_bootstrap.css') }}">
<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/datatables/css/datatables.responsive.css') }}">

<!--Begin Datatables-->
<div class="row">
<div class="col-lg-12">
<div class="box">
<header>
	<div class="icons">
		<i class="fa fa-table"></i>
	</div>
	<h5>{{ @lang_ads }}</h5>
</header>
<div id="collapse4" class="body">
<table id="dataTable" class="table table-bordered table-condensed table-hover table-striped">
<thead>
<tr>
	<th data-class="expand">{{ @lang_ad }}</th>
	<th data-hide="phone">{{ @lang_status }}</th>
	<th data-hide="phone,tablet">{{ @lang_last_updated }}</th>
	<th data-hide="phone">{{ @lang_ad_groups }}</th>
	<th data-hide="phone">{{ @lang_advertiser }}</th>
	<th data-hide="phone">{{ @lang_impressions }}</th>
	<th data-hide="phone">{{ @lang_clicks }}</th>
	<th>{{ @lang_commands }}</th>
</tr>
</thead>
<tbody>
<repeat group="{{ @res_ads }}" value="{{ @res_ad }}">
<tr data-id="{{ @res_ad.id }}">
	<td>{{ @res_ad.title | raw }} <i class="fa {{ @res_ad.type }}"></i>{{ @res_ad.img | raw }}</td>
	<td>
		<span class="label label-{{ @res_ad.status_type }}">{{ @res_ad.status_text }}</span>
	</td>
	<td>{{ @res_ad.last_updated }}</td>
	<td>
		<check if ="{{ @res_ad.groups }}">
			<true>
				<repeat group="{{ @res_ad.groups }}" value="{{ @res_group }}">
					<i class="fa fa-caret-right"></i> <a href="index.php?groups&edit&{{ @res_group->_id }}" title="Edit">{{ @res_group->title }}</a><br />
				</repeat>
			</true>
			<false>
				-
			</false>
		</check>
	</td>
	<td>{{ @res_ad.advertiser | raw }}</td>
	<td>{{ @res_ad.impressions }}</td>
	<td>{{ @res_ad.clicks }}</td>
	<td><a class="preview" href="#" title="{{ @lang_preview }}" data-toggle="modal" data-target="#previewModal" data-id="{{ @res_ad.id}}"><i class="fontsize15 fa fa-search"></i> </a><a class="delete" href="index.php?ads&delete&{{ @res_ad.id}}" title="{{ @lang_delete }}" data-toggle="modal" data-target="#deleteModal" data-id="{{ @res_ad.id}}"><i class="fontsize15 fa fa-times"></i> </a><a class="edit" href="index.php?ads&edit&{{ @res_ad.id}}" title="{{ @lang_edit }}"><i class="fontsize15 fa fa-pencil"></i></a> <a class="code" href="index.php?ads&code&{{ @res_ad.id}}" title="{{ @lang_ad_code }}"><i class="fontsize15 fa fa-cloud-upload"></i></a></td>
</tr>
</repeat>

</tbody>
</table>
</div>
</div>
</div>
</div><!-- /.row -->

<!--End Datatables-->


<!-- Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="{{ @lang_delete }}" aria-hidden="true" data-id="" data-row="">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="deleteModalLabel">{{ @lang_delete }}</h4>
			</div>
			<div class="modal-body">
				{{ @lang_are_you_sure_you_want_to_delete_it }}?
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">{{ @lang_cancel }}</button>
				<button type="button" class="btn btn-danger" id="delete">{{ @lang_delete }}</button>
			</div>
		</div>
	</div>
</div>

<!-- Preview Modal -->
<div class="modal fade" id="previewModal"  tabindex="-1" role="dialog" aria-labelledby="{{ @lang_preview }}" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content" id="previewModalContent">
		</div>
	</div>
</div>
