<?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($hddnAddressId)); ?>" id="hddnAddressId" name="hddnAddressId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnClientDeleted)); ?>" id="hddnClientDeleted" name="hddnClientDeleted" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnLastUpdate)); ?>" id="hddnLastUpdate" name="hddnLastUpdate" />
	<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 forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<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 forms-grids">
                <div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<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>
			<!--// selIdTypeId -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<div class="dropdown">
						<select name="selIdTypeId" type="select" id="selIdTypeId" onfocus="showHint('selIdtTypeId');" onblur="hideHint('selIdTypeId'); validate_selIdtTypeId()" onkeypress="handleEnter(this, event)" placeholder="Id Type">
							<?= (SableDBFunctions::getOptions("id_type", "id_type_id", "id_type_name", $row['id_type_id'])); ?>
						</select>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selIdTypeId">Id Type Id</div>
				</div>
			</div>
			<p></p>
			<!-- selIdTypeId //-->
			<p></p>
			<!--// edtClientIdNo -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<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>
			<!--// selClientTypeId -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<div class="dropdown">
						<select name="selClientTypeId" type="select" id="selClientTypeId" onfocus="showHint('selClientTypeId');" onblur="hideHint('selClientTypeId'); validate_selClientTypeId()" onkeypress="handleEnter(this, event)" placeholder="Client Type Id">
							<?= (SableDBFunctions::getOptions("client_type", "client_type_id", "client_type_name", $row['client_type_id'])); ?>
						</select>
					</div>

				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selClientTypeId">Client Type Id</div>
				</div>
			</div>
			<p></p>
			<!-- selClientTypeId //-->
			<p></p>
			<!--// cbClientAddrBill -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="cbClientAddrBill" type="number" id="cbClientAddrBill" class="mod"  onfocus="showHint('cbClientAddrBill');" onchange="validate_cbClientAddrBill();" onblur="hideHint('cbClientAddrBill'); validate_cbClientAddrBill();" placeholder="Client Addr Bill" onkeypress="handleEnter(this, event);" value="<?= ($row['client_addr_bill']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_cbClientAddrBill">Client Addr Bill</div>
				</div>
			</div>
			<p></p>
			<!-- cbClientAddrBill //-->
			<p></p>
			<!--// edtClientPhone -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientPhone" type="tel" 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>
			<!--// edtClientPhoneAlt -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientPhoneAlt" type="tel" id="edtClientPhoneAlt" onfocus="showHint('edtClientPhoneAlt');" onchange="validate_edtClientPhoneAlt();" onblur="hideHint('edtClientPhoneAlt'); validate_edtClientPhoneAlt();" placeholder="Client Phone Alt" onkeypress="handleEnter(this, event);" value="<?= ($row['client_phone_alt']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientPhoneAlt">Client Phone Alt</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientPhoneAlt //-->
			<p></p>
			<!--// edtClientEmail -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<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>
			<!--// edtClientNote -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientNote" type="text" id="edtClientNote" onfocus="showHint('edtClientNote');" onchange="validate_edtClientNote();" onblur="hideHint('edtClientNote'); validate_edtClientNote();" placeholder="Client Note" onkeypress="handleEnter(this, event);" value="<?= ($row['client_note']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtClientNote">Client Note</div>
				</div>
			</div>
			<p></p>
			<!-- edtClientNote //-->
			<p></p>
			<!--// selGenderId -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<div class="dropdown">
						<select name="selGenderId" type="select" id="selGenderId" onfocus="showHint('selGenderId');" onblur="hideHint('selGenderId'); validate_selGenderId()" onkeypress="handleEnter(this, event)" placeholder="Client Gender">
							<?= (SableDBFunctions::getOptions("gender", "gender_id", "gender_name", $row['gender_id'])); ?>
						</select>
					</div>

				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selGenderId">Client Gender</div>
				</div>
			</div>
			<p></p>
			<!-- selGenderId //-->
			<p></p>
			<!--// edtClientBusinessName -->
			<div class="row forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<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 forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<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 forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<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 forms-grids">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<?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 forms-grids">
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid"><div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">					<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 //-->
