<?php
	include("attendance_func.php");
	$hddnAttendanceId = $_SESSION['caller']['args'][1];
	if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER)
	{
		SableGeneralFunctions::divertFromPage();
	}
	$row = $sableDB->getRow("select * from attendance where attendance_id = ".$hddnAttendanceId);
?>
<script src="<?php SableGeneralFunctions::printModuleJS('attendance'); ?>"></script>

<!--// Attendance -->
<form id="frmAttendance" name="frmAttendance" autocomplete="on">
	<input type="hidden" value="<?php echo(SableSystem::sableEncode($hddnAttendanceId)); ?>" id="hddnAttendanceId" name="hddnAttendanceId" />
	<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 Attendance</h3>
					<p></p>
				</div>
			</div>
			<!--// selUserCode -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<div class="dropdown">
						<select name="selUserCode" type="select" id="selUserCode" onfocus="showHint('selUserCode');" onblur="hideHint('selUserCode'); validate_selUserCode()" onkeypress="handleEnter(this, event)" placeholder="User Code">
<?php echo(SableDBFunctions::getOptions("-", "-", "-", $row['user_code'])); ?>
						</select>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selUserCode">User Code</div>
				</div>
			</div>
			<p></p>
			<!-- selUserCode //-->
			<p></p>
			<!--// edtAttendanceIn -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAttendanceIn" type="date" id="edtAttendanceIn" onfocus="showHint('edtAttendanceIn'); validate_edtAttendanceIn();" onblur="hideHint('edtAttendanceIn');" placeholder="Attendance In" onkeypress="handleEnter(this, event);"readonly value="<?php echo($row['attendance_in']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAttendanceIn">Attendance In</div>
				</div>
			</div>
			<p></p>
			<!-- edtAttendanceIn //-->
			<p></p>
			<!--// edtAttendanceOut -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAttendanceOut" type="date" id="edtAttendanceOut" onfocus="showHint('edtAttendanceOut'); validate_edtAttendanceOut();" onblur="hideHint('edtAttendanceOut');" placeholder="Attendance Out" onkeypress="handleEnter(this, event);"readonly value="<?php echo($row['attendance_out']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAttendanceOut">Attendance Out</div>
				</div>
			</div>
			<p></p>
			<!-- edtAttendanceOut //-->
			<p></p>
			<!--// edtAttendanceInLat -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAttendanceInLat" type="text" id="edtAttendanceInLat" onfocus="showHint('edtAttendanceInLat'); validate_edtAttendanceInLat();" onblur="hideHint('edtAttendanceInLat');" placeholder="Attendance In Lat" onkeypress="handleEnter(this, event);"readonly value="<?php echo($row['attendance_in_lat']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAttendanceInLat">Attendance In Lat</div>
				</div>
			</div>
			<p></p>
			<!-- edtAttendanceInLat //-->
			<p></p>
			<!--// edtAttendanceInLng -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAttendanceInLng" type="text" id="edtAttendanceInLng" onfocus="showHint('edtAttendanceInLng'); validate_edtAttendanceInLng();" onblur="hideHint('edtAttendanceInLng');" placeholder="Attendance In Lng" onkeypress="handleEnter(this, event);"readonly value="<?php echo($row['attendance_in_lng']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAttendanceInLng">Attendance In Lng</div>
				</div>
			</div>
			<p></p>
			<!-- edtAttendanceInLng //-->
			<p></p>
			<!--// edtAttendanceOutLat -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAttendanceOutLat" type="text" id="edtAttendanceOutLat" onfocus="showHint('edtAttendanceOutLat'); validate_edtAttendanceOutLat();" onblur="hideHint('edtAttendanceOutLat');" placeholder="Attendance Out Lat" onkeypress="handleEnter(this, event);"readonly value="<?php echo($row['attendance_out_lat']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAttendanceOutLat">Attendance Out Lat</div>
				</div>
			</div>
			<p></p>
			<!-- edtAttendanceOutLat //-->
			<p></p>
			<!--// edtAttendanceOutLng -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAttendanceOutLng" type="text" id="edtAttendanceOutLng" onfocus="showHint('edtAttendanceOutLng'); validate_edtAttendanceOutLng();" onblur="hideHint('edtAttendanceOutLng');" placeholder="Attendance Out Lng" onkeypress="handleEnter(this, event);"readonly value="<?php echo($row['attendance_out_lng']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAttendanceOutLng">Attendance Out Lng</div>
				</div>
			</div>
			<p></p>
			<!-- edtAttendanceOutLng //-->
			<p></p>
			<!--// edtAttendanceInIp -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAttendanceInIp" type="text" id="edtAttendanceInIp" onfocus="showHint('edtAttendanceInIp'); validate_edtAttendanceInIp();" onblur="hideHint('edtAttendanceInIp');" placeholder="Attendance In Ip" onkeypress="handleEnter(this, event);"readonly value="<?php echo($row['attendance_in_ip']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAttendanceInIp">Attendance In Ip</div>
				</div>
			</div>
			<p></p>
			<!-- edtAttendanceInIp //-->
			<p></p>
			<!--// edtAttendanceOutIp -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtAttendanceOutIp" type="text" id="edtAttendanceOutIp" onfocus="showHint('edtAttendanceOutIp'); validate_edtAttendanceOutIp();" onblur="hideHint('edtAttendanceOutIp');" placeholder="Attendance Out Ip" onkeypress="handleEnter(this, event);"readonly value="<?php echo($row['attendance_out_ip']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtAttendanceOutIp">Attendance Out Ip</div>
				</div>
			</div>
			<p></p>
			<!-- edtAttendanceOutIp //-->
			<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('/attendance/'); ?>'"/>
				</div>
				<div class="col-md-2 forms-grid">
					<input id="btnOk" type="button" onclick="modifyAttendance();" value="Update Attendance" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Attendance //-->
