IMMREX7
<?php $__env->startSection('content'); ?>
<style>
.modal-backdrop{
position: relative !important;
}
</style>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<!--<div class="card">-->
<div class="body">
<button class="btn btn-raised btn-warning btn-round waves-effect" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">Advance Search</button>
<div class="collapse" id="collapseExample">
<div class="well">
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Advance Search</strong></h2>
</div>
<div class="body">
<?php echo Form::open(['method' => 'GET', 'action' => ['School\EmpAttendanceController@index'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-4">
<div class="row clearfix">
<div class="col-sm-4 form-control-label">
<label for="classname">Departments</label>
</div>
<div class="col-sm-7">
<div class="form-group">
<?php echo Form::select('idDepartment',$departments,null,['class' => 'form-control show-tick ms']); ?>
<?php if($errors->has('idDepartment')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idDepartment')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="row clearfix">
<div class="col-sm-4 form-control-label">
<label for="classname">Designation</label>
</div>
<div class="col-sm-7">
<div class="form-group">
<div id="idDesignation" style="border:1px solid #ccc; width:200px; height: 150px; overflow-y: scroll;">
<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-all" id="selectall"></div>
<?php $__currentLoopData = $designation; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key =>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:100px;"><?php echo e($value); ?></label><input type="checkbox" name="designations[]" value="<?php echo e($key); ?>" class="designationclass"></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<!--<select name='idSection' id="idSection" class="form-control show-tick ms"></select>-->
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="row clearfix">
<div class="col-sm-3 form-control-label">
<label for="classname">EC No.</label>
</div>
<div class="col-sm-7">
<div class="form-group">
<div id="idEmployee" style="border:1px solid #ccc; width:200px; height: 150px; overflow-y: scroll;">
</div>
<!--<select name='idSection' id="idSection" class="form-control show-tick ms"></select>-->
</div>
</div>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-2 form-control-label">
<label for="classname">Select Date</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::text('date',null,['class' => 'form-control dateselector']); ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php echo Form::submit('SHOW',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--</div>-->
</div>
</div>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card">
<div class="body">
<div class="body">
<!-- Nav tabs -->
<!-- <ul class="nav nav-tabs">
<li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#home">DAY</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#messages">All Time</a></li>
</ul> -->
<!-- Tab panes -->
<div class="tab-content">
<div> <div class="header"> <h2><strong>Employee Attandance Report (Today)</strong></h2></div>
<div class="body table-responsive">
<?php if(count($employees)>0): ?>
<div id="aniimated-thumbnials">
<table class="table table-bordered table-striped table-hover dataTable tableexp">
<thead>
<tr>
<th>Date</th>
<th>Enrollment No</th>
<th>Name</th>
<th>Department</th>
<th>Designation</th>
<th>Attendance</th>
<?php if(auth()->guard('school')->user()->idSchool == 195 || auth()->guard('school')->user()->idSchool == 163): ?>
<th>Photo (IN)</th>
<th>Location (IN)</th>
<th>Photo (OUT)</th>
<th>Location (OUT)</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php
$school = \App\School::where('idSchool', '=', auth()->guard('school')->user()->idSchool)->first();
$total_present = 0;
$total_absent = 0;
?>
<?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($tdate); ?></td>
<td><?php echo e($var->enrollmentNo); ?></td>
<td><?php echo e($var->firstName); ?> <?php echo e($var->middleName); ?> <?php echo e($var->lastName); ?></td>
<td><?php echo e($var->department->departmentName); ?></td>
<td><?php echo e($var->designation->designationName); ?></td>
<td>
<?php $cdate = \Carbon\Carbon::parse($tdate); ?>
<?php if($school->idCountry == 1): ?>
<?php if(count($var->attandance) == 0): ?>
<span style="color:red;font-weight: bold">A</span>
<?php $total_absent = $total_absent + 1; ?>
<?php else: ?>
<?php $__currentLoopData = $var->attandance; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $det): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($det->status == 'IN'): ?>
<span style="color:green;font-weight:bold">P</span>
<?php $total_present = $total_present + 1; ?>
<?php endif; ?>
<?php if($det->idType == 'M'): ?>
<span style="color:green;font-weight:bold">P</span>
<?php $total_present = $total_present + 1; ?>
<?php endif; ?>
<?php if($det->status == 'IN'): ?>
<span style="color:green;font-weight: bold">IN: <?php echo e(explode(" ",$det->TimeStamp)[1]); ?></span>
<?php endif; ?>
<?php if($det->status == 'OUT'): ?>
<span style="color:red;font-weight: bold">OUT: <?php echo e(explode(" ",$det->TimeStamp)[1]); ?></span>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php else: ?>
<?php if($cdate->dayOfWeek == '5'): ?>
<span style="color:green;font-weight:bold">FRIDAY</span>
<?php $total_present = $total_present + 1; ?>
<?php else: ?>
<?php if(count($var->attandance) == 0): ?>
<span style="color:red;font-weight: bold">A</span>
<?php $total_absent = $total_absent + 1; ?>
<?php else: ?>
<?php $__currentLoopData = $var->attandance; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $det): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($det->status == 'IN'): ?>
<span style="color:green;font-weight:bold">P</span>
<?php $total_present = $total_present + 1; ?>
<?php endif; ?>
<?php if($det->idType == 'M'): ?>
<span style="color:green;font-weight:bold">P</span>
<?php $total_present = $total_present + 1; ?>
<?php endif; ?>
<?php if($det->status == 'IN'): ?>
<span style="color:green;font-weight: bold">IN: <?php echo e(explode(" ",$det->TimeStamp)[1]); ?></span>
<?php endif; ?>
<?php if($det->status == 'OUT'): ?>
<span style="color:red;font-weight: bold">OUT: <?php echo e(explode(" ",$det->TimeStamp)[1]); ?></span>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</td>
<?php if(auth()->guard('school')->user()->idSchool == 195 || auth()->guard('school')->user()->idSchool == 163): ?>
<?php $aintime = \App\EmpAttendance::where('Enrollment_Number', '=', $var->enrollmentNo)
->where('Device_ID', '=', $school->Device_ID)
->whereDate('date', '=', $tdate)
->where('status', '=', 'IN')
->where('idType', '=', 'A')
->orderBy('ID','DESC')
->first();
$aouttime = \App\EmpAttendance::where('Enrollment_Number', '=', $var->enrollmentNo)
->where('Device_ID', '=', $school->Device_ID)
->whereDate('date', '=', $tdate)
->where('status', '=', 'OUT')
->where('idType', '=', 'A')
->orderBy('ID','DESC')
->first();
?>
<td>
<?php if($aintime != null): ?>
<?php if(isset($aintime->photo)): ?>
<a href="<?php echo e($aintime->photo); ?>">
<img src="<?php echo e($aintime->photo); ?>" width="80" height="80"/> </a> <?php endif; ?>
<?php endif; ?>
</td>
<td>
<?php if($aintime != null): ?>
<button type="button" class="btn btn-default" onclick="openMap('<?php echo e($aintime->latitude); ?>','<?php echo e($aintime->longitude); ?>')">View Location</button> <?php endif; ?>
</td>
<td>
<?php if($aouttime != null): ?>
<?php if(isset($aouttime->photo)): ?>
<a href="<?php echo e($aouttime->photo); ?>">
<img src="<?php echo e($aouttime->photo); ?>" width="80" height="80"/> </a> <?php endif; ?>
<?php endif; ?>
</td>
<td>
<?php if($aouttime != null): ?>
<button type="button" class="btn btn-default" onclick="openMap('<?php echo e($aouttime->latitude); ?>','<?php echo e($aouttime->longitude); ?>')">View Location</button> <?php endif; ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
<tfoot>
<tr>
<th>Total Employee: <?php echo e($employees->count()); ?></th>
<th colspan="3">Total Present : <?php echo e($total_present); ?> , Total Absent : <?php echo e($total_absent); ?></th>
</tr>
</tfoot>
</table>
</div>
<?php else: ?>
<p style="color:red;"><strong>To get Attendance Report please go to 'Advance Search' and select Date.</strong></p>
<?php endif; ?>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="messages"> <b></b>
<div class="col-md-12 col-lg-12">
<div class="card">
<div class="header">
<h2><strong>Attendance</strong></h2>
</div>
<div class="body">
<canvas id="bar_chart" height="150"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Button trigger modal -->
<!-- Modal -->
<div class="modal fade" id="defaultModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="title" id="defaultModalLabel">Employee Location</h4>
</div>
<div class="modal-body">
<div id="map" style="height: 300px;"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger waves-effect" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
key: "AIzaSyA-e05D-p1SyTgAKH9_8yxyjjzJrAa-AcE",
v: "weekly",
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
// Add other bootstrap parameters as needed, using camel case.
});
let marker;
let map;
async function initMap() {
// Request needed libraries.
const { Map } = await google.maps.importLibrary("maps");
map = new Map(document.getElementById("map"), {
center: { lat: 28.7041, lng: 77.1025 },
zoom: 14,
mapId: "4504f8b37365c3d0",
});
}
initMap();
function openMap(lat,lng){
// Clear any existing marker
if (marker) {
marker.setMap(null);
}
const newLocation = { lat: parseFloat(lat), lng: parseFloat(lng) };
marker = new google.maps.Marker({
position: newLocation,
map: map,
});
// Center the map on the new marker
map.setCenter(newLocation);
$('#defaultModal').modal('show');
}
$('.dateselector').datepicker({
autoclose: true,
autoWidth: false,
format: 'dd-mm-yyyy',
endDate: '+0d',
orientation: 'auto'
});
$(document).ready(function() {
$('#aniimated-thumbnials').lightGallery({
thumbnail: true,
selector: 'a'
});
$('select[name="idDepartment"]').on('change', function() {
var departmentID = $(this).val();
if(departmentID) {
$.ajax({
url: "<?php echo e(url('/school/departments')); ?>"+'/' +departmentID + "/designations",
type: "GET",
dataType: "json",
success:function(data) {
$('#idDesignation').empty();
$('#idDesignation').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-all" id="selectall"></div>');
$.each(data, function(key, value) {
$('#idDesignation').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:100px;">'+value+'</label><input type="checkbox" name="designations[]" value="'+key+'" class="designationclass"></div>');
});
}
});
}else{
$('select[name="idDesignation"]').empty();
}
});
});
$(document).on('click', '.select-all', function(){
var checkAll = this.checked;
if(checkAll === true){
$('input[type=checkbox]').each(function () {
this.checked = checkAll;
});
var designationIds = [];
$("input:checkbox[name='designations[]']:checked").each(function () {
designationIds.push($(this).val());
});
if (designationIds.length > 0) {
$.ajax({
url: "<?php echo e(url('/school/designations')); ?>"+'/' +designationIds + "/employees",
type: "GET",
dataType: "json",
success:function(data) {
$('#idEmployee').empty();
$('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-allstd" id="selectallstd"></div>');
$.each(data, function(key, value) {
$('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:50px;">'+value+'</label><input type="checkbox" name="employees[]" value="'+key+'" class="empallselect"></div>');
});
}
});
}
}else{
$('#idEmployee').empty();
$('input[type=checkbox]').each(function () {
this.checked = checkAll;
});
}
});
$(document).on('click', '.designationclass', function(){
var designationIds = [];
$("input:checkbox[name='designations[]']:checked").each(function () {
designationIds.push($(this).val());
});
if (designationIds.length > 0) {
$.ajax({
url: "<?php echo e(url('/school/designations')); ?>"+'/' +designationIds + "/employees",
type: "GET",
dataType: "json",
success:function(data) {
$('#idEmployee').empty();
$('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-allstd" id="selectallstd"></div>');
$.each(data, function(key, value) {
$('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:50px;">'+value+'</label><input type="checkbox" name="employees[]" value="'+key+'" class="empallselect"></div>');
});
}
});
}else{
$('#idEmployee').empty();
}
});
$(document).on('click', '.select-allstd', function(){
var checkAllstd = this.checked;
if(checkAllstd === true){
$("input:checkbox[name='employees[]']").each(function () {
this.checked = checkAllstd;
});
}else{
$('.empallselect').each(function () {
this.checked = checkAllstd;
});
}
});
$(function () {
$('.tableexp').DataTable({
'lengthMenu': [[25, 50, 100, - 1], [25, 50, 100, "All"]],
dom: 'Bfrtip',
scrollY: "500px",
scrollX: true,
scrollCollapse: true,
fixedColumns: {
left: 1
},
buttons: [
'csv', 'excel', 'pdf', 'print'
]
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -