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

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

<?php include(SABLE_INCLUDES_PATH.'googleMaps.php'); ?>

<!--// Client -->
<form id="frmClient" name="frmClient" 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 Client</h3>
					<p></p>
				</div>
			</div>
			<!--// edtClientName -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtClientName" type="text" id="edtClientName" onfocus="showHint('edtClientName'); validate_edtClientName();" onblur="hideHint('edtClientName');" placeholder="Name" onkeypress="handleEnter(this, event);" >	
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientName">Name</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientName //-->
			<p></p>
			<!--// edtClientSurname -->
			<div class="row forms-grid" style="display:none;">
				<div class="col-md-4 forms-grid">
					<input name="edtClientSurname" type="text" id="edtClientSurname" onfocus="showHint('edtClientSurname'); validate_edtClientSurname();" onblur="hideHint('edtClientSurname');" placeholder="Surname" onkeypress="handleEnter(this, event);" >	
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientSurname">Surname</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientSurname //-->
			<p></p>
			<!--// txtAddressId -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
			<textarea name="txtAddressId" type="textarea" id="txtAddressId" 
onfocus="showHint('txtAddressId');" onblur="hideHint('txtAddressId'); validate_txtAddressId()"
 placeholder="Address"	
 onChange="updateMapData();" ></textarea>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_txtAddressId">Address</div>
				</div>
			</div>
			<p></p>
			<!-- txtAddressId //-->
			<div class="row forms-grids">
				<div class="col-md-12 forms-grid">
					<div id="searchResults"></div>
				</div>
			</div>
			<p></p>
			<!--// edtClientCell -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtClientCell" type="text" id="edtClientCell" onfocus="showHint('edtClientCell'); validate_edtClientCell();" onblur="hideHint('edtClientCell');" placeholder="Cell No." onkeypress="handleEnter(this, event);" >	
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientCell">Cell No.</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientCell //-->
			<p></p>
			<!--// edtClientPhone -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtClientPhone" type="text" id="edtClientPhone" onfocus="showHint('edtClientPhone'); validate_edtClientPhone();" onblur="hideHint('edtClientPhone');" placeholder="Phone No." onkeypress="handleEnter(this, event);" >	
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientPhone">Phone No.</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientPhone //-->
			<p></p>
			<!--// edtClientEmail -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtClientEmail" type="email" id="edtClientEmail" onfocus="showHint('edtClientEmail'); validate_edtClientEmail();" onblur="hideHint('edtClientEmail');" placeholder="Email" onkeypress="handleEnter(this, event);" >	
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientEmail">Email</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientEmail //-->
			<p></p>
		<!--// 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('/client/'); ?>'"/>
				</div>
				<div class="col-md-2 forms-grid">
					<input id="btnOk" type="button" onclick="insertClient();" value="Add Client" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		<?php include(SABLE_INCLUDES_PATH.'googleMapsDisplay.php'); ?>
		</div>
	</div>
</form>
<!-- Client //-->
