IMMREX7
@extends('students.student_layout')
@section('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>{{$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();
?>
@if($intime || $outtime)
<span style="color:green;font-weight:bold">P</span><br>
@if($intime)
<span style="color:green;font-weight: bold">IN: {{$intime->TimeStamp}}</span><br>
@endif
@if($outtime)
<span>OUT: {{$outtime->TimeStamp}}</span>
@endif
@elseif($mat)
<span style="color:green;font-weight:bold">P</span>
@else
<span style="color:green;font-weight:bold">A</span>
@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>
@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();
?>
@if($tdate->dayOfWeek == '0')
<td> <span style="color:green; font-weight: bold;">{{$i}} <br>
SUNDAY</span></td>
@elseif($v!=null)
<td><span style="color:green; font-weight: bold;">{{$i}} <br>
{{$v->holidayName}}</span></td>
@else
<td>{{$i}}</td>
@endif
@endfor
<th>TP </th>
<th>TA </th>
</tr>
</thead>
<tbody>
<tr>
<td>{{$student->ecNo}}</td>
<td>{{$student->firstName}} {{$student->middleName}} {{$student->lastName}}</td>
@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>
@if($tdate->dayOfWeek == '0')
<span></span>
@elseif($v!=null)
<span></span>
@elseif($aintime || $aouttime)
<span style="color:green;font-weight:bold">P</span><br>
@if($aintime)
<span style="color:green;font-weight: bold">IN: {{$aintime->TimeStamp}}</span><br>
@endif
@if($aouttime)
<span>OUT: {{$aouttime->TimeStamp}}</span>
@endif
@elseif($a_mat)
<span style="color:green;font-weight:bold">P</span>
@else
<span style="color:red;font-weight:bold">A</span>
@endif
</td>
@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();
?>
{{$total_present }}
</td>
<td>{{$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>
@stop
Copyright © 2021 -