Commit 0d7c5f84 by Azhan Hannan

changes in project report

parent 9eba9eac
......@@ -6,7 +6,6 @@
<div class="ui purple left ribbon label">
Report by Department
</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]) }}';">
<i class="file excel outline icon"></i>
Export to Excel
......@@ -44,6 +43,9 @@
<?php $totalhours = $totaldays = $staffhours = $staffdays = 0; ?>
@foreach($staffs as $key => $staff)
<tbody>
<?php
$countproject = $project->where('staffid', data_get($staff,'staffid'));
?>
<tr>
<td colspan="6">{{data_get($staff,'name')}}</td>
</tr>
......
......@@ -32,7 +32,7 @@
</thead>
</table>
<table class="ui unstackable celled table">
<table class="ui unstackable table">
<thead>
<tr>
<th style="width: 10%" class="center aligned" rowspan="2">role</th>
......@@ -50,17 +50,26 @@
<tbody>
<?php $totalhours = $totaldays = 0;?>
@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)
@if(data_get($team,'pm_roles') == data_get($staff,'roleid'))
<?php
// dump($staff->staffid);
$count = $ptstaffs->where('roleid', data_get($team,'pm_roles'));
$acc = $accumulate->where('staffid', data_get($staff,'staffid'));
// dump($acc);
// dump(count($count));
?>
<tr>
<td style="width: 10%" class="center aligned">{{data_get($team,'role.role')}}</td>
<td class="center aligned">
{{data_get($team,'pm_days')}} Days <br>
{{data_get($team,'pm_hours')}} Hours
......
......@@ -474,11 +474,14 @@ class MaintenanceController extends Controller
$userId = users::find(Auth::id())
->u_staffID;
$data = Staff_info::where('id', $request->staffId)
->first();
$team = Pteam::where('id', $request->id)->first();
$role = $team->role_id;
$team->role_id = $request->role;
$team->pt_project_task_sts = $request->status;
$team->pt_team = $data->fullname;
......@@ -486,6 +489,24 @@ class MaintenanceController extends Controller
$team->updated_by = $userId;
$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])
->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