{% extends '../template.html' %}
{% block title %}Edit Store{% endblock %}
{% block subcontent %}
		{% if session.flash.error != "" %}
			{{ session.flash.error | safe }}
		{% endif %}
		{% if session.flash.info != "" %}
			<div class="info">{{ session.flash.info | safe }}</div>
		{% endif %}
		
		<h1>Edit Store</h1>
		<form method="post">
			<table class="data" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td>Kode</td>
					<td><input type="text" name="kode" value="{{ data.kode }}"/></td>
				</tr>
				<tr>
					<td>Nama</td>
					<td><input type="text" name="nama" value="{{ data.nama }}" style="width:350px;"/></td>
				</tr>
				<tr>
					<td>Alamat</td>
					<td><textarea name="alamat" style="width:350px;">{{ data.alamat }}</textarea></td>
				</tr>
				<tr>
					<td>Telepon</td>
					<td><input type="text" name="telepon" value="{{ data.telepon }}"/></td>
				</tr>
				<tr>
					<td>Status</td>
					<td>
						<select name="status">
							<option value="av" {% if data.status == "av"%}selected="selected"{%endif%}>Available</option>
							<option value="na" {% if data.status == "na"%}selected="selected"{%endif%}>Not Available</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>Kategori menu</td>
					<td>
						<select name="kategori_menu" id="">
							{% for k in kategori_menu %}
							<option {% if k == data.kategori_menu %}selected="selected"{% endif %} value="{{k}}">{{ k }}</option>
							{% endfor %}
						</select>
					
					</td>
				</tr>
				<tr>
					<td>Jam Buka</td>
					<td><input type="text" name="jam_buka" value="{{ data.jam_buka }}"/></td>
				</tr>
				<tr>
					<td>Jam Tutup</td>
					<td><input type="text" name="jam_tutup" value="{{ data.jam_tutup }}"/></td>
				</tr>
			</table>
			<br/><input type="submit" value="Submit" /> <a href="{% nav store %}">Cancel</a>
		</form>
		
		<hr/>
		<h2>Store Shift</h2>
		
		<small style="border:1px solid red;display:block;padding:10px;width:220px; float:right;margin-right:50px;">
		<b>PERINGATAN: <br/><br/>RESET SHIFT AKAN MENGGANTI SHIFT STORE INI DENGAN DATA YANG ADA DI MASTER SHIFT</b>
		<hr/>
		<a href="{% nav store_edit_shift_reset %}?ids={{data.id}}" class="admin_new_btn" style="width:200px;display:inline-block;background:red;font-size:14px;">Reset Shift Untuk Store Ini</a>
		</small>
		<form method="post" action="{% nav store_edit_shift %}?ids={{data.id}}">
		<input type="submit" value="Simpan Shift"/><br/><br/>
		<table class='data'>
			<tr>
				<th>Shift</th>
				<th>Jam Masuk</th>
				<th>Jam Keluar</th>
				<th></th>
			</tr>
			{% for s in shift %}
			
			<tr>
				<td>
				{{s.shift}}
				<input type="hidden" name="id[]" value="{{s.id}}"/>
				</td>
				<td><input name="jam_masuk[]" type="jam_masuk" value="{{s.jam_masuk}}" style="width:50px;"/></td>
				<td><input name="jam_keluar[]" type="jam_keluar" value="{{s.jam_keluar}}" style="width:50px;" /></td>
				<td><a href="{% nav store_edit_shift_del %}{{s.id}}?ids={{data.id}}" onclick="return confirm('Apakah Anda Yakin ?');">del</a></td>
			</tr>
			{% endfor %}
		</table><br/>
		<input type="submit" value="Simpan Shift"/>
		</form>
		<br/><br/>
{% endblock %}
