Commit 279534e5 by hannan

add enums permission "borang", and set dashboard for role 'staff'

parent fb69f16c
...@@ -19,5 +19,7 @@ final class Permission extends Enum ...@@ -19,5 +19,7 @@ final class Permission extends Enum
const kalendarNonCharge = 'kalendarNonCharge'; const kalendarNonCharge = 'kalendarNonCharge';
const kalendarOverhead = 'kalendarOverhead'; const kalendarOverhead = 'kalendarOverhead';
const calendar = 'calendar'; const calendar = 'calendar';
const borang = 'borang';
const tsviewer = 'tsviewer';
} }
@extends('timesheet::layouts.filtermonthphase')
@section('action')
<form class="ui form" action="{{ route('timesheet::dashboard.viewerselectmonthphase') }}" method="POST">
@endsection
\ No newline at end of file
...@@ -163,11 +163,13 @@ ...@@ -163,11 +163,13 @@
<?php <?php
$totalcbyday = 0; $totalcbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valcbyday = $chargehour->where('td_date','=', $date) if ($chargehour) {
->where('tm_phase',$phase); $valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours; foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours;
}
} }
?> ?>
<th>{{ $totalcbyday }}</th> <th>{{ $totalcbyday }}</th>
...@@ -177,11 +179,13 @@ ...@@ -177,11 +179,13 @@
<?php <?php
$totalcbyday = 0; $totalcbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valcbyday = $chargehour->where('td_date','=', $date) if ($chargehour) {
->where('tm_phase',$phase); $valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours; foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours;
}
} }
?> ?>
<th>{{ $totalcbyday }}</th> <th>{{ $totalcbyday }}</th>
...@@ -313,11 +317,13 @@ ...@@ -313,11 +317,13 @@
<?php <?php
$totalncbyday = 0; $totalncbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valncbyday = $nonchargehour->where('td_date','=', $date) if ($nonchargehour) {
->where('tm_phase',$phase); $valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours; foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours;
}
} }
?> ?>
<th>{{ $totalncbyday }}</th> <th>{{ $totalncbyday }}</th>
...@@ -327,11 +333,13 @@ ...@@ -327,11 +333,13 @@
<?php <?php
$totalncbyday = 0; $totalncbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valncbyday = $nonchargehour->where('td_date','=', $date) if ($nonchargehour) {
->where('tm_phase',$phase); $valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours; foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours;
}
} }
?> ?>
<th>{{ $totalncbyday }}</th> <th>{{ $totalncbyday }}</th>
...@@ -355,11 +363,11 @@ ...@@ -355,11 +363,11 @@
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th> <th style="width: 4%;">{{$i+1}}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th> <th style="width: 4%;">{{$i+1}}</th>
@endfor @endfor
@endif @endif
...@@ -370,11 +378,11 @@ ...@@ -370,11 +378,11 @@
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th> <th style="width: 4%;">{{$strdays[$i]}}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th> <th style="width: 4%;">{{$strdays[$i]}}</th>
@endfor @endfor
@endif @endif
...@@ -422,7 +430,7 @@ ...@@ -422,7 +430,7 @@
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour) if($overheadhour)
{ {
$valoverheadhour = $overheadhour->where('td_date','=',$date) $valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid']) ->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase) ->where('tm_phase',$phase)
...@@ -441,7 +449,7 @@ ...@@ -441,7 +449,7 @@
@endfor @endfor
@endif @endif
@if($valchargehour) @if($totaloverhead)
<td>{{ $totaloverhead }}</td> <td>{{ $totaloverhead }}</td>
<td>{{ $totaloverhead/8 }}</td> <td>{{ $totaloverhead/8 }}</td>
@else @else
...@@ -459,11 +467,13 @@ ...@@ -459,11 +467,13 @@
<?php <?php
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valoverheadbyday = $overheadhour->where('td_date','=', $date) if ($overheadhour) {
->where('tm_phase',$phase); $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours; foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours;
}
} }
?> ?>
<th>{{ $totaloverheadbyday }}</th> <th>{{ $totaloverheadbyday }}</th>
...@@ -473,11 +483,13 @@ ...@@ -473,11 +483,13 @@
<?php <?php
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valoverheadbyday = $overheadhour->where('td_date','=', $date) if ($overheadhour) {
->where('tm_phase',$phase); $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours; foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours;
}
} }
?> ?>
<th>{{ $totaloverheadbyday }}</th> <th>{{ $totaloverheadbyday }}</th>
...@@ -501,12 +513,14 @@ ...@@ -501,12 +513,14 @@
<td style="width: 13.5%;">Date</td> <td style="width: 13.5%;">Date</td>
<td>Description</td> <td>Description</td>
</tr> </tr>
@if($notes)
@foreach($notes as $key => $value) @foreach($notes as $key => $value)
<tr> <tr>
<td>{{ $value->td_date }}</td> <td>{{ $value->td_date }}</td>
<td>{{ $value->td_overhead_note }}</td> <td>{{ $value->td_overhead_note }}</td>
</tr> </tr>
@endforeach @endforeach
@endif
</tbody> </tbody>
</table> </table>
</div> </div>
...@@ -530,18 +544,22 @@ ...@@ -530,18 +544,22 @@
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valncbyday = $nonchargehour->where('td_date','=', $date) if ($nonchargehour) {
->where('tm_phase',$phase); $valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase); foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours;
foreach($valncbyday as $key => $value) { }
$totalncbyday += $value->td_hours;
} }
foreach($valoverheadbyday as $key => $value) { if ($overheadhour) {
$totaloverheadbyday += $value->td_hours; $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours;
}
} }
$bc = $totalncbyday + $totaloverheadbyday; $bc = $totalncbyday + $totaloverheadbyday;
...@@ -557,18 +575,22 @@ ...@@ -557,18 +575,22 @@
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valncbyday = $nonchargehour->where('td_date','=', $date) if ($nonchargehour) {
->where('tm_phase',$phase); $valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase); foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours;
foreach($valncbyday as $key => $value) { }
$totalncbyday += $value->td_hours;
} }
foreach($valoverheadbyday as $key => $value) { if ($overheadhour) {
$totaloverheadbyday += $value->td_hours; $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours;
}
} }
$bc = $totalncbyday + $totaloverheadbyday; $bc = $totalncbyday + $totaloverheadbyday;
...@@ -595,25 +617,28 @@ ...@@ -595,25 +617,28 @@
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valcbyday = $chargehour->where('td_date','=', $date) if ($chargehour) {
->where('tm_phase',$phase); $valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
$valncbyday = $nonchargehour->where('td_date','=', $date) foreach($valcbyday as $key => $value) {
->where('tm_phase',$phase); $totalcbyday += $value->td_hours;
}
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours;
} }
foreach($valncbyday as $key => $value) { if ($nonchargehour) {
$totalncbyday += $value->td_hours; $valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours;
}
} }
foreach($valoverheadbyday as $key => $value) { if ($overheadhour) {
$totaloverheadbyday += $value->td_hours; $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours;
}
} }
$ot = ($totalcbyday + $totalncbyday + $totaloverheadbyday)-8; $ot = ($totalcbyday + $totalncbyday + $totaloverheadbyday)-8;
...@@ -639,31 +664,33 @@ ...@@ -639,31 +664,33 @@
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valcbyday = $chargehour->where('td_date','=', $date) if ($chargehour) {
->where('tm_phase',$phase); $valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
$valncbyday = $nonchargehour->where('td_date','=', $date) foreach($valcbyday as $key => $value) {
->where('tm_phase',$phase); $totalcbyday += $value->td_hours;
}
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours;
} }
foreach($valncbyday as $key => $value) { if ($nonchargehour) {
$totalncbyday += $value->td_hours; $valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours;
}
} }
foreach($valoverheadbyday as $key => $value) { if ($overheadhour) {
$totaloverheadbyday += $value->td_hours; $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours;
}
} }
$ot = ($totalcbyday + $totalncbyday + $totaloverheadbyday)-8; $ot = ($totalcbyday + $totalncbyday + $totaloverheadbyday)-8;
if($ot >= 0) if($ot >= 0) $totalot += $ot;
$totalot += $ot;
?> ?>
<td style="width: 4%;"> <td style="width: 4%;">
@if($ot > 0) @if($ot > 0)
......
...@@ -39,6 +39,17 @@ input[type=number] { ...@@ -39,6 +39,17 @@ input[type=number] {
</div> </div>
</form> </form>
<br> <br>
@if($phase == 1)
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => 2, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double right icon"></i>
Phase 2
</button>
@else
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => 1, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double left icon"></i>
Phase 1
</button>
@endif
<form class="ui form" action="{{ route('timesheet::form.savechargeablehours' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.savechargeablehours' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="userId" value="{{$userId}}"> <input type="hidden" name="userId" value="{{$userId}}">
...@@ -51,10 +62,17 @@ input[type=number] { ...@@ -51,10 +62,17 @@ input[type=number] {
<th colspan="2" rowspan="2" class="center aligned">Chargeable</th> <th colspan="2" rowspan="2" class="center aligned">Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th rowspan="2"> <th rowspan="2">
@if($projectlist == [])
<button type="submit" class="ui disabled fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save
</button>
@else
<button type="submit" class="fluid center aligned ui blue compact labeled icon button"> <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i> <i class="save icon"></i>
Save Save
</button> </button>
@endif
</th> </th>
</tr> </tr>
<tr> <tr>
...@@ -154,17 +172,10 @@ input[type=number] { ...@@ -154,17 +172,10 @@ input[type=number] {
</table> </table>
</form> </form>
<br> <br>
@if($phase == 1) <button class="center aligned ui teal compact right labeled icon button" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';"> <i class="angle double right icon"></i>
<i class="angle double right icon"></i> Non-Chargeable Form
Phase 2 </button>
</button>
@else
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';">
<i class="angle double left icon"></i>
Phase 1
</button>
@endif
</div> </div>
@endsection @endsection
......
@extends('timesheet::layouts.filtermonthphase')
@section('action')
<form class="ui form" action="{{ route('timesheet::form.chargeableselectmonthphase') }}" method="POST">
@endsection
\ No newline at end of file
@extends('timesheet::layouts.filtermonthphase')
@section('action')
<form class="ui form" action="{{ route('timesheet::form.nonchargeableselectmonthphase') }}" method="POST">
@endsection
\ No newline at end of file
@extends('timesheet::layouts.filtermonthphase')
@section('action')
<form class="ui form" action="{{ route('timesheet::form.overheadselectmonthphase') }}" method="POST">
@endsection
\ No newline at end of file
...@@ -22,7 +22,10 @@ input[type=number] { ...@@ -22,7 +22,10 @@ input[type=number] {
</div> </div>
<div class="content"> <div class="content">
<form class="ui form" action="{{ route('timesheet::form.addnonchargeabletask' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.addnonchargeabletask' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="month" value="{{ $month }}">
<input type="hidden" name="phase" value="{{ $phase }}">
<input type="hidden" name="year" value="{{ $year }}">
<div class="field"> <div class="field">
<label>Select Task</label> <label>Select Task</label>
<div class="ui selection dropdown"> <div class="ui selection dropdown">
...@@ -43,7 +46,6 @@ input[type=number] { ...@@ -43,7 +46,6 @@ input[type=number] {
<div class="field"> <div class="field">
<label>Task Status</label> <label>Task Status</label>
<select name="status" class="ui fluid dropdown"> <select name="status" class="ui fluid dropdown">
<option value="">Task Status</option>
<option value="1">Active</option> <option value="1">Active</option>
<option value="0">Inactive</option> <option value="0">Inactive</option>
</select> </select>
...@@ -77,21 +79,24 @@ input[type=number] { ...@@ -77,21 +79,24 @@ input[type=number] {
</div> </div>
</form> </form>
<br> <br>
<button class="center aligned ui olive compact labeled icon button" id="task">
<i class="plus icon"></i>
Task
</button>
@if($phase == 1) @if($phase == 1)
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';"> <button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => 2, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
Phase 2 Phase 2
</button> </button>
@else @else
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';"> <button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => 1, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double left icon"></i> <i class="angle double left icon"></i>
Phase 1 Phase 1
</button> </button>
@endif @endif
<button class="center aligned ui olive compact labeled icon button" id="task">
<i class="plus icon"></i>
Task
</button>
<form class="ui form" action="{{ route('timesheet::form.savenonchargeablehours' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.savenonchargeablehours' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="userId" value="{{$userId}}"> <input type="hidden" name="userId" value="{{$userId}}">
...@@ -104,10 +109,17 @@ input[type=number] { ...@@ -104,10 +109,17 @@ input[type=number] {
<th rowspan="2" class="single line" class="center aligned">Non-Chargeable</th> <th rowspan="2" class="single line" class="center aligned">Non-Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th rowspan="2"> <th rowspan="2">
@if($projectlist == [])
<button type="submit" class="ui disabled fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save
</button>
@else
<button type="submit" class="fluid center aligned ui blue compact labeled icon button"> <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i> <i class="save icon"></i>
Save Save
</button> </button>
@endif
</th> </th>
</tr> </tr>
<tr> <tr>
...@@ -207,6 +219,14 @@ input[type=number] { ...@@ -207,6 +219,14 @@ input[type=number] {
</table> </table>
</form> </form>
<br> <br>
<button class="center aligned ui teal compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double left icon"></i>
Chargeable Form
</button>
<button class="center aligned ui teal compact right labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month, 'year' => $year, 'fk_tm_id' => $fk_tm_id]) }}';">
<i class="angle double right icon"></i>
Overhead Form
</button>
</div> </div>
@endsection @endsection
......
...@@ -46,6 +46,10 @@ ...@@ -46,6 +46,10 @@
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
<button class="center aligned ui teal compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month]) }}';">
<i class="angle double left icon"></i>
Back
</button>
</div> </div>
@endsection @endsection
...@@ -21,7 +21,7 @@ input[type=number] { ...@@ -21,7 +21,7 @@ input[type=number] {
</div> </div>
</div> </div>
<div class="ui tiny modal description"> <!-- <div class="ui tiny modal description">
<div class="header"> <div class="header">
Overhead Description Overhead Description
</div> </div>
...@@ -55,7 +55,7 @@ input[type=number] { ...@@ -55,7 +55,7 @@ input[type=number] {
<button class="ui blue button" type="submit">Submit</button> <button class="ui blue button" type="submit">Submit</button>
</form> </form>
</div> </div>
</div> </div> -->
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Overhead Form</a> <a class="ui blue left ribbon label">Overhead Form</a>
...@@ -81,16 +81,28 @@ input[type=number] { ...@@ -81,16 +81,28 @@ input[type=number] {
</form> </form>
<br> <br>
<button class="center aligned ui green compact labeled icon button" id="description"> <!-- <button class="center aligned ui green compact labeled icon button" id="description">
<i class="plus icon"></i> <i class="plus icon"></i>
Description Description
</button> </button> -->
@if($phase == 1)
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => 2, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double right icon"></i>
Phase 2
</button>
@else
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => 1, 'month' => $month,'year' => $year]) }}';">
<i class="angle double left icon"></i>
Phase 1
</button>
@endif
<button class="center aligned ui yellow compact labeled icon button" id="notes" onclick="window.location.href='{{ route('timesheet::form.notelist', ['year'=> $year, 'month'=> $month, 'phase'=> $phase, 'fk_tm_id'=> $check->id] ) }} ';"> <button class="center aligned ui yellow compact labeled icon button" id="notes" onclick="window.location.href='{{ route('timesheet::form.notelist', ['year'=> $year, 'month'=> $month, 'phase'=> $phase, 'fk_tm_id'=> $fk_tm_id] ) }} ';">
<i class="plus icon"></i> <i class="plus icon"></i>
Notes Notes
</button> </button>
<form class="ui form" action="{{ route('timesheet::form.saveoverheadhours' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.saveoverheadhours' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="userId" value="{{$userId}}"> <input type="hidden" name="userId" value="{{$userId}}">
...@@ -203,17 +215,14 @@ input[type=number] { ...@@ -203,17 +215,14 @@ input[type=number] {
</table> </table>
</form> </form>
<br> <br>
@if($phase == 1) <button class="center aligned ui teal compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';"> <i class="angle double left icon"></i>
<i class="angle double right icon"></i> Non-Chargeable Form
Phase 2 </button>
</button> <button class="center aligned ui green compact right labeled icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
@else <i class="angle double right icon"></i>
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';"> Timesheet Viewer
<i class="angle double left icon"></i> </button>
Phase 1
</button>
@endif
</div> </div>
......
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui blue left ribbon label">Select Month & Phase</a>
<br><br>
@yield('action')
{{csrf_field()}}
<div class="@if($currmonth == 1) three fields @else two fields @endif">
@if($currmonth == 1)
<div class="three wide field">
<label>Year</label>
<select name="year" class="ui fluid dropdown" required="required">
<option value="{{ $curryear-1 }}">{{ $curryear-1 }}</option>
<option value="{{ $curryear }}">{{ $curryear }}</option>
</select>
</div>
@endif
<div class="three wide field">
<label>Month</label>
<select name="month" class="ui fluid dropdown" required="required">
@foreach ($month as $key => $value)
<option value="{{ $key+1 }}">{{ $value }}</option>
@endforeach
</select>
</div>
<div class="three wide field">
<label>Phase</label>
<select name="phase" class="ui fluid dropdown" required="required">
<option value="1">1</option>
<option value="2">2</option>
</select>
</div>
</div>
<button class="ui button" type="submit">Submit</button>
</form>
</div>
@endsection
\ No newline at end of file
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
<div class="field"> <div class="field">
<label>Project Team Status</label> <label>Project Team Status</label>
<select name="status" class="ui fluid dropdown"> <select name="status" class="ui fluid dropdown">
<option value="">Project Team Status</option>
<option value="1">Active</option> <option value="1">Active</option>
<option value="0">Inactive</option> <option value="0">Inactive</option>
</select> </select>
......
...@@ -26,7 +26,10 @@ ...@@ -26,7 +26,10 @@
<td>{{ data_get($project,'projectname') }} </td> <td>{{ data_get($project,'projectname') }} </td>
<td>{{ data_get($project,'projectmanager') }} </td> <td>{{ data_get($project,'projectmanager') }} </td>
<td>{{ data_get($project,'status') }} </td> <td>{{ data_get($project,'status') }} </td>
<td><a href="{{ route('timesheet::maintenance.senaraiProjectTeam', ['id' => $project['id']]) }}">Project Team</a></td> <td>
<button class="compact ui button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProjectTeam', ['id' => $project['id']]) }}';">Team</button>
<button class="compact ui button" onclick="window.location.href='JavaScript:void(0)';">Edit</button>
</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -52,6 +52,10 @@ ...@@ -52,6 +52,10 @@
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
<button class="center aligned ui teal compact labeled icon button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProject', [ 'id' => $pid ]) }}';">
<i class="angle double left icon"></i>
Back
</button>
</div> </div>
@endsection @endsection
...@@ -17,6 +17,8 @@ Route::group( ...@@ -17,6 +17,8 @@ Route::group(
Route::get('timesheetReport',['uses' => 'DashboardController@timesheetReport', 'as' => 'dashboard.timesheetReport']); Route::get('timesheetReport',['uses' => 'DashboardController@timesheetReport', 'as' => 'dashboard.timesheetReport']);
Route::get('timesheetReview',['uses' => 'DashboardController@timesheetReview', 'as' => 'dashboard.timesheetReview']); Route::get('timesheetReview',['uses' => 'DashboardController@timesheetReview', 'as' => 'dashboard.timesheetReview']);
Route::get('timesheetViewer',['uses' => 'DashboardController@timesheetViewer', 'as' => 'dashboard.timesheetViewer']); Route::get('timesheetViewer',['uses' => 'DashboardController@timesheetViewer', 'as' => 'dashboard.timesheetViewer']);
Route::get('filterViewer',['uses' => 'DashboardController@filterViewer', 'as' => 'dashboard.filterViewer']);
Route::post('viewerselectmonthphase', ['uses' => 'DashboardController@viewerselectmonthphase', 'as' => 'dashboard.viewerselectmonthphase']);
//maintenance //maintenance
Route::get('senaraiProject',['uses' => 'MaintenanceController@senaraiProject', 'as' => 'maintenance.senaraiProject']); Route::get('senaraiProject',['uses' => 'MaintenanceController@senaraiProject', 'as' => 'maintenance.senaraiProject']);
...@@ -50,7 +52,13 @@ Route::group( ...@@ -50,7 +52,13 @@ Route::group(
Route::get('notelist',['uses' => 'FormController@notelist', 'as' => 'form.notelist']); Route::get('notelist',['uses' => 'FormController@notelist', 'as' => 'form.notelist']);
Route::get('penambahannote',['uses' => 'FormController@penambahannote', 'as' => 'form.penambahannote']); Route::get('penambahannote',['uses' => 'FormController@penambahannote', 'as' => 'form.penambahannote']);
Route::post('addnote', ['uses' => 'FormController@addnote', 'as' => 'form.addnote']); Route::post('addnote', ['uses' => 'FormController@addnote', 'as' => 'form.addnote']);
Route::get('filterChargeable',['uses' => 'FormController@filterChargeable', 'as' => 'form.filterChargeable']);
Route::get('filterNonChargeable',['uses' => 'FormController@filterNonChargeable', 'as' => 'form.filterNonChargeable']);
Route::get('filterOverhead',['uses' => 'FormController@filterOverhead', 'as' => 'form.filterOverhead']);
Route::post('chargeableselectmonthphase', ['uses' => 'FormController@chargeableselectmonthphase', 'as' => 'form.chargeableselectmonthphase']);
Route::post('nonchargeableselectmonthphase', ['uses' => 'FormController@nonchargeableselectmonthphase', 'as' => 'form.nonchargeableselectmonthphase']);
Route::post('overheadselectmonthphase', ['uses' => 'FormController@overheadselectmonthphase', 'as' => 'form.overheadselectmonthphase']);
// nonChargeableForm // nonChargeableForm
Route::post('addnonchargeabletask',['uses' => 'FormController@addnonchargeabletask', 'as' => 'form.addnonchargeabletask']); Route::post('addnonchargeabletask',['uses' => 'FormController@addnonchargeabletask', 'as' => 'form.addnonchargeabletask']);
......
...@@ -70,6 +70,26 @@ class DashboardController extends Controller ...@@ -70,6 +70,26 @@ class DashboardController extends Controller
} }
} }
public function filterViewer()
{
$currmonth = date('n');
// $currmonth = 1;
$curryear = date('Y');
$month = [];
for ($m=1; $m<=12; $m++) {
$month[] = date('F', mktime(0,0,0,$m, 1, date('Y')));
}
return view('timesheet::dashboard.filterViewer', compact('month', 'curryear', 'currmonth'));
}
public function viewerselectmonthphase(Request $request){
return redirect()->route('timesheet::dashboard.timesheetViewer', ['phase' => $request->phase, 'month' =>$request->month]);
}
public function timesheetApproval() public function timesheetApproval()
{ {
return view('timesheet::dashboard.timesheetApproval'); return view('timesheet::dashboard.timesheetApproval');
...@@ -96,19 +116,19 @@ class DashboardController extends Controller ...@@ -96,19 +116,19 @@ class DashboardController extends Controller
$hod = Staff_info::find($user->penyokong) $hod = Staff_info::find($user->penyokong)
->fullname; ->fullname;
$month = date('n'); // $month = date('n');
$year = date('Y'); $year = date('Y');
$day = date('j'); // $day = date('j');
// $month = 7; // $month = 7;
// $year = 2022; // $year = 2022;
// $day = 2; // $day = 2;
if ($day < 16) { // if ($day < 16) {
$phase = 1; // $phase = 1;
} else { // } else {
$phase = 2; // $phase = 2;
} // }
if(isset($request->phase)) if(isset($request->phase))
{ {
...@@ -118,15 +138,14 @@ class DashboardController extends Controller ...@@ -118,15 +138,14 @@ class DashboardController extends Controller
{ {
$month = $request->month; $month = $request->month;
} }
if(isset($request->year)) if(isset($request->year))
{ {
$year = $request->year; $year = $request->year;
} }
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year); $daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$myDate = $month.'/'.$day.'/'.$year; $myDate = $month.'/'.'1'.'/'.$year;
$date = Carbon::createFromFormat('m/d/Y', $myDate); $date = Carbon::createFromFormat('m/d/Y', $myDate);
$strdays = []; $strdays = [];
...@@ -141,7 +160,6 @@ class DashboardController extends Controller ...@@ -141,7 +160,6 @@ class DashboardController extends Controller
$strMonth = $date->format('F'); $strMonth = $date->format('F');
$chargeable = 1; $chargeable = 1;
$nonchargeable = 2; $nonchargeable = 2;
$overhead = 3; $overhead = 3;
...@@ -191,45 +209,69 @@ class DashboardController extends Controller ...@@ -191,45 +209,69 @@ class DashboardController extends Controller
{ {
$chargehour = Ts_detail::where('fk_tm_id',$check->id) $chargehour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $chargeable) ->where('td_project_type', $chargeable)
// ->where('td_hours', '!=', 0) // ->where('td_hours', '!=', 0)
->get(); ->get();
$nonchargehour = Ts_detail::where('fk_tm_id',$check->id) $nonchargehour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $nonchargeable) ->where('td_project_type', $nonchargeable)
// ->where('td_hours', '!=', 0) // ->where('td_hours', '!=', 0)
->get(); ->get();
$overheadhour = Ts_detail::where('fk_tm_id',$check->id) $overheadhour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->where('td_hours', '!=', 0) ->where('td_hours', '!=', 0)
->get(); ->get();
$tempOverhead = []; $tempOverhead = [];
// dd($tempOverhead);
$tempOverheadid = []; $tempOverheadid = [];
$tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
$tempOverheadid[0] = $overheadhour[0]->fk_o_id;
$j = 0; if(isset($overheadhour))
for($i = 0; $i < count($overheadhour); $i++){ {
if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) { // dd('sini ke?');
} else { $tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
$j++; $tempOverheadid[0] = $overheadhour[0]->fk_o_id;
$tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
$tempOverheadid[$j] = $overheadhour[$i]->fk_o_id; $j = 0;
for($i = 0; $i < count($overheadhour); $i++)
{
if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
}
else
{
$j++;
$tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
$tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
}
} }
}
foreach ($tempOverhead as $key => $value) {
$overheadlist[] = [ foreach ($tempOverhead as $key => $value) {
'pid' => $tempOverheadid[$key],
'pname' => $tempOverhead[$key],
];
$overheadlist[] = [
'pid' => $tempOverheadid[$key],
'pname' => $tempOverhead[$key],
];
}
}
else
{
// dd('ke sini?');
} }
$totalchargehrs = $check->tm_chargeable_hrs;
$totalnonchargehrs = $check->tm_nonchargeable_hrs;
$totaloverheadhrs = $check->tm_overhead_hrs;
$notes = Ts_detail::where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->where('fk_tm_id', $check->id)
->where('tm_staff_id', $user->staff_id)
->where('td_project_type', $overhead)
->whereNotNull('td_overhead_note')
->orderby('td_date')
->get();
} }
else else
...@@ -238,23 +280,15 @@ class DashboardController extends Controller ...@@ -238,23 +280,15 @@ class DashboardController extends Controller
$chargehour = null; $chargehour = null;
$nonchargehour = null; $nonchargehour = null;
$overheadhour = null; $overheadhour = null;
$totalchargehrs = null;
$totalnonchargehrs = null;
$totaloverheadhrs = null;
$notes = null;
} }
// dd($check);
$totalchargehrs = $check->tm_chargeable_hrs;
$totalnonchargehrs = $check->tm_nonchargeable_hrs;
$totaloverheadhrs = $check->tm_overhead_hrs;
$notes = Ts_detail::where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->where('fk_tm_id', $check->id)
->where('tm_staff_id', $user->staff_id)
->where('td_project_type', $overhead)
->whereNotNull('td_overhead_note')
->orderby('td_date')
->get();
return view('timesheet::dashboard.timesheetViewer', compact('user', 'dept', 'hod', 'phase', 'month', 'year', 'day', 'strMonth', 'daymonth', 'chargeablelist', 'nonchargeablelist', 'overheadlist', 'chargehour', 'nonchargehour', 'totalchargehrs', 'totalnonchargehrs', 'totaloverheadhrs', 'overheadhour', 'notes', 'check', 'strdays')); return view('timesheet::dashboard.timesheetViewer', compact('user', 'dept', 'hod', 'phase', 'month', 'year', 'strMonth', 'daymonth', 'chargeablelist', 'nonchargeablelist', 'overheadlist', 'chargehour', 'nonchargehour', 'totalchargehrs', 'totalnonchargehrs', 'totaloverheadhrs', 'overheadhour', 'notes', 'check', 'strdays'));
} }
......
...@@ -26,6 +26,65 @@ use Auth; ...@@ -26,6 +26,65 @@ use Auth;
class FormController extends Controller class FormController extends Controller
{ {
public function filterChargeable()
{
$currmonth = date('n');
// $currmonth = 1;
$curryear = date('Y');
$month = [];
for ($m=1; $m<=12; $m++) {
$month[] = date('F', mktime(0,0,0,$m, 1, date('Y')));
}
return view('timesheet::form.filterChargeable', compact('month', 'currmonth', 'curryear'));
}
public function filterNonChargeable()
{
$currmonth = date('n');
$curryear = date('Y');
$month = [];
for ($m=1; $m<=12; $m++) {
$month[] = date('F', mktime(0,0,0,$m, 1, date('Y')));
}
return view('timesheet::form.filterNonChargeable', compact('month', 'currmonth', 'curryear'));
}
public function filterOverhead()
{
$currmonth = date('n');
$curryear = date('Y');
$month = [];
for ($m=1; $m<=12; $m++) {
$month[] = date('F', mktime(0,0,0,$m, 1, date('Y')));
}
return view('timesheet::form.filterOverhead', compact('month', 'currmonth', 'curryear'));
}
public function chargeableselectmonthphase(Request $request){
return redirect()->route('timesheet::form.chargeableForm', ['phase' => $request->phase, 'month' =>$request->month]);
}
public function nonchargeableselectmonthphase(Request $request){
return redirect()->route('timesheet::form.nonChargeableForm', ['phase' => $request->phase, 'month' =>$request->month]);
}
public function overheadselectmonthphase(Request $request){
return redirect()->route('timesheet::form.overheadForm', ['phase' => $request->phase, 'month' =>$request->month]);
}
public function chargeableForm(Request $request) public function chargeableForm(Request $request)
{ {
$chargeable = 1; $chargeable = 1;
...@@ -51,16 +110,7 @@ class FormController extends Controller ...@@ -51,16 +110,7 @@ class FormController extends Controller
} }
$phase = 1;
$month = date('n');
$year = date('Y'); $year = date('Y');
$day = date('j');
if ($day < 16) {
$phase = 1;
} else {
$phase = 2;
}
if(isset($request->phase)) if(isset($request->phase))
{ {
...@@ -105,7 +155,9 @@ class FormController extends Controller ...@@ -105,7 +155,9 @@ class FormController extends Controller
$hour = null; $hour = null;
} }
return view('timesheet::form.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour', 'strdays')); // dd($projectlist);
return view('timesheet::form.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year', 'hour', 'strdays'));
} }
public function savechargeablehours(Request $request) public function savechargeablehours(Request $request)
...@@ -196,10 +248,8 @@ class FormController extends Controller ...@@ -196,10 +248,8 @@ class FormController extends Controller
} }
$sumdetailhour = Ts_detail::where('td_project_type', $chargeable) $sumdetailhour = Ts_detail::where('td_project_type', $chargeable)
->where('tm_year', $request->year) ->where('fk_tm_id', $tmasterid)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase) ->where('tm_phase', $request->phase)
->where('tm_staff_id', $userId)
->sum('td_hours'); ->sum('td_hours');
$checktotalhours = Ts_master::where('id', $tmasterid)->first(); $checktotalhours = Ts_master::where('id', $tmasterid)->first();
...@@ -237,16 +287,7 @@ class FormController extends Controller ...@@ -237,16 +287,7 @@ class FormController extends Controller
} }
$phase = 1;
$month = date('n');
$year = date('Y'); $year = date('Y');
$day = date('j');
if ($day < 16) {
$phase = 1;
} else {
$phase = 2;
}
if(isset($request->phase)) if(isset($request->phase))
{ {
...@@ -292,11 +333,43 @@ class FormController extends Controller ...@@ -292,11 +333,43 @@ class FormController extends Controller
$hour = null; $hour = null;
} }
return view('timesheet::form.nonChargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour','nonchargeables','strdays')); $checkoverhead = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->first();
if ($checkoverhead) {
$fk_tm_id = $checkoverhead->id;
}
else
{
$fk_tm_id = null;
}
return view('timesheet::form.nonChargeableForm', compact('projectlist','userId','month','phase','daymonth','year','hour','nonchargeables','strdays', 'fk_tm_id'));
} }
public function addnonchargeabletask(Request $request) public function addnonchargeabletask(Request $request)
{ {
// dd($request);
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
dump($request->month);
}
if(isset($request->year))
{
$year = $request->year;
}
$nonchargeable = 2; $nonchargeable = 2;
$user = Users::select('name','u_staffID') $user = Users::select('name','u_staffID')
->where('id',Auth::id()) ->where('id',Auth::id())
...@@ -385,7 +458,7 @@ class FormController extends Controller ...@@ -385,7 +458,7 @@ class FormController extends Controller
} else { } else {
return redirect()->route('timesheet::form.nonChargeableForm')->withErrors('You did not select any task or enter any input!'); return redirect()->route('timesheet::form.nonChargeableForm', compact('month', 'year', 'phase'))->withErrors('You did not select any task or enter any input!');
} }
...@@ -501,9 +574,10 @@ class FormController extends Controller ...@@ -501,9 +574,10 @@ class FormController extends Controller
//update total ke master; //update total ke master;
//buat query sum td_hours where condition : //buat query sum td_hours where condition :
$sumdetailhour = Ts_detail::where('td_project_type', $nonchargeable) $sumdetailhour = Ts_detail::where('td_project_type', $nonchargeable)
->where('tm_phase', $request->phase) ->where('fk_tm_id', $tmasterid)
->sum('td_hours'); ->where('tm_phase', $request->phase)
// checktotalhours ->sum('td_hours');
// checktotalhours
$checktotalhours = Ts_master::where('id', $tmasterid)->first(); $checktotalhours = Ts_master::where('id', $tmasterid)->first();
$checktotalhours->tm_nonchargeable_hrs = $sumdetailhour; $checktotalhours->tm_nonchargeable_hrs = $sumdetailhour;
...@@ -538,18 +612,7 @@ class FormController extends Controller ...@@ -538,18 +612,7 @@ class FormController extends Controller
} }
//sample dulu
$phase = 1;
$month = date('n');
$year = date('Y'); $year = date('Y');
$day = date('j');
if ($day < 16) {
$phase = 1;
} else {
$phase = 2;
}
if(isset($request->phase)) if(isset($request->phase))
{ {
...@@ -578,28 +641,33 @@ class FormController extends Controller ...@@ -578,28 +641,33 @@ class FormController extends Controller
} }
$check = Ts_master::where('tm_staff_id', $userId) $checkoverhead = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year) ->where('tm_year', $year)
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->first(); ->first();
// dd($checkoverhead);
//kalau ada, dia gi ke edit //kalau ada, dia gi ke edit
if($check) if($checkoverhead)
{ {
$hour = Ts_detail::where('fk_tm_id',$check->id) $hour = Ts_detail::where('fk_tm_id',$checkoverhead->id)
->get(); ->get();
$fk_tm_id = $checkoverhead->id;
// dd($hour); // dd($hour);
} }
//klu xde g create.php //klu xde g create.php
else else
{ {
$hour = null; $hour = null;
$fk_tm_id = null;
} }
// dd($check->id); // dd($checkoverhead->id);
return view('timesheet::form.overheadForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour', 'project', 'check', 'strdays')); return view('timesheet::form.overheadForm', compact('projectlist','userId','month','phase','daymonth','year', 'hour', 'project', 'fk_tm_id', 'strdays'));
} }
public function saveoverheadhours(Request $request) public function saveoverheadhours(Request $request)
...@@ -711,9 +779,13 @@ class FormController extends Controller ...@@ -711,9 +779,13 @@ class FormController extends Controller
//update total ke master; //update total ke master;
//buat query sum td_hours where condition : //buat query sum td_hours where condition :
$sumdetailhour = Ts_detail::where('td_project_type', $overhead) $sumdetailhour = Ts_detail::where('td_project_type', $overhead)
->where('fk_tm_id', $tmasterid)
->where('tm_phase', $request->phase) ->where('tm_phase', $request->phase)
->sum('td_hours'); ->sum('td_hours');
// checktotalhours
// dd($sumdetailhour);
// checktotalhours
$checktotalhours = Ts_master::where('id', $tmasterid)->first(); $checktotalhours = Ts_master::where('id', $tmasterid)->first();
$checktotalhours->tm_overhead_hrs = $sumdetailhour; $checktotalhours->tm_overhead_hrs = $sumdetailhour;
...@@ -768,7 +840,6 @@ class FormController extends Controller ...@@ -768,7 +840,6 @@ class FormController extends Controller
} else { } else {
$pname = Overhead::where('o_overhead_desc', $request->task) $pname = Overhead::where('o_overhead_desc', $request->task)
->first(); ->first();
// dd($request);
$data = new Ts_detail; $data = new Ts_detail;
$data->td_date = $request->date; $data->td_date = $request->date;
...@@ -805,6 +876,9 @@ class FormController extends Controller ...@@ -805,6 +876,9 @@ class FormController extends Controller
public function notelist(Request $request) public function notelist(Request $request)
{ {
$month = $request->month;
$phase = $request->phase;
$overhead = 3; $overhead = 3;
$userId = Users::find(Auth::id()) $userId = Users::find(Auth::id())
...@@ -820,7 +894,7 @@ class FormController extends Controller ...@@ -820,7 +894,7 @@ class FormController extends Controller
->orderby('td_date') ->orderby('td_date')
->get(); ->get();
return view('timesheet::form.notelist', compact('notes')); return view('timesheet::form.notelist', compact('notes', 'phase', 'month'));
} }
public function penambahannote() public function penambahannote()
......
...@@ -136,6 +136,7 @@ class MaintenanceController extends Controller ...@@ -136,6 +136,7 @@ class MaintenanceController extends Controller
public function senaraiProjectTeam(Request $request) public function senaraiProjectTeam(Request $request)
{ {
// dd($request);
$chargeable = 1; $chargeable = 1;
$pid = $request->id; $pid = $request->id;
$project = Pteam::where('fk_project_id',$request->id) $project = Pteam::where('fk_project_id',$request->id)
......
...@@ -54,26 +54,44 @@ class ServiceProvider extends BaseServiceProvider ...@@ -54,26 +54,44 @@ class ServiceProvider extends BaseServiceProvider
$dashboard->add(__('Halaman Utama'), url('/home/')) $dashboard->add(__('Halaman Utama'), url('/home/'))
->data('icon', 'tachometer alternate icon') ->data('icon', 'tachometer alternate icon')
->active('home/*'); ->active('home/*');
$dashboard->add(__('Timesheet Calendar'), route('timesheet::kalendar.kalendar')) // $dashboard->add(__('Timesheet Calendar'), route('timesheet::kalendar.kalendar'))
->data('icon', 'calendar alternate outline') // ->data('icon', 'calendar alternate outline')
->active('kalendar/*') // ->active('kalendar/*')
->data('permission', Permission::kehadiran); // ->data('permission', Permission::calendar);
$dashboard->add(__('Timesheet Viewer'), route('timesheet::dashboard.timesheetViewer'))
$form = $this->app['laravolt.menu'];
// $form = $this->app['laravolt.menu']->add(__('Borang'))->data('icon', 'align justify');
$form->add(__('Borang Chargeable'), route('timesheet::form.filterChargeable'))
->data('icon', 'circle outline')
->active('chargeableForm/*')
->data('permission', Permission::borang);
$form->add(__('Borang Non-Chargeable'), route('timesheet::form.filterNonChargeable'))
->data('icon', 'circle outline')
->active('nonChargeableForm/*')
->data('permission', Permission::borang);
$form->add(__('Borang Overhead'), route('timesheet::form.filterOverhead'))
->data('icon', 'circle outline')
->active('overheadForm/*')
->data('permission', Permission::borang);
$form->add(__('Timesheet Viewer'), route('timesheet::dashboard.filterViewer'))
->data('icon', 'eye icon') ->data('icon', 'eye icon')
->active('timesheetViewer/*') ->active('timesheetViewer/*')
->data('permission', Permission::kehadiran); ->data('permission', Permission::tsviewer);
$dashboard->add(__('Timesheet Review')) $form->add(__('Timesheet Review'))
->data('icon', 'file alternate icon') ->data('icon', 'file alternate icon')
->active('timesheetReview/*') ->active('timesheetReview/*')
->data('permission', Permission::kehadiran); ->data('permission', Permission::kehadiran);
$dashboard->add(__('Timesheet Approval')) $form->add(__('Timesheet Approval'))
->data('icon', 'check square icon') ->data('icon', 'check square icon')
->active('timesheetApproval/*') ->active('timesheetApproval/*')
->data('permission', Permission::kehadiran); ->data('permission', Permission::kehadiran);
$dashboard->add(__('Timesheet Report')) $form->add(__('Timesheet Report'))
->data('icon', 'file alternate icon') ->data('icon', 'file alternate icon')
->active('timesheetReport/*') ->active('timesheetReport/*')
->data('permission', Permission::kehadiran); ->data('permission', Permission::kehadiran);
$pengurusanProject = $this->app['laravolt.menu']->add(__('Pengurusan Project'))->data('icon', 'align justify'); $pengurusanProject = $this->app['laravolt.menu']->add(__('Pengurusan Project'))->data('icon', 'align justify');
$pengurusanProject->add(__('Senarai Project'), route('timesheet::maintenance.senaraiProject')) $pengurusanProject->add(__('Senarai Project'), route('timesheet::maintenance.senaraiProject'))
...@@ -111,27 +129,13 @@ class ServiceProvider extends BaseServiceProvider ...@@ -111,27 +129,13 @@ class ServiceProvider extends BaseServiceProvider
// ->active('kalendarNonCharge/*') // ->active('kalendarNonCharge/*')
// ->data('permission', Permission::kehadiran); // ->data('permission', Permission::kehadiran);
$form = $this->app['laravolt.menu']->add(__('Borang'))->data('icon', 'align justify');
$form->add(__('Borang Chargeable'), route('timesheet::form.chargeableForm'))
->data('icon', 'circle outline')
->active('chargeableForm/*')
->data('permission', Permission::kehadiran);
$form->add(__('Borang Non-Chargeable'), route('timesheet::form.nonChargeableForm'))
->data('icon', 'circle outline')
->active('nonChargeableForm/*')
->data('permission', Permission::kehadiran);
$form->add(__('Borang Overhead'), route('timesheet::form.overheadForm'))
->data('icon', 'circle outline')
->active('overheadForm/*')
->data('permission', Permission::kehadiran);
$calendar = $this->app['laravolt.menu']->add(__('Kalendar'))->data('icon', 'calendar alternate');
$calendar->add(__('Kalendar'), route('timesheet::kalendar.kalendar')) // $calendar = $this->app['laravolt.menu']->add(__('Kalendar'))->data('icon', 'calendar alternate');
->data('icon', 'calendar alternate outline') // $calendar->add(__('Kalendar'), route('timesheet::kalendar.kalendar'))
->active('kalendar/*') // ->data('icon', 'calendar alternate outline')
->data('permission', Permission::calendar ); // ->active('kalendar/*')
// ->data('permission', Permission::calendar );
// $menu->add(__('Maklumat Cuti'), route('ecuti::quota.index')) // $menu->add(__('Maklumat Cuti'), route('ecuti::quota.index'))
// ->data('icon', 'circle outline') // ->data('icon', 'circle outline')
......
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