{% extends '../template.html' %}
{% block title %}Store{% endblock %}
{% block subcontent %}
	<h1>Store</h1>
	<form method="get">
		<b>Search: <input type="text" id="find" name="find" value="{{find}}"/></b>
		<input type="submit" value="Go"/>
	</form>
	<a href="{% nav store_new %}" class="admin_new_btn">New</a><br/>
	
	{% if data.length > 0 %}		
	<table class="data">
		<tr>
				<th>Kode</th>
				<th>Nama</th>
				<th>Alamat</th>
				<th>Telepon</th>
				<th>Status</th>
				<th>Kategori</th>
				<th></th>
			</tr>
		{% for row in data %}
			<tr class="stores">
				<td>{{row.kode}}</td>
				<td>{{row.nama}}</td>
				<td>{{row.alamat}}</td>
				<td>{{row.telepon}}</td>
				<td><div class="status_{{row.status}}">{% if row.status == "av" %}Available{% else %} Not Available {% endif %}</div></td>
				<td>{{row.kategori_menu}}</td>
				<td>
				<a href="{% nav store_edit %}/{{ row.id }}">edit</a>
				<a onclick="return confirm('Apakah Anda Yakin ?');" href="{% nav store_del %}/{{ row.id }}">del</a></td>
			</tr>
		{% endfor %}
	</table>
	{% else %}
		Store is empty, klik new button bellow to make one.<br/>
	{% endif %}
	
	{% for p in page %}
	<a href="{{ p.link }}" class="{% if p.active == 'yes' %}active{% endif %} page">{{ p.number }}</a>
	{% endfor %}
	
{% endblock %}
