<?php
include("address_func.php");
$hddnAddressId = $_SESSION['caller']['args'][1];
if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER)
{
	SableGeneralFunctions::divertFromPage();
}
$row = $sableDB->getRow("select * from address where address_id = {$hddnAddressId}");

?>
<script src="<?= SableGeneralFunctions::printModuleJS('address') ?>"></script>

<!--// Address -->
<form id="frmAddress" name="frmAddress" autocomplete="on">
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnAddressId)); ?>" id="hddnAddressId" name="hddnAddressId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnClientId)); ?>" id="hddnClientId" name="hddnClientId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnAddressTypeId)); ?>" id="hddnAddressTypeId" name="hddnAddressTypeId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnCountryId)); ?>" id="hddnCountryId" name="hddnCountryId" />
	<input type="hidden" value="<?= (SableSystem::sableEncode($hddnPostId)); ?>" id="hddnPostId" name="hddnPostId" />
	<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 Address</h3>
					<p></p>
				</div>
			</div>
			<!--// edtAddressStreet -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtAddressStreet" type="text" id="edtAddressStreet"readonly value="<?= ($row['address_street']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAddressStreet">Address Street</div>
				</div>
			</div>
			<p></p>
			<!-- edtAddressStreet //-->
			<p></p>
			<!--// edtAddressSuburb -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtAddressSuburb" type="text" id="edtAddressSuburb"readonly value="<?= ($row['address_suburb']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAddressSuburb">Address Suburb</div>
				</div>
			</div>
			<p></p>
			<!-- edtAddressSuburb //-->
			<p></p>
			<!--// edtAddressCity -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtAddressCity" type="text" id="edtAddressCity"readonly value="<?= ($row['address_city']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAddressCity">Address City</div>
				</div>
			</div>
			<p></p>
			<!-- edtAddressCity //-->
			<p></p>
			<!--// edtAddressCounty -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtAddressCounty" type="text" id="edtAddressCounty"readonly value="<?= ($row['address_county']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAddressCounty">Address County</div>
				</div>
			</div>
			<p></p>
			<!-- edtAddressCounty //-->
			<p></p>
			<!--// edtAddressPostalCode -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtAddressPostalCode" type="text" id="edtAddressPostalCode"readonly value="<?= ($row['address_postal_code']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAddressPostalCode">Address Postal Code</div>
				</div>
			</div>
			<p></p>
			<!-- edtAddressPostalCode //-->
			<p></p>
			<!--// edtAddressLng -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtAddressLng" type="text" id="edtAddressLng"readonly value="<?= ($row['address_lng']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAddressLng">Address Lng</div>
				</div>
			</div>
			<p></p>
			<!-- edtAddressLng //-->
			<p></p>
			<!--// edtAddressLat -->
			<div class="row">
				<div class="col-md-4">
					<input name="edtAddressLat" type="text" id="edtAddressLat"readonly value="<?= ($row['address_lat']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAddressLat">Address Lat</div>
				</div>
			</div>
			<p></p>
			<!-- edtAddressLat //-->
			<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('/address/'); ?>'"/>
				</div>
				<div class="col-md-2">
					<input id="btnOk" type="button" onclick="editAddress('<?= (SableSystem::sableEncode($hddnAddressId)); ?>')" value="Modify Address" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Address //-->
