<form class="master-form" action="{{ site_url('adm/services/save') }}" method="POST">

	<div class="modal-header">
		<h5 class="modal-title">{{ content_title }}</h5>
		<button type="button" class="close" data-dismiss="modal" aria-label="Close">
			<span aria-hidden="true">&times;</span>
		</button>
	</div>

	<div class="modal-body">
		<input class="form-control" name="id" value="{{ id }}" type="hidden">

		<div class="row">
			<div class="col-md-12">
				<div class="form-group">
					<label class="control-label">Kode</label>
					<input type="text" class="form-control" id="namecheck" name="code" tabindex="1" placeholder="SC1"
						value="{{ check_array_key(get_data, 'cs_code') }}" required="required">
				</div>
			</div>
			<div class="col-md-12">
				<div class="form-group">
					<label class="control-label">Nama Layanan</label>
					<input type="text" class="form-control" name="name" tabindex="2" placeholder="Massage Therapy (2 Hours Package)"
						value="{{ check_array_key(get_data, 'cs_name') }}" required="required">
				</div>
			</div>
			<div class="col-md-12">
				<div class="form-group">
					<label class="control-label">Grup</label>
					<select class="form-control select2" name="group" tabindex="3">
						<option value="">- Pilih -</option>
						{% if group_data %}
						{% for group_row in group_data %}
						<option value="{{ group_row.cs_group_id }}"
							{% if same(group_row.cs_group_id, check_array_key(get_data, 'cs_group_id')) %}
							selected="selected" {% endif %}>{{ group_row.cs_group_parent_name }} ({{ group_row.cs_group_name }})</option>
						{% endfor %}
						{% endif %}
					</select>
				</div>
			</div>
			<div class="col-md-12">
				<div class="form-group">
					<label class="control-label">Harga</label>
					<input type="text" class="form-control currency-mask text-left" name="price" tabindex="4" placeholder="175,000"
						value="{{ price }}" required="required">
				</div>
			</div>
		</div>
	</div>


	<div class="modal-footer">
		<button type="button" class="btn btn-default waves-effect master-cancel" data-dismiss="modal">Batal</button>

		<div class="btn-group" role="group">
	        <button name="action" value="save" class="btn btn-primary btn-save" type="submit">
	        	Simpan
	        </button>
	        <button type="button" class="btn btn-primary btn-save dropdown-toggle" data-toggle="dropdown"
	        	aria-haspopup="true" aria-expanded="false">
	        </button>
			<div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
				<!-- <a class="dropdown-item" href="#">Dropdown link</a> -->
				<button class="dropdown-item" name="action" value="save_new" type="submit" href="#">Simpan &amp; Baru</button>
				<button class="dropdown-item" name="action" value="save_close" type="submit" href="#">Simpan &amp; Tutup</button>
			</div>
		</div>
	</div>

</form>

<script type="text/javascript">

	var elDivID = "#namecheck";
	var elResult = ".result_check";
	var elUrl = "{{ site_url('adm/services/check_id') }}";
	var elBtn = ".btn-save";

	window.FORM.handleCheckField2(elDivID, elResult, elUrl, elBtn, "", "");
	window.INPUT.handleSelect2();
	window.INPUT.handleMaskCurrency();

</script>
