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">
<table class="table table-bordered">
<thead>
<tr>
<th>Students</th>
<th>Attendance</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo e($student->name); ?></td>
<td>
<?php
$tdate = Carbon\Carbon::parse($detail)->format('Y-m-d');
$intime = \App\Attendance::where('Enrollment_Number','=',$student->ecNo)
->where('Device_ID','=',$school->Device_ID)
->whereDate('date','=',$tdate)
->where('status','=','IN')
->where('idType','=','A')
->first();
$outtime = \App\Attendance::where('Enrollment_Number','=',$student->ecNo)
->where('Device_ID','=',$school->Device_ID)
->whereDate('date','=',$tdate)
->where('status','=','OUT')
->where('idType','=','A')
->first();
$mat = \App\Attendance::where('Enrollment_Number','=',$student->ecNo)
->where('idSchool','=',$school->idSchool)
->whereDate('date','=',$tdate)
->where('idType','=','M')
->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); ?></span><br>
<?php endif; ?>
<?php if($outtime): ?>
<span>OUT: <?php echo e($outtime->TimeStamp); ?></span>
<?php endif; ?>
<?php elseif($mat): ?>
<span style="color:green;font-weight:bold">P</span>
<?php else: ?>
<span style="color:green;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">
<table class="table table-bordered">
<thead>
<tr>
<?php
$noOfdays = $month->noOfDays;
$now = Carbon\Carbon::parse($detail);
$m = $now->month;
$y = $now->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); ?></td>
<?php endif; ?>
<?php endfor; ?>
<th>TP </th>
<th>TA </th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo e($student->ecNo); ?></td>
<td><?php echo e($student->firstName); ?> <?php echo e($student->middleName); ?> <?php echo e($student->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', '=', $student->idSchool)
->whereDate('fromDate', '<=', $jdate)
->whereDate('toDate', '>=', $jdate)
->first();
$aintime = \App\Attendance::where('Enrollment_Number','=',$student->ecNo)
->where('Device_ID','=',$school->Device_ID)
->whereDate('date','=',$jdate)
->where('status','=','IN')
->where('idType','=','A')
->first();
$aouttime = \App\Attendance::where('Enrollment_Number','=',$student->ecNo)
->where('Device_ID','=',$school->Device_ID)
->whereDate('date','=',$jdate)
->where('status','=','OUT')
->where('idType','=','A')
->first();
$a_mat = \App\Attendance::where('Enrollment_Number','=',$student->ecNo)
->where('idSchool','=',$school->idSchool)
->whereDate('date','=',$jdate)
->where('idType','=','M')
->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); ?></span><br>
<?php endif; ?>
<?php if($aouttime): ?>
<span>OUT: <?php echo e($aouttime->TimeStamp); ?></span>
<?php endif; ?>
<?php elseif($a_mat): ?>
<span style="color:green;font-weight:bold">P</span>
<?php else: ?>
<span style="color:red;font-weight:bold">A</span>
<?php endif; ?>
</td>
<?php endfor; ?>
<td>
<?php $tpa = \App\Attendance::where('idSchool', '=', $school->idSchool)
->where('idMonth','=',$month->idMonth)
->where('Enrollment_Number','=',$student->ecNo)
->where('idType','=','M')
->get();
$tpm = \App\Attendance::where('idSchool', '=', $school->idSchool)
->where('idMonth','=',$month->idMonth)
->where('Enrollment_Number','=',$student->ecNo)
->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('students.student_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -