IMMREX7
<?php $__env->startSection('content'); ?>
<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" data-toggle="tab" href="#home">DAY</a></li>
<li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#profile">Month</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 role="tabpanel" class="tab-pane" id="home"> <b></b>
<p>
<div class="body table-responsive">
<?php echo Form::open(['method' => 'GET', 'action' => ['Teacher\ViewOnlyController@viewAttendance'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-1 form-control-label">
<label for="classname">Filter By </label>
</div>
<div class="col-sm-3">
<div class="form-group">
<input type="date" name="attendance_date" class="form-control" value="<?php if(isset($_GET['attendance_date'])): ?><?php echo e($_GET['attendance_date']); ?><?php endif; ?>"/>
</div>
</div>
<div class="col-sm-3 form-control-label">
<?php echo Form::submit('View',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-btn']); ?>
<?php echo Form::close(); ?>
</div>
</div>
<table class="table table-bordered" style="margin-top:10px;">
<thead>
<tr>
<th>Employee Name</th>
<th>Attendance Date</th>
<th>Attendance</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo e($teacher->firstName); ?> <?php echo e($teacher->middleName); ?> <?php echo e($teacher->lastName); ?></td>
<?php
$tdate = Carbon\Carbon::parse(today_date())->format('Y-m-d');
if(isset($_GET['attendance_date'])){
$tdate = Carbon\Carbon::parse($_GET['attendance_date'])->format('Y-m-d');
}
?>
<td><?php echo e(Carbon\Carbon::parse($tdate)->format('d-m-Y')); ?></td>
<td>
<?php
$intime = \App\EmpAttendance::where('Enrollment_Number','=',$teacher->enrollmentNo)
->where('Device_ID','=',$school->Device_ID)
->whereDate('date','=',$tdate)
->where('status','=','IN')
->where('idType','=','A')
->first();
$outtime = \App\EmpAttendance::where('Enrollment_Number','=',$teacher->enrollmentNo)
->where('Device_ID','=',$school->Device_ID)
->whereDate('date','=',$tdate)
->where('status','=','OUT')
->where('idType','=','A')
->first();
$mat = \App\EmpAttendance::where('Enrollment_Number','=',$teacher->enrollmentNo)
->where('idSchool','=',$school->idSchool)
->whereDate('date','=',$tdate)
->where('idType','=','M')
->first();
$leave = DB::table('employee_leaves')->where('idEmployee', '=', $teacher->idEmployee)
->whereDate('leave_date', '<=', $tdate)
->whereDate('leave_date', '>=', $tdate)
->first();
?>
<?php if($intime || $outtime): ?>
<span style="color:green;font-weight:bold">P</span><br>
<?php if($intime): ?>
<span style="color:green;font-weight: bold">IN: <?php echo e($intime->TimeStamp->format('h:i:s')); ?></span><br>
<?php endif; ?>
<?php if($outtime): ?>
<span>OUT: <?php echo e($outtime->TimeStamp->format('h:i:s')); ?></span>
<?php endif; ?>
<?php elseif($mat): ?>
<span style="color:green;font-weight:bold">P</span>
<?php elseif($leave): ?>
<span style="color:green;font-weight:bold">L</span>
<?php else: ?>
<span style="color:red;font-weight:bold">A</span>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</div>
</p>
</div>
<div role="tabpanel" class="tab-pane in active" id="profile"> <b></b>
<div class="body table-responsive">
<?php echo Form::open(['method' => 'GET', 'action' => ['Teacher\ViewOnlyController@viewAttendance'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-1 form-control-label">
<label for="classname">Filter By </label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('month',getMonths(),null,['class' => 'form-control show-tick ms','required'=>'required']); ?>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('year',['2024' => '2024','2025' => '2025','2023' => '2023','2022' => '2022'],null,['class' => 'form-control show-tick ms','required'=>'required']); ?>
</div>
</div>
<div class="col-sm-3 form-control-label">
<?php echo Form::submit('View',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-btn']); ?>
<?php echo Form::close(); ?>
</div>
</div>
<table class="table table-bordered" style="margin-top:10px;">
<thead>
<tr>
<?php
$noOfdays = $month->noOfDays;
$now = Carbon\Carbon::now();
$m = $now->month;
if(isset($_GET['month'])){
$m = $_GET['month'];
}
$y = $now->year;
if(isset($_GET['year'])){
$y = $_GET['year'];
}
?>
<th>EC No.</th>
<th>Name</th>
<?php for($i=1; $i<=$noOfdays;$i++): ?>
<?php
$dt = $i . '-' . $m . '-' . $y;
$tdate = Carbon\Carbon::parse($dt);
$jdate = $tdate->format('Y-m-d');
$v = \App\Holiday::where('idSchool', '=', $school->idSchool)
->whereDate('fromDate', '<=', $jdate)
->whereDate('toDate', '>=', $jdate)
->first();
?>
<?php if($tdate->dayOfWeek == '0'): ?>
<td> <span style="color:green; font-weight: bold;"><?php echo e($i); ?> <br>
SUNDAY</span></td>
<?php elseif($v!=null): ?>
<td><span style="color:green; font-weight: bold;"><?php echo e($i); ?> <br>
<?php echo e($v->holidayName); ?></span></td>
<?php else: ?>
<td><?php echo e($i . '-' . $m); ?></td>
<?php endif; ?>
<?php endfor; ?>
<th>TP </th>
<th>TA </th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo e($teacher->enrollmentNo); ?></td>
<td><?php echo e($teacher->firstName); ?> <?php echo e($teacher->middleName); ?> <?php echo e($teacher->lastName); ?></td>
<?php for($i=1; $i<=$noOfdays;$i++): ?>
<?php
$dt = $i . '-' . $m . '-' . $y;
$tdate = Carbon\Carbon::parse($dt);
$jdate = $tdate->format('Y-m-d');
$v = \App\Holiday::where('idSchool', '=', $teacher->idSchool)
->whereDate('fromDate', '<=', $jdate)
->whereDate('toDate', '>=', $jdate)
->first();
$aintime = \App\EmpAttendance::where('Enrollment_Number','=',$teacher->enrollmentNo)
->where('Device_ID','=',$school->Device_ID)
->whereDate('date','=',$jdate)
->where('status','=','IN')
->where('idType','=','A')
->first();
$aouttime = \App\EmpAttendance::where('Enrollment_Number','=',$teacher->enrollmentNo)
->where('Device_ID','=',$school->Device_ID)
->whereDate('date','=',$jdate)
->where('status','=','OUT')
->where('idType','=','A')
->first();
$a_mat = \App\EmpAttendance::where('Enrollment_Number','=',$teacher->enrollmentNo)
->where('idSchool','=',$school->idSchool)
->whereDate('date','=',$jdate)
->where('idType','=','M')
->first();
$empleave = DB::table('employee_leaves')->where('idEmployee', '=', $teacher->idEmployee)
->whereDate('leave_date', '<=', $tdate)
->whereDate('leave_date', '>=', $tdate)
->first();
?>
<td>
<?php if($tdate->dayOfWeek == '0'): ?>
<span></span>
<?php elseif($v!=null): ?>
<span></span>
<?php elseif($aintime || $aouttime): ?>
<span style="color:green;font-weight:bold">P</span><br>
<?php if($aintime): ?>
<span style="color:green;font-weight: bold">IN: <?php echo e($aintime->TimeStamp->format('h:i:s')); ?></span><br>
<?php endif; ?>
<?php if($aouttime): ?>
<span>OUT: <?php echo e($aouttime->TimeStamp->format('h:i:s')); ?></span>
<?php endif; ?>
<?php elseif($a_mat): ?>
<span style="color:green;font-weight:bold">P</span>
<?php elseif($empleave): ?>
<span style="color:green;font-weight:bold">L</span>
<?php else: ?>
<span style="color:red;font-weight:bold">A</span>
<?php endif; ?>
</td>
<?php endfor; ?>
<td>
<?php $tpa = \App\EmpAttendance::where('idSchool', '=', $school->idSchool)
->where('idMonth','=',$month->idMonth)
->where('Enrollment_Number','=',$teacher->enrollmentNo)
->where('idType','=','M')
->get();
$tpm = \App\EmpAttendance::where('idSchool', '=', $school->idSchool)
->where('idMonth','=',$month->idMonth)
->where('Enrollment_Number','=',$teacher->enrollmentNo)
->where('status','=','IN')
->where('idType','=','A')
->get();
$total_present = $tpa->count() + $tpm->count();
?>
<?php echo e($total_present); ?>
</td>
<td><?php echo e($ta = $month->noOfDays - $total_present); ?></td>
</tr>
</tbody>
</table>
</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">
<div id="m_donut_chart" class="dashboard-donut-chart"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('teachers.teacher_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -