Commit 0d7c5f84 by Azhan Hannan

changes in project report

parent 9eba9eac
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<div class="ui purple left ribbon label"> <div class="ui purple left ribbon label">
Report by Department Report by Department
</div> </div>
<button class="right floated center aligned ui violet compact labeled icon button" onclick="window.location.href='{{ route('timesheet::export.exportdepartment', ['month'=> $intmonth, 'year'=> $year, 'dept'=> $dept->id]) }}';"> <button class="right floated center aligned ui violet compact labeled icon button" onclick="window.location.href='{{ route('timesheet::export.exportdepartment', ['month'=> $intmonth, 'year'=> $year, 'dept'=> $dept->id]) }}';">
<i class="file excel outline icon"></i> <i class="file excel outline icon"></i>
Export to Excel Export to Excel
...@@ -44,6 +43,9 @@ ...@@ -44,6 +43,9 @@
<?php $totalhours = $totaldays = $staffhours = $staffdays = 0; ?> <?php $totalhours = $totaldays = $staffhours = $staffdays = 0; ?>
@foreach($staffs as $key => $staff) @foreach($staffs as $key => $staff)
<tbody> <tbody>
<?php
$countproject = $project->where('staffid', data_get($staff,'staffid'));
?>
<tr> <tr>
<td colspan="6">{{data_get($staff,'name')}}</td> <td colspan="6">{{data_get($staff,'name')}}</td>
</tr> </tr>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</thead> </thead>
</table> </table>
<table class="ui unstackable celled table"> <table class="ui unstackable table">
<thead> <thead>
<tr> <tr>
<th style="width: 10%" class="center aligned" rowspan="2">role</th> <th style="width: 10%" class="center aligned" rowspan="2">role</th>
...@@ -50,17 +50,26 @@ ...@@ -50,17 +50,26 @@
<tbody> <tbody>
<?php $totalhours = $totaldays = 0;?> <?php $totalhours = $totaldays = 0;?>
@foreach($pteam as $key => $team) @foreach($pteam as $key => $team)
<?php $balhours = 0; ?>
<?php
$balhours = 0;
foreach ($ptstaffs as $key => $value) {
if (data_get($team,'pm_roles') == data_get($value,'roleid')) {
$count = $ptstaffs->where('roleid', data_get($team,'pm_roles'));
}
}
?>
<tr>
<td style="width: 10%" rowspan="{{count($count)+1}}" class="center aligned">{{data_get($team,'role.role')}}</td>
</tr>
@foreach($ptstaffs as $key => $staff) @foreach($ptstaffs as $key => $staff)
@if(data_get($team,'pm_roles') == data_get($staff,'roleid')) @if(data_get($team,'pm_roles') == data_get($staff,'roleid'))
<?php <?php
// dump($staff->staffid);
$count = $ptstaffs->where('roleid', data_get($team,'pm_roles')); $count = $ptstaffs->where('roleid', data_get($team,'pm_roles'));
$acc = $accumulate->where('staffid', data_get($staff,'staffid')); $acc = $accumulate->where('staffid', data_get($staff,'staffid'));
// dump($acc); // dump(count($count));
?> ?>
<tr> <tr>
<td style="width: 10%" class="center aligned">{{data_get($team,'role.role')}}</td>
<td class="center aligned"> <td class="center aligned">
{{data_get($team,'pm_days')}} Days <br> {{data_get($team,'pm_days')}} Days <br>
{{data_get($team,'pm_hours')}} Hours {{data_get($team,'pm_hours')}} Hours
......
...@@ -474,10 +474,13 @@ class MaintenanceController extends Controller ...@@ -474,10 +474,13 @@ class MaintenanceController extends Controller
$userId = users::find(Auth::id()) $userId = users::find(Auth::id())
->u_staffID; ->u_staffID;
$data = Staff_info::where('id', $request->staffId) $data = Staff_info::where('id', $request->staffId)
->first(); ->first();
$team = Pteam::where('id', $request->id)->first(); $team = Pteam::where('id', $request->id)->first();
$role = $team->role_id;
$team->role_id = $request->role; $team->role_id = $request->role;
$team->pt_project_task_sts = $request->status; $team->pt_project_task_sts = $request->status;
...@@ -485,7 +488,25 @@ class MaintenanceController extends Controller ...@@ -485,7 +488,25 @@ class MaintenanceController extends Controller
$team->pt_staff_id = $data->staff_id; $team->pt_staff_id = $data->staff_id;
$team->updated_by = $userId; $team->updated_by = $userId;
$team->save(); $team->save();
$checkpteam = Pteam::where('fk_project_id', $pid)
->where('role_id', $role)
->first();
// dd($checkpteam);
if ($checkpteam) {
}else{
$checkmandays = Pmandays::where('fk_project', $pid)
->where('pm_roles', $role)
->first();
$checkmandays->delete();
// dd($checkmandays);
// dd('null, delete pmandays');
}
return redirect()->route('timesheet::maintenance.senaraiProjectTeam', ['id' => $pid]) return redirect()->route('timesheet::maintenance.senaraiProjectTeam', ['id' => $pid])
->with('success', 'Project Team Updated Successfully');; ->with('success', 'Project Team Updated Successfully');;
} }
......
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