<?php
	include("legal_func.php");
	$hddnLegalId = $_SESSION['caller']['args'][1];
	if ($_SESSION['user']['access_level'] < 9)
	{
		if ((isset($hddnLegalId)) && ($hddnLegalId != $_SESSION['user']['user_code'])) SableGeneralFunctions::divertFromPage("legal/view.php");
	}
	$row = $sableDB->getRow("select * from legal where legal_id = ".$hddnLegalId);

?>


<script src="<?php SableGeneralFunctions::printModuleJS('legal'); ?>"></script>

<!--// Legal -->
<form id="frmLegal" name="frmLegal" autocomplete="on">
	<input type="hidden" value="<?php echo(SableSystem::sableEncode($hddnLegalId)); ?>" id="hddnLegalId" name="hddnLegalId" />
	<div class="forms">
		<div class="container forms-grids">
			<div class="col-md-12 form-grid">
				<h3 class="title"><i class="fa fa-eye" aria-hidden="true"></i>&nbsp;View Legal</h3>
				<p></p>
				<div class="clearfix"> </div>
			</div>
		</div>
		<!--// edtLegalName -->
		<div class="container forms-grids">
			<div class="col-md-4 forms-grid">
		<input name="edtLegalName" type="text" id="edtLegalName"
readonly value="<?php echo($row['legal_name'])?>" />
			</div>


			<div class="col-md-8">
				<div class="fieldHint" id="hint_edtLegalName">Legal Item Name</div>
			</div>
			<div class="clearfix"> </div>
		</div>
		<p></p>
		<!-- edtLegalName //-->


<p></p>
		<!--// txtLegalText -->
		<div class="container forms-grids">
			<div class="col-md-12 forms-grid">
			<?php echo(htmlspecialchars_decode(($row['legal_text']))); ?>
			</div>


			<div class="col-md-12">
				<div class="fieldHint" id="hint_txtLegalText">Legal Item Content</div>
			</div>
			<div class="clearfix"> </div>
		</div>
		<p></p>
		<!-- txtLegalText //-->


<p></p>
		<!--// cbLegalActive -->
		<div class="container forms-grids">
			<div class="col-md-4 forms-grid">
				<?php $cbLegalActive = $row['legal_active']?"Yes":"No"; ?>
		<input name="cbLegalActive" type="text" id="cbLegalActive"
readonly value="<?php echo($cbLegalActive)?>" />
			</div>


			<div class="col-md-8">
				<div class="fieldHint" id="hint_cbLegalActive">Active</div>
			</div>
			<div class="clearfix"> </div>
		</div>
		<p></p>
		<!-- cbLegalActive //-->


<p></p>
		<!--// buttons -->
		<div class="container">
			<div class="forms-grids">
				<div class="col-md-2 forms-grid">
					<input type="button" id="btnCancel" value="Cancel"
					class="submit" onclick="window.location = '<?php SableSystem::printCallPageLink('/legal/'); ?>'"/>
				</div>
				<div class="col-md-2 forms-grid">
					<input id="btnOk" type="button" onclick="editLegal('<?php echo(SableSystem::sableEncode($hddnLegalId)); ?>')" value="Modify Legal" class="submit"/>
				</div>
			</div>
		</div>
		<!-- buttons //-->
	</div>
</form>
<!-- Legal //-->
