{{ header }}
{{ column_left }}

<div id="content">
	<div class="page-header">
		<div class="container-fluid">
			<h1>{{ heading_title }}</h1>
			<ul class="breadcrumb">
		        {% for breadcrumb in breadcrumbs %}
		        	<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
		        {% endfor %}
	      	</ul>
		</div>
	</div><!-- end div .page-header -->
	<div id="page-content" class="container-fluid">
		{% if error_warning %}
	    <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
	      <button type="button" class="close" data-dismiss="alert">&times;</button>
	    </div>
	    {% endif %}

		{% if success and success != '' %}
		<div class="alert alert-success"><i class="fa fa-check-circle"></i> {{ success }}
			<button type="button" class="close" data-dismiss="alert">&times;</button>
		</div>
		{% endif %}

		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ heading_title }}</h3>
			</div>
			<div class="panel-body" >

				<div class="col-sm-3">
					<div class="logo"><h3>{{ heading_title }}</h3></div>
					<div class="slidebar">{% include '/extension/module/inspirenewsletter/toolbar.twig' %}</div>
					<div class="clear clr"></div>
				</div>

				<div class="col-sm-9">
					<div class="heading"><h3>{{ text_subscribes }}</h1></div>
					<div class="toolbar">{% include '/extension/module/inspirenewsletter/action_bar.twig' %}</div>
					<br/>
					<!-- ###################################### -->
					<div class="content">
						<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form">
						  <input type="hidden" name="action" id="action" value=""/>
						  <table class="table table-bordered table-hover">
							<thead>
							  <tr>
								<td class="left"><input class="form-control" type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);"></td>
								<td class="left">
									{% if sort == 'name' %}
								  	<a href="{{ sort_name }}" class="{{ order }}">{{ column_name }}</a>
								  	{% else %}
								  	<a href="{{ sort_name }}">{{ column_name }}</a>
								  	{% endif %}
								</td>
								<td class="left">
									{% if sort == 'email' %}
								  	<a href="{{ sort_email }}" class="{{ order }}">{{ column_email }}</a>
								  	{% else %}
								  	<a href="{{ sort_email }}">{{ column_email }}</a>
								  	{% endif %}
								</td>
								<td class="right">
									{% if sort == 'customer_group_id' %}
								  	<a href="{{ sort_customer_group_id }}" class="{{ order }}">{{ column_customer_group }}</a>
								  	{% else %}
								  	<a href="{{ sort_customer_group_id }}">{{ column_customer_group }}</a>
								  	{% endif %}
								</td>
								<td class="right">
									{% if sort == 's.action' %}
								  	<a href="{{ sort_subscribe }}" class="{{ order }}">{{ column_subscribe }}</a>
								  	{% else %}
								  	<a href="{{ sort_subscribe }}">{{ column_subscribe }}</a>
								  	{% endif %}
								</td>
								<td class="right">
									{% if sort == 's.store_id' %}
								  	<a href="{{ sort_store_id }}" class="{{ order }}">{{ column_store }}</a>
								 	{% else %}
								  	<a href="{{ sort_store_id }}">{{ column_store }}</a>
								  	{% endif %}
								</td>
								<td class="right">{{ column_action }}</td>
							  </tr>
							</thead>
							<tbody>
							  <tr class="filter">
								<td>&nbsp;</td>
								<td><input class="form-control" type="text" name="filter_name" value="{{ filter_name }}" /></td>
								<td><input class="form-control" type="text" name="filter_email" value="{{ filter_email }}" /></td>
								<td align="right">
									<select class="form-control" name="filter_customer_group_id">
									<option =""></option>
									{% if customer_groups is defined %}
										{% for key,val in customer_groups %}
										{% if key == filter_customer_group_id %} {% set selected = 'selected="selected"' %} {% endif %}
									  	<option value="{{ key }}" {{ selected }}>{{ val }}</option>
								  		{% endfor %}
								  	{% endif %}
									</select>
								</td>
								<td align="right">
									<select class="form-control" name="filter_action">
										<option value=""></option>
										{% if filter_action == '1' %}
										<option value="1" selected="selected">{{ text_yes }}</option>
										{% else %}
										<option value="1">{{ text_yes }}</option>
										{% endif %}
										{% if filter_action == '0' %}
										<option value="0" selected="selected">{{ text_no }}</option>
										{% else %}
										<option value="0">{{ text_no }}</option>
										{% endif %}
								  	</select>
								</td>
								<td align="right">
									<select class="form-control" name="filter_store_id">
										<option value=""></option>
										{% if stores is defined %}
										{% for key,val in stores %}
										{% if filter_store_id != '' and key == filter_store_id %} {% set selected = 'selected="selected"' %} {% endif %}
										<option value="{{ key }}" {{ selected }}>{{ val }}</option>
										{% endfor %}
									  	{% endif %}
								  	</select>
								</td>
								<td align="right"><a onclick="filter();" class="btn btn-warning">{{ button_filter }}</a></td>
							  </tr>
							  	{% if subscribes is defined %}
									{% for subsribe in subscribes %}
									<tr>
										<td><input type="checkbox" value="{{ subsribe.subscribe_id }}" name="selected[]"></td>
										<td class="left">{{ subsribe.name }}</td>
										<td class="left">{{ subsribe.email }}</td>
										<td class="left">{{ subsribe.customer_group }}</td>
										<td class="right">{{ subsribe.subscribe }}</td>
										<td class="right">{{ subsribe.store }}</td>
										<td class="right">
										{% for action in subsribe.action %}
									  		<a href="{{ action.href }}">{{ action.text }}</a>
									  	{% endfor %}
										</td>
									</tr>
									{% endfor %}
							  	{% else %}
								  	<tr>
										<td class="center" colspan="7">{{ text_no_results }}</td>
								  	</tr>
							  	{% endif %}
							</tbody>
						  </table>
						</form>
						<div class="pagination">{{ pagination }}</div>
					</div>
					<!-- ###################################### -->
				</div><!-- end div .col-sm-9 -->
			</div><!-- end div .panel-body -->
		</div><!-- end div .panel-default -->
	</div><!-- end div #page-content -->
</div><!-- end div #content -->

{{ footer }}