<?php
include("client_func.php");
$hddnClientId = $_SESSION['caller']['args'][1];
if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER)
{
	SableGeneralFunctions::divertFromPage();
}
$row = $sableDB->getRow("select * from client where client_id = {$hddnClientId}");
?>
<script src="<?= SableGeneralFunctions::printModuleJS('client') ?>"></script>

<!--// Client -->
<form id="frmClient" name="frmClient" autocomplete="on">
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnClientId)); ?>" id="hddnClientId" name="hddnClientId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnIdTypeId)); ?>" id="hddnIdTypeId" name="hddnIdTypeId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnClientTypeId)); ?>" id="hddnClientTypeId" name="hddnClientTypeId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnAddressId)); ?>" id="hddnAddressId" name="hddnAddressId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnGenderId)); ?>" id="hddnGenderId" name="hddnGenderId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnClientParentId)); ?>" id="hddnClientParentId" name="hddnClientParentId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnRewardLevelId)); ?>" id="hddnRewardLevelId" name="hddnRewardLevelId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnClientDeleted)); ?>" id="hddnClientDeleted" name="hddnClientDeleted" />
	<div class="forms">
		<div class="container forms-grids">
			<div class="row">
				<div class="col-md-12">
					<h3 class="title"><i class="fa fa-edit" aria-hidden="true"></i>&nbsp;Modify Client</h3>
					<p></p>
				</div>
			</div>
			<!--// edtClientName -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientName" type="text" id="edtClientName" onfocus="showHint('edtClientName');" onchange="validate_edtClientName();" onblur="hideHint('edtClientName'); validate_edtClientName();" placeholder="Client Name" onkeypress="handleEnter(this, event);" value="<?= ($row['client_name']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientName">Client Name</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientName //-->
			<p></p>
			<!--// edtClientSurname -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientSurname" type="text" id="edtClientSurname" onfocus="showHint('edtClientSurname');" onchange="validate_edtClientSurname();" onblur="hideHint('edtClientSurname'); validate_edtClientSurname();" placeholder="Client Surname" onkeypress="handleEnter(this, event);" value="<?= ($row['client_surname']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientSurname">Client Surname</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientSurname //-->
			<p></p>
			<!--// edtClientIdNo -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientIdNo" type="number" id="edtClientIdNo" class="mod"  onfocus="showHint('edtClientIdNo');" onchange="validate_edtClientIdNo();" onblur="hideHint('edtClientIdNo'); validate_edtClientIdNo();" placeholder="Client Id No" onkeypress="handleEnter(this, event);" value="<?= ($row['client_id_no']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientIdNo">Client Id No</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientIdNo //-->
			<p></p>
			<!--// edtClientAddressNote -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientAddressNote" type="text" id="edtClientAddressNote" onfocus="showHint('edtClientAddressNote');" onchange="validate_edtClientAddressNote();" onblur="hideHint('edtClientAddressNote'); validate_edtClientAddressNote();" placeholder="Client Address Note" onkeypress="handleEnter(this, event);" value="<?= ($row['client_address_note']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientAddressNote">Client Address Note</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientAddressNote //-->
			<p></p>
			<!--// edtClientDistance -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientDistance" type="number" id="edtClientDistance" class="mod"  onfocus="showHint('edtClientDistance');" onchange="validate_edtClientDistance();" onblur="hideHint('edtClientDistance'); validate_edtClientDistance();" placeholder="Client Distance" onkeypress="handleEnter(this, event);" value="<?= ($row['client_distance']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientDistance">Client Distance</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientDistance //-->
			<p></p>
			<!--// cbClientAddrBill -->
			<div class="row">
				<div class="col-md-4">
					<input name="cbClientAddrBill" type="number" id="cbClientAddrBill" class="mod"  onfocus="showHint('cbClientAddrBill');" onchange="validate_cbClientAddrBill();" onblur="hideHint('cbClientAddrBill'); validate_cbClientAddrBill();" placeholder="Same as billing address" onkeypress="handleEnter(this, event);" value="<?= ($row['client_addr_bill']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_cbClientAddrBill">Same as billing address</div>
				</div>
			</div>
			<p></p>
			<!-- cbClientAddrBill //-->
			<p></p>
			<!--// edtClientCell -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientCell" type="text" id="edtClientCell" onfocus="showHint('edtClientCell');" onchange="validate_edtClientCell();" onblur="hideHint('edtClientCell'); validate_edtClientCell();" placeholder="Client Cell" onkeypress="handleEnter(this, event);" value="<?= ($row['client_cell']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientCell">Client Cell</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientCell //-->
			<p></p>
			<!--// edtClientPhone -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientPhone" type="text" id="edtClientPhone" onfocus="showHint('edtClientPhone');" onchange="validate_edtClientPhone();" onblur="hideHint('edtClientPhone'); validate_edtClientPhone();" placeholder="Client Phone" onkeypress="handleEnter(this, event);" value="<?= ($row['client_phone']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientPhone">Client Phone</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientPhone //-->
			<p></p>
			<!--// edtClientEmail -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientEmail" type="email" id="edtClientEmail" onfocus="showHint('edtClientEmail');" onchange="validate_edtClientEmail();" onblur="hideHint('edtClientEmail'); validate_edtClientEmail();" placeholder="Client Email" onkeypress="handleEnter(this, event);" value="<?= ($row['client_email']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientEmail">Client Email</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientEmail //-->
			<p></p>
			<!--// txtClientNotes -->
			<div class="row">
				<div class="col-md-4">
			<textarea name="txtClientNotes" type="textarea" id="txtClientNotes" 
onfocus="showHint('txtClientNotes');" onblur="hideHint('txtClientNotes'); validate_txtClientNotes()"
 placeholder="Client Notes"	
><?= ($row['client_notes']); ?></textarea>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_txtClientNotes">Client Notes</div>
				</div>
			</div>
			<p></p>
			<!-- txtClientNotes //-->
			<p></p>
			<!--// txtClientNote -->
			<div class="row">
				<div class="col-md-4">
			<textarea name="txtClientNote" type="textarea" id="txtClientNote" 
onfocus="showHint('txtClientNote');" onblur="hideHint('txtClientNote'); validate_txtClientNote()"
 placeholder="Client Booking Note"	
><?= ($row['client_booking_note']); ?></textarea>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_txtClientNote">Client Booking Note</div>
				</div>
			</div>
			<p></p>
			<!-- txtClientNote //-->
			<p></p>
			<!--// edtClientBusinessName -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientBusinessName" type="text" id="edtClientBusinessName" onfocus="showHint('edtClientBusinessName');" onchange="validate_edtClientBusinessName();" onblur="hideHint('edtClientBusinessName'); validate_edtClientBusinessName();" placeholder="Client Business Name" onkeypress="handleEnter(this, event);" value="<?= ($row['client_business_name']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientBusinessName">Client Business Name</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientBusinessName //-->
			<p></p>
			<!--// edtClientVatNo -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientVatNo" type="number" id="edtClientVatNo" class="mod"  onfocus="showHint('edtClientVatNo');" onchange="validate_edtClientVatNo();" onblur="hideHint('edtClientVatNo'); validate_edtClientVatNo();" placeholder="Client Vat No" onkeypress="handleEnter(this, event);" value="<?= ($row['client_vat_no']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientVatNo">Client Vat No</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientVatNo //-->
			<p></p>
			<!--// edtClientRegNo -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtClientRegNo" type="number" id="edtClientRegNo" class="mod"  onfocus="showHint('edtClientRegNo');" onchange="validate_edtClientRegNo();" onblur="hideHint('edtClientRegNo'); validate_edtClientRegNo();" placeholder="Client Reg No" onkeypress="handleEnter(this, event);" value="<?= ($row['client_reg_no']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientRegNo">Client Reg No</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientRegNo //-->
			<p></p>
			<!--// cbClientContract -->
			<div class="row">
				<div class="col-md-4">
					<?php $cbClientContract = $row['client_contract']; ?>
					<div class="switch">
					<input name="cbClientContract" type="checkbox" id="cbClientContract" class="form-toggle form-toggle-yes-no" onfocus="showHint('cbClientContract');" onblur="hideHint('cbClientContract'); validate_cbClientContract()"  placeholder="Client Contract" onkeypress="handleEnter(this, event)"<?php if($cbClientContract) echo("checked='checked'"); ?> />
<label for="cbClientContract" data-on="Yes" data-off="No"></label>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_cbClientContract">Client Contract</div>
				</div>
			</div>
			<p></p>
			<!-- cbClientContract //-->
			<p></p>
		<!--// buttons -->
			<div class="row">
				<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">
					<input id="btnOk" type="button" onclick="modifyClient();" value="Update Client" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Client //-->
