<?php $__env->startSection('content'); ?>
<div class="content-heading">
	<div>
		Slip Gaji
	</div>
</div>
<div class="container-fluid">
	<div class="col-sm-12">
		<div class="card">
			<div class="card-header">
				<div class="card-body">
					<?php if( session('msg') ): ?>
					<?php $msg = session('msg'); ?>
					<div class="alert alert-<?php echo e($msg['type']); ?> alert-remove">
						<?php echo $msg['text']; ?>

					</div>
					<?php endif; ?>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<h4 class="popover-header"><?php echo e(session()->get('nama')); ?></h4>
						<div class="popover-body">
							<div class="d-flex align-items-center mb-3"><img class="mr-3 rounded-circle thumb48" src="<?php echo e(url_foto(session()->get('foto'))); ?>" alt="Image">
								<p class="m-0">
									NIK (<?php echo e(session()->get('sEmpID')); ?>)
									<br>
									Jabatan (<?php echo e($unit->data->sDescription); ?>)
								</p>
							</div>
						</div>
					</div>
					<div class="col-sm-3">
						<a href="" data-toggle="modal" data-target="#modal-konfirmasi">
							<div class="jumbotron bg-success-dark">
								<h2 class="text-white">
									<span class="fas fa-money-bill-wave">&nbsp;&nbsp;Lihat Gaji</span>
								</h2>
							</div>	
						</a>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('body-area'); ?>
<!-- Modal Import -->
<div class="modal fade" id="modal-konfirmasi" tabindex="-1" role="dialog" aria-labelledby="modal-konfirmasi-label" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title" id="modal-konfirmasi-label">Konfirmasi Pasword</h4>
				<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			</div>
			<div class="modal-body">
				<form id="action-form" action="<?php echo e(route('gaji.konfirmasi')); ?>" method="POST">
					<?php echo csrf_field(); ?>
					<div class="form-group">
						<div class="input-group with-focus">
							<input maxlength="30" class="form-control border-right-0" type="password" name="password" placeholder="Masukan Password" required="required" />
							<div class="input-group-append">
								<span class="input-group-text text-muted bg-transparent border-left-0"><em class="fa fa-lock"></em></span>
							</div>
						</div>
						<?php if($errors->has('password')): ?>
						<span class="invalid-feedback">
							<strong><?php echo e($errors->first('password')); ?></strong>
						</span>
						<?php endif; ?>
					</div>
				</div>
				<div class="modal-footer">
					<button class="btn btn-secondary" type="button" data-dismiss="modal">Batal</button>
					<button class="btn btn-purple" type="submit">Konfirmasi</button>
				</form>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script src="<?php echo e(mix('/js/sweetalert.js')); ?>"></script>
<script src="<?php echo e(mix('/js/datatable.js')); ?>"></script>
<script>
	var x = document.getElementById("verify");
	var submited = document.getElementById("submited");

	$(document).ready(function(){
		document.getElementById("verify").setAttribute("class", "whirl traditional"); 
		if (navigator.geolocation) {
			navigator.geolocation.getCurrentPosition(showPosition);
		} else {
			x.innerHTML = "Geolocation is not supported by this browser.";
		}
	});

	function showPosition(position) {
		verifyLocation(position.coords.longitude, position.coords.latitude);
		x.innerHTML = "Latitude: " + position.coords.latitude +
		"<br>Longitude: " + position.coords.longitude;
	}

	function verifyLocation(longitude, latitude) {
		$.get("<?php echo e(route('absensi.verify_location')); ?>",{
			longitude:longitude,
			latitude:latitude
		},function(res){
			document.getElementById("verify").setAttribute("class", "");
			if (res.VerifyLocation == 200) {
				document.getElementById("lokasi").setAttribute("class", "badge badge-success");
				document.getElementById("lokasi").innerHTML = "Anda Berada Di lokasi Anda Bekerja";
				$('#submited').attr('style','display:show;');
			}else{
				document.getElementById("lokasi").setAttribute("class", "badge badge-danger");
				document.getElementById("lokasi").innerHTML = "Anda Tidak Berada Di lokasi Anda Bekerja";
				$('#submited').attr('style','display:none;');
			}
		},'json');
	}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\PROGRAM_JANGAN_DIHAPUS\xampp73\htdocs\idam_tech\Laravel6\rs-app\rs-presensi-web\resources\views/pages/personalia/gaji/index.blade.php ENDPATH**/ ?>