<?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);" >

					<label for="edtClientName" class="fieldHint hintUnder" id="hint_edtClientName">Name</label>

				</div>

				<div class="col-md-8">

				</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);" >	

					<label for="edtClientSurname" class="fieldHint hintUnder" id="hint_edtClientSurname">Surname</label>

				</div>

				<div class="col-md-8">



				</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>

					<label for="txtAddressId" class="fieldHint hintUnder" id="hint_txtAddressId">Address</label>

				</div>

				<div class="col-md-4 forms-grid">

					<textarea name="txtAddressNote" type="date" id="txtAddressNote" onfocus="showHint('txtAddressNote'); validate_txtAddressNote();" onblur="hideHint('txtAddressNote');" placeholder="Address Note" onkeypress="handleEnter(this, event);" ></textarea>

					<label for="txtAddressNote" class="fieldHint hintUnder" id="hint_txtAddressNote">Address Note</label>

				</div>

				<div class="col-md-4 forms-grid"></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">

				<div class="col-md-4 forms-grid" style="padding:0;">

					<div class="col-md-12">

						<input name="edtClientCell" type="text" id="edtClientCell" onfocus="showHint('edtClientCell'); validate_edtClientCell();" onblur="hideHint('edtClientCell');" placeholder="Cell No." onkeypress="handleEnter(this, event);" >

						<label for="edtClientCell" class="fieldHint hintUnder" id="hint_edtClientCell">Cell No.</label>

					</div>

					<div class="col-md-12">

						<input name="edtClientPhone" type="text" id="edtClientPhone" onfocus="showHint('edtClientPhone'); validate_edtClientPhone();" onblur="hideHint('edtClientPhone');" placeholder="Phone No." onkeypress="handleEnter(this, event);" >	

						<label for="edtClientPhone" class="fieldHint hintUnder" id="hint_edtClientPhone">Phone No.</label>

					</div>				

					<div class="col-md-12">

						<input name="edtClientEmail" type="email" id="edtClientEmail" onfocus="showHint('edtClientEmail'); validate_edtClientEmail();" onblur="hideHint('edtClientEmail');" placeholder="Email" onkeypress="handleEnter(this, event);" >

						<label for="edtClientEmail" class="fieldHint hintUnder" id="hint_edtClientEmail">Email</label>

					</div>

				</div>

				<div class="col-md-4 forms-grid">

					<textarea name="txtClientNote" type="date" id="txtClientNote" style="height:13.5em;" onfocus="showHint('txtClientNote'); validate_txtClientNote();" onblur="hideHint('txtClientNote');" placeholder="Booking Notes" onkeypress="handleEnter(this, event);" ></textarea>

					<label for="txtClientNote" class="fieldHint hintUnder" id="hint_txtClientNote">Booking Notes</label>

				</div>				

			</div>

			<p></p>

			<!-- edtClientCell //-->

			<p></p>

			<!--// edtClientPhone -->

			<div class="row forms-grid">



			</div>

			<p></p>

			<!-- edtClientPhone //-->

			<p></p>

			<!--// edtClientEmail -->

			<div class="row forms-grid">



			</div>

			<p></p>

			<!-- edtClientEmail //-->

			<p></p>

			

			<div class="row forms-grid">

				<div class="col-md-12">

					<p></p>

					<h2><i class="fa fa-dog" aria-hidden="true"></i>&nbsp;Buildings</h2>

				</div>

			</div>			

			

			

			<!--// 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()">

						<?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>

			<p></p>

			<!-- selAreaId //-->

			<p></p>

			<!--// edtBuildingName -->

			<div class="row forms-grid">

				<div class="col-md-4 forms-grid">

					<input name="edtBuildingName" type="text" id="edtBuildingName" onfocus="showHint('edtBuildingName'); validate_edtBuildingName();" onblur="hideHint('edtBuildingName');" placeholder="Building Name" onkeypress="handleEnter(this, event);" >	

				</div>

				<div class="col-md-8">

					<div class="fieldHint" id="hint_edtBuildingName">Building Name</div>

				</div>

			</div>

			<p></p>

			<!-- edtBuildingName //-->

			<p></p>

			<!--// edtBuildingNotes -->

			<div class="row forms-grid">

				<div class="col-md-4 forms-grid">

					<input name="edtBuildingNotes" type="date" id="edtBuildingNotes" onfocus="showHint('edtBuildingNotes'); validate_edtBuildingNotes();" onblur="hideHint('edtBuildingNotes');" placeholder="Building Notes" onkeypress="handleEnter(this, event);" >	

				</div>

				<div class="col-md-8">

					<div class="fieldHint" id="hint_edtBuildingNotes">Building Notes</div>

				</div>

			</div>

			<p></p>

			<!-- edtBuildingNotes //-->

			<p></p>

			<!--// txtBuildingNeeds -->

			<div class="row forms-grid">

				<div class="col-md-4 forms-grid">

					<textarea name="txtBuildingNeeds" type="date" id="txtBuildingNeeds" onfocus="showHint('txtBuildingNeeds'); validate_txtBuildingNeeds();" onblur="hideHint('txtBuildingNeeds');" placeholder="Requirements/Special Needs" onkeypress="handleEnter(this, event);" ></textarea>	

				</div>

				<div class="col-md-8">

					<div class="fieldHint" id="hint_txtBuildingNeeds">Requirements/Special Needs</div>

				</div>

			</div>

			<p></p>

			<!-- txtBuildingNeeds //-->

			<p></p>	

			

		<!--// buttons -->

			<div class="row forms-grid">

				<div class="col-md-2">



				</div>

				<div class="col-md-2 forms-grid">

					<input id="btnOk" type="button" onclick="addBuilding();" value="Add Building" class="submit"/>

				</div>

			</div>

		<!-- buttons //-->

			

			<div class="row forms-grid">

				<div id="buildingElement">

					<!--// Selected elements will be placed here. -->

				</div>

				<p></p>

			</div>

			

			<div class="row forms-grid">

				<div class="col-md-2"><p></p></div>

			</div>			

			

		<!--// 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 //-->

