Commit 7e86c8ce by Azhan Hannan

fixing report by project

parent 33cd0610
...@@ -39,11 +39,11 @@ ...@@ -39,11 +39,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$pteam = []; $pteam = [];
?> ?>
@foreach($roles as $key => $role) @foreach($roles as $key => $role)
<?php <?php
$pteam = $pteams->where('role_id', data_get($role,'pm_roles')); $pteam = $pteams->where('role_id', data_get($role,'pm_roles'));
?> ?>
<tr> <tr>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<td rowspan="{{count($pteam)+1}}">{{data_get($role,'pm_hours')}} Hours <br> {{data_get($role,'pm_days')}} Days <td rowspan="{{count($pteam)+1}}">{{data_get($role,'pm_hours')}} Hours <br> {{data_get($role,'pm_days')}} Days
</td> </td>
<td rowspan="{{count($pteam)+1}}"> <td rowspan="{{count($pteam)+1}}">
<?php <?php
$accumulatehours = 0; $accumulatehours = 0;
$staffaccumulateshours = $accumulates->where('tp_roles', data_get($role,'pm_roles')); $staffaccumulateshours = $accumulates->where('tp_roles', data_get($role,'pm_roles'));
foreach ($staffaccumulateshours as $key => $accumulateshours) { foreach ($staffaccumulateshours as $key => $accumulateshours) {
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
} }
?> ?>
{{ number_format($accumulatehours, 1, '.', '') }} Hours <br> {{ number_format($accumulatehours, 1, '.', '') }} Hours <br>
{{ number_format($accumulatehours/8, 1, '.', '') }} Days {{ number_format($accumulatehours/8, 1, '.', '') }} Days
</td> </td>
</tr> </tr>
<?php $count = 0; ?> <?php $count = 0; ?>
...@@ -67,11 +67,11 @@ ...@@ -67,11 +67,11 @@
<tr> <tr>
<td>{{data_get($team,'pt_team')}}</td> <td>{{data_get($team,'pt_team')}}</td>
<td class="center aligned"> <td class="center aligned">
<?php <?php
$currhour = 0; $currhour = 0;
$currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id')); $currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id'));
foreach ($currmonthhours as $key => $hours) { foreach ($currmonthhours as $key => $hours) {
$currhour = data_get($hours,'tp_hours'); $currhour += data_get($hours,'tp_hours');
} }
?> ?>
{{ number_format($currhour, '1', '.', '') }} Hours {{ number_format($currhour, '1', '.', '') }} Hours
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</td> </td>
@if($count == 0) @if($count == 0)
<td rowspan="{{count($pteam)}}" class="center aligned"> <td rowspan="{{count($pteam)}}" class="center aligned">
<?php <?php
$balancehours = data_get($role,'pm_hours') - $accumulatehours; $balancehours = data_get($role,'pm_hours') - $accumulatehours;
?> ?>
{{ number_format($balancehours, '1', '.', '') }} Hours <br> {{ number_format($balancehours, '1', '.', '') }} Hours <br>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</td> </td>
@else @else
@endif @endif
<?php <?php
$count++; $count++;
?> ?>
</tr> </tr>
...@@ -97,4 +97,4 @@ ...@@ -97,4 +97,4 @@
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui green left ribbon label">Report by Project</a> <a class="ui green left ribbon label">Report by Project</a>
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::report.generateprojectreport') }}" method="POST"> <form class="ui form" action="{{ route('timesheet::report.generateprojectreport') }}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<div class="one fields"> <div class="one fields">
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<option value="{{ data_get($value,'id') }}" @if(data_get($value,'id') == data_get($pdetail,'pid')) selected="selected" @endif>{{ data_get($value,'p_project_code') }} | {{ data_get($value,'p_project_description') }}</option> <option value="{{ data_get($value,'id') }}" @if(data_get($value,'id') == data_get($pdetail,'pid')) selected="selected" @endif>{{ data_get($value,'p_project_code') }} | {{ data_get($value,'p_project_description') }}</option>
@endforeach @endforeach
@else @else
<option value="noproject">No Project</option> <option value="noproject">No Project</option>
@endif @endif
</select> </select>
</div> </div>
</div> </div>
<?php <?php
// dd($year); // dd($year);
?> ?>
<div class="two fields"> <div class="two fields">
<div class="three wide field"> <div class="three wide field">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</select> </select>
</div> </div>
<div class="three wide field"> <div class="three wide field">
<label>Month</label> <label>Month</label>
<select name="month" class="ui fluid dropdown search" required="required"> <select name="month" class="ui fluid dropdown search" required="required">
@foreach($listmonth as $key => $value) @foreach($listmonth as $key => $value)
<option value="{{ $key+1 }}" @if($value == $month) selected="selected" @endif>{{ $value }}</option> <option value="{{ $key+1 }}" @if($value == $month) selected="selected" @endif>{{ $value }}</option>
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
</form> </form>
</div> </div>
<div class="ui segment"> <div class="ui segment">
<div class="ui purple left ribbon label"> <div class="ui purple left ribbon label">
Reporting Reporting
</div> </div>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<th style="width: 20%"> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th> <th style="width: 20%"> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th>
<th style="width: 10%">Start Date </th> <th style="width: 10%">Start Date </th>
<th style="width: 1%">:</th> <th style="width: 1%">:</th>
<th style="width: 20%"> <th style="width: 20%">
@if(data_get($pdetail,'start_date')) {{ date("j M Y", strtotime(data_get($pdetail,'start_date'))) }} @endif @if(data_get($pdetail,'start_date')) {{ date("j M Y", strtotime(data_get($pdetail,'start_date'))) }} @endif
</th> </th>
</tr> </tr>
...@@ -85,13 +85,13 @@ ...@@ -85,13 +85,13 @@
<th style="width: 20%"> {{$month}} {{$year}}</th> <th style="width: 20%"> {{$month}} {{$year}}</th>
<th style="width: 10%"> End Date</th> <th style="width: 10%"> End Date</th>
<th style="width: 1%">:</th> <th style="width: 1%">:</th>
<th style="width: 20%"> <th style="width: 20%">
@if(data_get($pdetail,'end_date')) {{ date("j M Y", strtotime(data_get($pdetail,'end_date'))) }} @endif @if(data_get($pdetail,'end_date')) {{ date("j M Y", strtotime(data_get($pdetail,'end_date'))) }} @endif
</th> </th>
</tr> </tr>
</thead> </thead>
</table> </table>
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
...@@ -108,11 +108,11 @@ ...@@ -108,11 +108,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$pteam = []; $pteam = [];
?> ?>
@foreach($roles as $key => $role) @foreach($roles as $key => $role)
<?php <?php
$pteam = $pteams->where('role_id', data_get($role,'pm_roles')); $pteam = $pteams->where('role_id', data_get($role,'pm_roles'));
// dump($role); // dump($role);
// dump($pteams); // dump($pteams);
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
<td rowspan="{{count($pteam)+1}}" class="center aligned">{{data_get($role,'role.role')}}</td> <td rowspan="{{count($pteam)+1}}" class="center aligned">{{data_get($role,'role.role')}}</td>
<td rowspan="{{count($pteam)+1}}" class="center aligned"> <td rowspan="{{count($pteam)+1}}" class="center aligned">
<?php $hannan = 0; ?> <?php $hannan = 0; ?>
<?php <?php
$hannan = data_get($role,'pm_hours'); $hannan = data_get($role,'pm_hours');
if ($hannan) { if ($hannan) {
} else { } else {
...@@ -131,10 +131,10 @@ ...@@ -131,10 +131,10 @@
{{ number_format($hannan, 1, '.', '') }} Hours<br> {{ number_format($hannan, 1, '.', '') }} Hours<br>
{{ number_format($hannan/8, 1, '.', '') }} Days {{ number_format($hannan/8, 1, '.', '') }} Days
</td> </td>
<td rowspan="{{count($pteam)+1}}" class="center aligned"> <td rowspan="{{count($pteam)+1}}" class="center aligned">
<?php <?php
$accumulatehours = 0; $accumulatehours = 0;
$staffaccumulateshours = $accumulates->where('tp_roles', data_get($role,'pm_roles')); $staffaccumulateshours = $accumulates->where('tp_roles', data_get($role,'pm_roles'));
foreach ($staffaccumulateshours as $key => $accumulateshours) { foreach ($staffaccumulateshours as $key => $accumulateshours) {
...@@ -142,8 +142,8 @@ ...@@ -142,8 +142,8 @@
$accumulatehours += data_get($accumulateshours,'tp_hours'); $accumulatehours += data_get($accumulateshours,'tp_hours');
} }
?> ?>
{{ number_format($accumulatehours, 1, '.', '') }} Hours <br> {{ number_format($accumulatehours, 1, '.', '') }} Hours <br>
{{ number_format($accumulatehours/8, 1, '.', '') }} Days {{ number_format($accumulatehours/8, 1, '.', '') }} Days
</td> </td>
<?php $count = 0; ?> <?php $count = 0; ?>
@foreach($pteam as $key => $team) @foreach($pteam as $key => $team)
...@@ -152,12 +152,12 @@ ...@@ -152,12 +152,12 @@
{{ data_get($team,'pt_team') }} {{ data_get($team,'pt_team') }}
</td> </td>
<td class="center aligned"> <td class="center aligned">
<?php <?php
// dd($count); // dd($count);
$currhour = 0; $currhour = 0;
$currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id')); $currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id'));
foreach ($currmonthhours as $key => $hours) { foreach ($currmonthhours as $key => $hours) {
$currhour = data_get($hours,'tp_hours'); $currhour += data_get($hours,'tp_hours');
} }
// dd($currmonthhours); // dd($currmonthhours);
?> ?>
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
</td> </td>
@else @else
@endif @endif
<?php <?php
$count++; $count++;
?> ?>
</tr> </tr>
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
</table> </table>
</div> </div>
</div> </div>
</div> </div>
...@@ -199,4 +199,4 @@ ...@@ -199,4 +199,4 @@
@endsection @endsection
@push('script') @push('script')
@endpush @endpush
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment