{% extends '../template.html' %}
{% block title %}User{% endblock %}
{% block subcontent %}

	<h1>User</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 user_new %}" class="admin_new_btn" style>New</a><br/>
	
	{% if data.length > 0 %}		
	<table class="data" class="data">
		<tr>
				<th>id</th>
				<th>username</th>
				<th>password</th>
				<th>role</th>
				<th></th>
			</tr>
		{% for row in data %}
			<tr>
				<td>{{row.id}}</td>
				<td>{{row.username}}</td>
				<td>{{row.password}}</td>
				<td>{{row.role}}</td>
				<td>
				<a href="{% nav user_edit %}/{{ row.id }}">edit</a>
				<a onclick="return confirm('Apakah Anda Yakin ?');" href="{% nav user_del %}/{{ row.id }}">del</a></td>
			</tr>
		{% endfor %}
	</table>
	{% else %}
		User 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 %}
