<?php
	include("service_func.php");
	$hddnServiceId = $_SESSION['caller']['args'][1];
	if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER)
	{
		SableGeneralFunctions::divertFromPage();
	}

?>
<script src="<?php SableGeneralFunctions::printModuleJS('service'); ?>"></script>

<!--// Service -->
<form id="frmService" name="frmService" autocomplete="on">
	<div class="forms">
		<div class="container forms-grids">
			<div class="row forms-grid">
				<div class="col-md-12">
					<h3 class="title"><i class="fa fa-plus" aria-hidden="true"></i>&nbsp;Add Service</h3>
					<p></p>
				</div>
			</div>
			<p></p>
			<!--// edtServiceName -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtServiceName" type="text" id="edtServiceName" onfocus="showHint('edtServiceName'); validate_edtServiceName();" onblur="hideHint('edtServiceName');" placeholder="Service" onkeypress="handleEnter(this, event);" >	
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtServiceName">Service</div>
				</div>
			</div>
			<p></p>
			<!-- edtServiceName //-->
			<p></p>
			<!--// edtServiceDuration -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtServiceDuration" type="number" id="edtServiceDuration" class="mod"  onfocus="showHint('edtServiceDuration'); validate_edtServiceDuration();" onblur="hideHint('edtServiceDuration');" placeholder="Duration" onkeypress="handleEnter(this, event);" >	
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtServiceDuration">Duration</div>
				</div>
			</div>
			<p></p>
			<!-- edtServiceDuration //-->
			<p></p>
			<!--// edtServicePrice -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtServicePrice" type="number" id="edtServicePrice" class="mod"  onfocus="showHint('edtServicePrice'); validate_edtServicePrice();" onblur="hideHint('edtServicePrice');" placeholder="Price" onkeypress="handleEnter(this, event);" >	
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtServicePrice">Price</div>
				</div>
			</div>
			<p></p>
			<!-- edtServicePrice //-->
			<p></p>
			
			<!--// edtAreaName -->
			<div class="row forms-grids">
				<div class="col-md-4 forms-grid">
					<input type="text" id="edtAreaName" name="edtAreaName" placeholder="SEARCH..." onKeyUp="doAreaRefinement(this)" style="border-bottom: none;" autocomplete="off"/>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAreaName">Search by area</div>
				</div>   
			</div>
			<!-- edtAreaName //-->				
			<!--// selAreaId -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<div class="dropdown">
						<select name="selAreaId" type="select" id="selAreaId" onfocus="showHint('selAreaId');" 
								onblur="hideHint('selAreaId'); validate_selAreaId()" onkeypress="handleEnter(this, event)" placeholder="Area" size="6" class="noArrow" onClick="setAreaName()" onChange="areaItem.addItem(this);">
						<?php echo(SableDBFunctions::getOptions("area", "area_id", "area_name", -1)); ?>
						</select>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selAreaId">Area</div>
				</div>
			</div>

			<div class="row forms-grid">
				<div id="AreaElement">
					<!--// Selected elements will be placed here. -->
				</div>
			</div>
			<p></p>
			<!-- selAreaId //-->			
			
		<!--// buttons -->
			<div class="row forms-grid">
				<div class="col-md-2">
					<input type="button" id="btnCancel" value="Cancel"
					class="submit" onclick="window.location = '<?php SableSystem::printCallPageLink('/service/'); ?>'"/>
				</div>
				<div class="col-md-2 forms-grid">
					<input id="btnOk" type="button" onclick="insertService();" value="Add Service" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Service //-->
