<?php
	include("position_func.php");
	$hddnPositionId = $_SESSION['caller']['args'][1];
	if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER)
	{
		if ((isset($hddnPositionId)) && ($hddnPositionId != $_SESSION['user']['user_code'])) SableGeneralFunctions::divertFromPage("position/view.php");
	}
	$row = $sableDB->getRow("select * from position where position_id = ".$hddnPositionId);
?>
<script src="<?php SableGeneralFunctions::printModuleJS('position'); ?>"></script>

<!--// Position -->
<form id="frmPosition" name="frmPosition" autocomplete="on">
	<input type="hidden" value="<?php echo(SableSystem::sableEncode($hddnPositionId)); ?>" id="hddnPositionId" name="hddnPositionId" />
	<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-edit" aria-hidden="true"></i>&nbsp;Modify Position</h3>
					<p></p>
				</div>
			</div>
			<!--// edtPositionTitle -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtPositionTitle" type="text" id="edtPositionTitle" onfocus="showHint('edtPositionTitle'); validate_edtPositionTitle();" onblur="hideHint('edtPositionTitle');" placeholder="Position Title" onkeypress="handleEnter(this, event);" value="<?php echo($row['position_title']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtPositionTitle">Position Title</div>
				</div>
			</div>
			<p></p>
			<!-- edtPositionTitle //-->
			<p></p>
			<!--// edtPositionDesc -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtPositionDesc" type="text" id="edtPositionDesc" onfocus="showHint('edtPositionDesc'); validate_edtPositionDesc();" onblur="hideHint('edtPositionDesc');" placeholder="Description" onkeypress="handleEnter(this, event);" value="<?php echo($row['position_desc']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtPositionDesc">Description</div>
				</div>
			</div>
			<p></p>
			<!-- edtPositionDesc //-->
			<p></p>
			<!--// selAccessId -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<div class="dropdown">
						<select name="selAccessId" type="select" id="selAccessId" onfocus="showHint('selAccessId');" onblur="hideHint('selAccessId'); validate_selAccessId()" onkeypress="handleEnter(this, event)" placeholder="Access">
<?php echo(SableDBFunctions::getOptions("access", "access_id", "access_name", $row['access_id'])); ?>
						</select>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selAccessId">Access</div>
				</div>
			</div>
			<p></p>
			<!-- selAccessId //-->
			<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('/position/'); ?>'"/>
				</div>
				<div class="col-md-2 forms-grid">
					<input id="btnOk" type="button" onclick="modifyPosition();" value="Update Position" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Position //-->
