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

$selIdTypeId  = $sableDB->getValue("select id_type_name
			 from id_type
			 where id_type_id = '{$row["id_type_id"]}'");
$selClientTypeId  = $sableDB->getValue("select client_type_name
			 from client_type
			 where client_type_id = '{$row["client_type_id"]}'");
$selGenderId  = $sableDB->getValue("select gender_name
			 from gender
			 where gender_id = '{$row["gender_id"]}'");
?>
<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-eye" aria-hidden="true"></i>&nbsp;View Client</h3>
					<p></p>
				</div>
			</div>
			<!--// edtClientName -->
			<div class="row">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientName" type="text" id="edtClientName"readonly 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-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientSurname" type="text" id="edtClientSurname"readonly 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">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="selIdTypeId" type="text" id="selIdTypeId"readonly value="<?= ($selIdTypeId); ?>" >
				</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">
				<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" readonly 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">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="selClientTypeId" type="text" id="selClientTypeId"readonly value="<?= ($selClientTypeId); ?>" >
				</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">
				<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" readonly 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">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientPhone" type="tel" id="edtClientPhone"readonly 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">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientPhoneAlt" type="tel" id="edtClientPhoneAlt"readonly 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">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientEmail" type="email" id="edtClientEmail"readonly 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">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientNote" type="text" id="edtClientNote"readonly 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">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="selGenderId" type="text" id="selGenderId"readonly value="<?= ($selGenderId); ?>" >
				</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">
				<div class="col-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientBusinessName" type="text" id="edtClientBusinessName"readonly 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-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientVatNo" type="number" id="edtClientVatNo" class="mod" readonly 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-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<input name="edtClientRegNo" type="number" id="edtClientRegNo" class="mod" readonly 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-xs-12 col-sm-10 col-md-8 col-lg-6 forms-grid">
					<?php $cbClientContract = $row['client_contract']?"Yes":"No"; ?>
					<input name="cbClientContract" type="text" id="cbClientContract"readonly value="<?= ($cbClientContract); ?>" >
				</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="editClient('<?= (SableSystem::sableEncode($hddnClientId)); ?>')" value="Modify Client" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Client //-->
