<?php
	include("audit_func.php");
	$hddnAuditId = $_SESSION['caller']['args'][1];
	if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER)
	{
		SableGeneralFunctions::divertFromPage();
	}
	$row = $sableDB->getRow("select * from audit where audit_id = ".$hddnAuditId);
$selUserCode  = $sableDB->getValue("select concat(user_name, ' ', user_surname) from `user` where user_code = '".$row["user_code"]."'");
?>
<script src="<?php SableGeneralFunctions::printModuleJS('audit'); ?>"></script>

<!--// Audit -->
<form id="frmAudit" name="frmAudit" autocomplete="on">
	<input type="hidden" value="<?php echo(SableSystem::sableEncode($hddnAuditId)); ?>" id="hddnAuditId" name="hddnAuditId" />
	<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-eye" aria-hidden="true"></i>&nbsp;View Audit</h3>
					<p></p>
				</div>
			</div>
			<!--// edtItemId -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtItemId" type="number" id="edtItemId" class="mod" readonly value="<?php echo($row['audit_id']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtItemId">Item No.</div>
				</div>
			</div>
			<p></p>
			<!-- edtItemId //-->
			<p></p>
			<!--// edtAuditDesc -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAuditDesc" type="text" id="edtAuditDesc"readonly value="<?php echo($row['audit_desc']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAuditDesc">Detail</div>
				</div>
			</div>
			<p></p>
			<p></p>
			<!--// selUserCode -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="selUserCode" type="text" id="selUserCode"readonly value="<?php echo($selUserCode); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selUserCode">Actioned by User</div>
				</div>
			</div>
			<p></p>
			<!-- selUserCode //-->
			<p></p>
			<!--// edtAuditTime -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAuditTime" type="text" id="edtAuditTime"readonly value="<?php echo($row['audit_time']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAuditTime">Action Date &amp; Time</div>
				</div>
			</div>
			<p></p>
			<!-- edtAuditTime //-->
			<p></p>
			<!--// edtIpAddress -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtIpAddress" type="text" id="edtIpAddress"readonly value="<?php echo($row['ip_address']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtIpAddress">IP Address</div>
				</div>
			</div>
			<p></p>
			<!-- edtIpAddress //-->
			<p></p>
		<!--// 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('/audit/'); ?>'"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Audit //-->
