Commit 4dec45f3 by hannan

changes in timesheet

parent 3b2235dd
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddTpProjectTypeInTimesheetPrj extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('timesheet_prj', function (Blueprint $table) {
$table->integer('tp_project_type')->after('fk_tm_id')->unsigned()->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('timesheet_prj', function (Blueprint $table) {
$table->dropColumn('tp_project_type');
});
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddFkOIdInTimesheetPrj extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('timesheet_prj', function (Blueprint $table) {
$table->integer('fk_o_id')->after('td_project')->unsigned()->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('timesheet_prj', function (Blueprint $table) {
$table->dropColumn('fk_o_id');
});
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStaffIdColumnInTimesheetPrj extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('timesheet_prj', function (Blueprint $table) {
$table->integer('staffid')->after('id')->unsigned()->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('timesheet_prj', function (Blueprint $table) {
$table->dropColumn('tp_staffid');
});
}
}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
['header' => __('action'), 'raw' => function($list) ['header' => __('action'), 'raw' => function($list)
{ {
return " return "
$list->id data_get($list,'id')
<i class='bordered yellow pencil icon edit_button'> <i class='bordered yellow pencil icon edit_button'>
"; ";
} }
......
@if($staffs) @if($staffs)
@foreach($staffs as $key => $staff) @foreach($staffs as $key => $staff)
<div class="item" data-value="{{$staff->id}}" data-text="{{$staff->fullname}}"> <div class="item" data-value="{{ data_get($staff,'id') }}" data-text="{{ data_get($staff,'fullname') }}">
{{$staff->fullname}} {{ data_get($staff,'fullname') }}
</div> </div>
@endforeach @endforeach
@else @else
......
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
<tbody> <tbody>
@foreach($timesheet as $key => $value) @foreach($timesheet as $key => $value)
<tr> <tr>
<td>{{ $value->tm_year }}</td> <td>{{ data_get($value,'tm_year') }}</td>
<td>{{ $value->tm_month }}</td> <td>{{ data_get($value,'tm_month') }}</td>
<td>{{ $value->tm_phase }}</td> <td>{{ data_get($value,'tm_phase') }}</td>
<td> <td>
@if($value->tm_timesheet_master_sts == 1) Draft @if($value->tm_timesheet_master_sts == 1) Draft
@elseif($value->tm_timesheet_master_sts == 2) Submitted @elseif($value->tm_timesheet_master_sts == 2) Submitted
...@@ -78,9 +78,9 @@ ...@@ -78,9 +78,9 @@
@elseif($value->tm_timesheet_master_sts == 8) Revised the timesheet @elseif($value->tm_timesheet_master_sts == 8) Revised the timesheet
@endif @endif
</td> </td>
<td>{{ $value->tm_submission_at }}</td> <td>{{ data_get($value,'tm_submission_at') }}</td>
<td>{{ $value->tm_verified_at }}</td> <td>{{ data_get($value,'tm_verified_at') }}</td>
<td>{{ $value->tm_approval_at }}</td> <td>{{ data_get($value,'tm_approval_at') }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -8,33 +8,33 @@ ...@@ -8,33 +8,33 @@
<form action="{{ route('timesheet::dashboard.verify') }}" method="POST" class="ui form"> <form action="{{ route('timesheet::dashboard.verify') }}" method="POST" class="ui form">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="tmid" value="{{ $profile->tmid }}"> <input type="hidden" name="tmid" value="{{ data_get($profile,'tmid') }}">
<div class="six wide field"> <div class="six wide field">
<label>Staff Name</label> <label>Staff Name</label>
<input type="text" readonly="readonly" value="{{ $profile->fullname }}"> <input type="text" readonly="readonly" value="{{ data_get($profile,'fullname') }}">
</div> </div>
<div class="three fields"> <div class="three fields">
<div class="two wide field"> <div class="two wide field">
<label>Year</label> <label>Year</label>
<input type="text" readonly="readonly" value="{{ $profile->tm_year }}"> <input type="text" readonly="readonly" value="{{ data_get($profile,'tm_year') }}">
</div> </div>
<div class="two wide field"> <div class="two wide field">
<label>Month</label> <label>Month</label>
<input type="text" readonly="readonly" value="{{ $profile->tm_month }}"> <input type="text" readonly="readonly" value="{{ data_get($profile,'tm_month') }}">
</div> </div>
<div class="two wide field"> <div class="two wide field">
<label>Phase</label> <label>Phase</label>
<input type="text" readonly="readonly" value="{{ $profile->tm_phase }}"> <input type="text" readonly="readonly" value="{{ data_get($profile,'tm_phase') }}">
</div> </div>
</div> </div>
<div class="two fields"> <div class="two fields">
<div class="six wide field"> <div class="six wide field">
<input type="hidden" name="verifier" value="{{ $hod->id }}"> <input type="hidden" name="verifier" value="{{ data_get($hod,'id') }}">
<label>Head of Department</label> <label>Head of Department</label>
<input type="text" readonly="readonly" value="{{ $hod->name }}"> <input type="text" readonly="readonly" value="{{ data_get($hod,'name') }}">
</div> </div>
<div class="three wide field"> <div class="three wide field">
<label>Action</label> <label>Action</label>
......
...@@ -52,9 +52,9 @@ ...@@ -52,9 +52,9 @@
<tbody> <tbody>
@foreach($timesheet as $key => $value) @foreach($timesheet as $key => $value)
<tr> <tr>
<td>{{ $value->tm_year }}</td> <td>{{ data_get($value,'tm_year') }}</td>
<td>{{ $value->tm_month }}</td> <td>{{ data_get($value,'tm_month') }}</td>
<td>{{ $value->tm_phase }}</td> <td>{{ data_get($value,'tm_phase') }}</td>
<td> <td>
@if($value->tm_timesheet_master_sts == 1) Draft @if($value->tm_timesheet_master_sts == 1) Draft
@elseif($value->tm_timesheet_master_sts == 2) Submitted @elseif($value->tm_timesheet_master_sts == 2) Submitted
...@@ -77,8 +77,8 @@ ...@@ -77,8 +77,8 @@
@elseif($value->tm_timesheet_master_sts == 8) Revised the timesheet @elseif($value->tm_timesheet_master_sts == 8) Revised the timesheet
@endif @endif
</td> </td>
<td>{{ $value->tm_year }}</td> <td>{{ data_get($value,'tm_year') }}</td>
<td>{{ $value->tm_year }}</td> <td>{{ data_get($value,'tm_year') }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
...@@ -87,19 +87,4 @@ ...@@ -87,19 +87,4 @@
</div> </div>
@endsection @endsection
<!-- <a class="ui blue left ribbon label">Pengguna</a>
<br>
<br>
{!!
Suitable::source($user)
->title(__('Senarai Pengguna'))
->columns([
new \Laravolt\Suitable\Columns\Numbering(__('No')),
['header' => __('name'), 'field' => 'name', 'sortable' => true],
['header' => __('status'), 'field' => 'status', 'sortable' => true],
['header' => __('email'), 'field' => 'email']
])
->render()
!!}
<br> -->
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th colspan="3" style="width: 60%;"><i class="dropdown icon"></i>{{$staff->fullname}}</th> <th colspan="3" style="width: 60%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 15%;" class="center aligned"> <th style="width: 15%;" class="center aligned">
@if($staff->status == 1 || $staff->status == null) In Preparation @if($staff->status == 1 || $staff->status == null) In Preparation
@elseif($staff->status == 2) Submitted @elseif($staff->status == 2) <i class="red attention icon"></i> Submitted
@elseif($staff->status == 3) Verified by HOD @elseif($staff->status == 3) <i class="green check icon"></i> Verified by HOD
@elseif($staff->status == 4) Verified by BOD @elseif($staff->status == 4) Verified by BOD
@endif @endif
</th> </th>
...@@ -35,11 +35,11 @@ ...@@ -35,11 +35,11 @@
</th> </th>
</tr> </tr>
<tr> <tr>
<td style="width: 20%;">Chargeable (A) : {{$staff->chargeable}}</td> <td style="width: 20%;">Chargeable (A) : {{ data_get($staff,'chargeable') }}</td>
<td style="width: 20%;">Nonchargeable (B) : {{$staff->nonchargeable}}</td> <td style="width: 20%;">Nonchargeable (B) : {{ data_get($staff,'nonchargeable') }}</td>
<td style="width: 20%;">Overhead (C) : {{$staff->overhead}}</td> <td style="width: 20%;">Overhead (C) : {{ data_get($staff,'overhead') }}</td>
<td style="width: 15%;">Overtime: {{$staff->overtime}}</td> <td style="width: 15%;">Overtime: {{ data_get($staff,'overtime') }}</td>
<td class="right aligned">Total Hours/Days: {{$staff->totalhrs." hours/ ".$staff->totaldays." days"}}</td> <td class="right aligned">Total Hours/Days: {{ data_get($staff,'totalhrs')." hours/ ".data_get($staff,'totaldays')." days" }}</td>
</tr> </tr>
</thead> </thead>
</table> </table>
...@@ -49,10 +49,8 @@ ...@@ -49,10 +49,8 @@
$cptype = "A"; $cptype = "A";
$ncptype = "B"; $ncptype = "B";
$otype = "C"; $otype = "C";
$pcode = $pname = $pm =""; $td = $checktd->where('tm_staff_id', $staff->staff_id);
$td = $checktd->where('tm_staff_id', $staff->staff_id); $detail = $details->where('staffid', $staff->staff_id);
$checkcpt = $cpt->where('pt_staff_id', $staff->staff_id);
$checkncpt = $ncpt->where('pt_staff_id', $staff->staff_id);
?> ?>
<div class="content" style="padding-top: 0px;"> <div class="content" style="padding-top: 0px;">
...@@ -68,99 +66,45 @@ ...@@ -68,99 +66,45 @@
<th style="width: 25%;" class="center aligned">Remarks</th> <th style="width: 25%;" class="center aligned">Remarks</th>
</tr> </tr>
</thead> </thead>
@if($checkcpt) @if($detail->where('ptype', 1))
@foreach ($checkcpt as $key => $cptval) @foreach($detail->where('ptype', 1) as $key => $chargeable)
@if($cptval->pt_staff_id == $staff->staff_id)
<?php $pname = $cptval->pt_project_description; ?>
@endif
@foreach ($cp as $key => $cpvalue)
@if($cpvalue->p_project_description == $pname)
<?php $pcode = $cpvalue->p_project_code; ?>
@endif
@endforeach
<tr> <tr>
<td style="width: 5%;" class="center aligned">{{ $cptype }}</td> <td style="width: 5%;" class="center aligned">{{ $cptype }}</td>
<td style="width: 15%;">{{ $pcode }}</td> <td style="width: 15%;">{{ data_get($chargeable, 'pcode') }}</td>
<td style="width: 20%;">{{ $pname }}</td> <td style="width: 20%;">{{ data_get($chargeable, 'pname') }}</td>
<td style="width: 20%;"> <td style="width: 20%;">{{ data_get($chargeable, 'pmname') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ data_get($chargeable, 'hours') }}</td>
@foreach ($cp as $key => $cpvalue) <td style="width: 7.5%;" class="center aligned">{{ data_get($chargeable, 'hours')/8 }}</td>
@if($cpvalue->p_project_description == $pname) <td style="width: 25%;" class="center aligned"></td>
@foreach ($pmname as $key => $pmvalue)
@if($pmvalue->staff_id == $cpvalue->p_project_task_team)
<?php $pm = $pmvalue->fullname; ?>
{{ $pm }}
@endif
@endforeach
@endif
@endforeach
</td>
<td style="width: 7.5%;" class="center aligned">
<?php $totalc=0; ?>
@foreach($td as $key => $tdvalues)
@if($cptval->fk_project_id == $tdvalues->td_project)
<?php $totalc += $tdvalues->td_hours;?>
@endif
@endforeach
{{ $totalc }}
</td>
<td style="width: 7.5%;" class="center aligned">{{ $totalc/8 }}</td>
<td style="width: 25%;" class="center aligned">Remarks</td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
@if($detail->where('ptype', 2))
@if($checkncpt) @foreach($detail->where('ptype', 2) as $key => $nonchargeable)
@foreach ($checkncpt as $key => $ncptval) <tr>
<tr> <td style="width: 5%;" class="center aligned">{{ $ncptype }}</td>
<td style="width: 5%;" class="center aligned">{{ $ncptype }}</td> <td style="width: 15%;">{{ data_get($nonchargeable, 'pcode') }}</td>
<td style="width: 15%;"> - </td> <td style="width: 20%;">{{ data_get($nonchargeable, 'pname') }}</td>
<td style="width: 20%;">{{ $ncptval->pt_project_description }}</td> <td style="width: 20%;">{{ data_get($nonchargeable, 'pmname') }}</td>
<td style="width: 20%;"> - </td> <td style="width: 7.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours') }}</td>
<td style="width: 7.5%;" class="center aligned"> <td style="width: 7.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours')/8 }}</td>
<?php $totalnc=0; ?> <td style="width: 25%;" class="center aligned"></td>
@foreach($td as $key => $tdval) </tr>
@if($tdval->td_project == $ncptval->fk_project_id) @endforeach
<?php $totalnc += $tdval->td_hours; ?> @endif
@endif @if($detail->where('ptype', 3))
@endforeach @foreach($detail->where('ptype', 3) as $key => $chargeable)
{{ $totalnc }}
</td>
<td style="width: 7.5%;" class="center aligned">{{ $totalnc/8 }}</td>
<td style="width: 25%;" class="center aligned">Remarks</td>
</tr>
@endforeach
@endif
<?php $ovhd = $td->where('td_project_type', 3); ?>
<?php $overheadtemp[0] = $overheadtask[0] = ""; ?>
@if($ovhd)
@foreach($ovhd as $key => $overhead)
<tr> <tr>
<td style="width: 5%;" class="center aligned">{{ $otype }}</td> <td style="width: 5%;" class="center aligned">{{ $otype }}</td>
<td style="width: 15%;"> - </td> <td style="width: 15%;">{{ data_get($chargeable, 'pcode') }}</td>
<td style="width: 20%;">{{ $overhead->td_overhead_desc }}</td> <td style="width: 20%;">{{ data_get($chargeable, 'pname') }}</td>
<td style="width: 20%;"> - </td> <td style="width: 20%;">{{ data_get($chargeable, 'pmname') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ $overhead->td_hours }}</td> <td style="width: 7.5%;" class="center aligned">{{ data_get($chargeable, 'hours') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ $overhead->td_hours/8 }}</td> <td style="width: 7.5%;" class="center aligned">{{ data_get($chargeable, 'hours')/8 }}</td>
<td style="width: 25%;" class="center aligned">Remarks</td> <td style="width: 25%;" class="center aligned"></td>
</tr> </tr>
@endforeach
@endforeach @endif
@endif
</table> </table>
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
...@@ -174,8 +118,8 @@ ...@@ -174,8 +118,8 @@
@foreach($td as $key => $value) @foreach($td as $key => $value)
@if($value->td_overhead_note) @if($value->td_overhead_note)
<tr> <tr>
<td style="width: 15%" class="center aligned">{{ $value->td_date }}</td> <td style="width: 15%" class="center aligned">{{ data_get($value,'td_date') }}</td>
<td>{{ $value->td_overhead_note }}</td> <td>{{ data_get($value,'td_overhead_note') }}</td>
</tr> </tr>
@endif @endif
@endforeach @endforeach
......
...@@ -18,20 +18,20 @@ ...@@ -18,20 +18,20 @@
</td> </td>
<td>Name</td> <td>Name</td>
<td>:</td> <td>:</td>
<td>{{ $profile->STAFF_NAME }}</td> <td>{{ data_get($profile,'STAFF_NAME') }}</td>
<td rowspan="3"></td> <td rowspan="3"></td>
<td>Department</td> <td>Department</td>
<td>:</td> <td>:</td>
<td>{{ $profile->DEPARTMENT }}</td> <td>{{ data_get($profile,'DEPARTMENT') }}</td>
<td rowspan="3"></td> <td rowspan="3"></td>
</tr> </tr>
<tr> <tr>
<td>Staff No</td> <td>Staff No</td>
<td>:</td> <td>:</td>
<td>{{ $profile->STAFF_ID }}</td> <td>{{ data_get($profile,'STAFF_ID') }}</td>
<td>Reporting Manager</td> <td>Reporting Manager</td>
<td>:</td> <td>:</td>
<td>{{ $profile->HOD_NAME }}</td> <td>{{ data_get($profile,'HOD_NAME') }}</td>
</tr> </tr>
<tr> <tr>
<td>Month</td> <td>Month</td>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
?> ?>
@if($valchargehour) @if($valchargehour)
<td style="width: 4%;">{{ $valchargehour->td_hours }}</td> <td style="width: 4%;">{{ data_get($valchargehour,'td_hours') }}</td>
@else @else
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
@endif @endif
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
?> ?>
@if($valchargehour) @if($valchargehour)
<td style="width: 4%;">{{ $valchargehour->td_hours }}</td> <td style="width: 4%;">{{ data_get($valchargehour,'td_hours') }}</td>
@else @else
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
@endif @endif
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) { foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours; $totalcbyday += data_get($value,'td_hours');
} }
} }
?> ?>
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) { foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours; $totalcbyday += data_get($value,'td_hours');
} }
} }
?> ?>
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
?> ?>
@if($valnonchargehour) @if($valnonchargehour)
<td style="width: 4%;">{{ $valnonchargehour->td_hours }}</td> <td style="width: 4%;">{{ data_get($valnonchargehour,'td_hours') }}</td>
@else @else
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
@endif @endif
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
?> ?>
@if($valnonchargehour) @if($valnonchargehour)
<td style="width: 4%;">{{ $valnonchargehour->td_hours }}</td> <td style="width: 4%;">{{ data_get($valnonchargehour,'td_hours') }}</td>
@else @else
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
@endif @endif
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) { foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours; $totalncbyday += data_get($value,'td_hours');
} }
} }
?> ?>
...@@ -338,7 +338,7 @@ ...@@ -338,7 +338,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) { foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours; $totalncbyday += data_get($value,'td_hours');
} }
} }
?> ?>
...@@ -416,7 +416,7 @@ ...@@ -416,7 +416,7 @@
?> ?>
@if($valoverheadhour) @if($valoverheadhour)
<td style="width: 4%;">{{ $valoverheadhour->td_hours }}</td> <td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else @else
<td style="width: 4%;">0</td> <td style="width: 4%;">0</td>
@endif @endif
...@@ -441,7 +441,7 @@ ...@@ -441,7 +441,7 @@
?> ?>
@if($valoverheadhour) @if($valoverheadhour)
<td style="width: 4%;">{{ $valoverheadhour->td_hours }}</td> <td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else @else
<td style="width: 4%;">0</td> <td style="width: 4%;">0</td>
@endif @endif
...@@ -472,7 +472,7 @@ ...@@ -472,7 +472,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) { foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours; $totaloverheadbyday += data_get($value,'td_hours');
} }
} }
?> ?>
...@@ -488,7 +488,7 @@ ...@@ -488,7 +488,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) { foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours; $totaloverheadbyday += data_get($value,'td_hours');
} }
} }
?> ?>
...@@ -516,8 +516,8 @@ ...@@ -516,8 +516,8 @@
@if($notes) @if($notes)
@foreach($notes as $key => $value) @foreach($notes as $key => $value)
<tr> <tr>
<td>{{ $value->td_date }}</td> <td>{{ data_get($value,'td_date') }}</td>
<td>{{ $value->td_overhead_note }}</td> <td>{{ data_get($value,'td_overhead_note') }}</td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
...@@ -549,7 +549,7 @@ ...@@ -549,7 +549,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) { foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours; $totalncbyday += data_get($value,'td_hours');
} }
} }
...@@ -558,7 +558,7 @@ ...@@ -558,7 +558,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) { foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours; $totaloverheadbyday += data_get($value,'td_hours');
} }
} }
...@@ -580,7 +580,7 @@ ...@@ -580,7 +580,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) { foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours; $totalncbyday += data_get($value,'td_hours');
} }
} }
...@@ -589,7 +589,7 @@ ...@@ -589,7 +589,7 @@
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) { foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours; $totaloverheadbyday += data_get($value,'td_hours');
} }
} }
...@@ -621,7 +621,7 @@ ...@@ -621,7 +621,7 @@
$valcbyday = $chargehour->where('td_date','=', $date) $valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) { foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours; $totalcbyday += data_get($value,'td_hours');
} }
} }
...@@ -629,7 +629,7 @@ ...@@ -629,7 +629,7 @@
$valncbyday = $nonchargehour->where('td_date','=', $date) $valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) { foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours; $totalncbyday += data_get($value,'td_hours');
} }
} }
...@@ -637,7 +637,7 @@ ...@@ -637,7 +637,7 @@
$valoverheadbyday = $overheadhour->where('td_date','=', $date) $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) { foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours; $totaloverheadbyday += data_get($value,'td_hours');
} }
} }
...@@ -668,7 +668,7 @@ ...@@ -668,7 +668,7 @@
$valcbyday = $chargehour->where('td_date','=', $date) $valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) { foreach($valcbyday as $key => $value) {
$totalcbyday += $value->td_hours; $totalcbyday += data_get($value,'td_hours');
} }
} }
...@@ -676,7 +676,7 @@ ...@@ -676,7 +676,7 @@
$valncbyday = $nonchargehour->where('td_date','=', $date) $valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) { foreach($valncbyday as $key => $value) {
$totalncbyday += $value->td_hours; $totalncbyday += data_get($value,'td_hours');
} }
} }
...@@ -684,7 +684,7 @@ ...@@ -684,7 +684,7 @@
$valoverheadbyday = $overheadhour->where('td_date','=', $date) $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) { foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += $value->td_hours; $totaloverheadbyday += data_get($value,'td_hours');
} }
} }
...@@ -728,21 +728,10 @@ ...@@ -728,21 +728,10 @@
<tbody> <tbody>
<tr> <tr>
<?php $verifiername = $approvalname= ""; ?> <?php $verifiername = $approvalname= ""; ?>
<td class="center aligned">@if($check){{ $check->tm_submission_at }}@endif</td> <td class="center aligned">@if($check){{ data_get($check,'tm_submission_at') }}@endif</td>
<td class="center aligned">@if($check){{ $profile->HOD_NAME }}@endif</td> <td class="center aligned">@if($check->tm_verified_by){{ data_get($profile,'HOD_NAME') }}@endif</td>
<td class="center aligned">@if($check){{ $check->tm_verified_at }}@endif</td> <td class="center aligned">@if($check){{ data_get($check,'tm_verified_at') }}@endif</td>
<td class="center aligned"> <td class="center aligned">@if($check->tm_approved_by){{ data_get($profile,'BOD_NAME') }}@endif</td>
@if($check)
<?php
foreach ($bod as $key => $value) {
if ($check->tm_approved_by == $value->id) {
$approvalname = $value->fullname;
}
}
?>
{{$approvalname}}
@endif
</td>
<td class="center aligned">@if($check){{$check->tm_approved_at}}@endif</td> <td class="center aligned">@if($check){{$check->tm_approved_at}}@endif</td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -19,7 +19,7 @@ input[type=number] { ...@@ -19,7 +19,7 @@ input[type=number] {
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Chargeable Form</a> <a class="ui blue left ribbon label">Chargeable Form</a>
<br> <br>
<br> <!-- <br>
<form class="ui form"> <form class="ui form">
<div class="field"> <div class="field">
<div class="three fields"> <div class="three fields">
...@@ -37,7 +37,7 @@ input[type=number] { ...@@ -37,7 +37,7 @@ input[type=number] {
</div> </div>
</div> </div>
</div> </div>
</form> </form> -->
<br> <br>
@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.chargeableForm', ['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.chargeableForm', ['phase' => 2, 'month' => $month, 'year' => $year]) }}';">
......
...@@ -34,10 +34,10 @@ input[type=number] { ...@@ -34,10 +34,10 @@ input[type=number] {
<div class="default text">Task</div> <div class="default text">Task</div>
<div class="menu"> <div class="menu">
@foreach($nonchargeables as $key => $nonchargeable) @foreach($nonchargeables as $key => $nonchargeable)
<div class="item" data-value="{{ $nonchargeable->id }}"> <div class="item" data-value="{{ data_get($nonchargeable,'id') }}">
@foreach($pcodes as $key => $value) @foreach($pcodes as $key => $value)
@if($value->p_project_description == $nonchargeable->p_project_description) @if($value->p_project_description == $nonchargeable->p_project_description)
{{ $value->p_project_code }} - {{ data_get($value, 'p_project_code') }} -
@endif @endif
@endforeach @endforeach
{{ data_get($nonchargeable, 'p_project_description')}} {{ data_get($nonchargeable, 'p_project_description')}}
...@@ -67,25 +67,6 @@ input[type=number] { ...@@ -67,25 +67,6 @@ input[type=number] {
<a class="ui blue left ribbon label">Non-Chargeable Form</a> <a class="ui blue left ribbon label">Non-Chargeable Form</a>
<br> <br>
<br> <br>
<form class="ui form">
<div class="field">
<div class="three fields">
<div class="one wide field">
<label>Phase</label>
<input type="text" placeholder="Year" value="{{$phase}}" readonly="readonly">
</div>
<div class="one wide field">
<label>Month</label>
<input type="text" placeholder="Month" value="{{$month}}" readonly="readonly">
</div>
<div class="two wide field">
<label>Year</label>
<input type="text" placeholder="Year" value="{{$year}}" readonly="readonly">
</div>
</div>
</div>
</form>
<br>
@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]) }}';">
...@@ -314,19 +295,6 @@ input[type=number] { ...@@ -314,19 +295,6 @@ input[type=number] {
console.log("currenttotal --> " + currenttotal); console.log("currenttotal --> " + currenttotal);
// var currentTtotal = document.getElementById('total-'+pid).value;
// var total = document.getElementById('total-'+pid).value;
// if(total == null || total == 0){
// total = 0;
// }else{
// total = document.getElementById('total-'+pid).value;
// }
// if (input.value < 0) input.value = 0;
// if (input.value > 24) input.value = 24
// else total = Number(input.value)+Number(currentTtotal);
document.getElementById('total-'+pid).value = currenttotal; document.getElementById('total-'+pid).value = currenttotal;
} }
</script> </script>
......
...@@ -4,8 +4,11 @@ ...@@ -4,8 +4,11 @@
<div class="ui unstackable segment"> <div class="ui unstackable segment">
<a class="ui blue left ribbon label">Senarai Notes</a> <a class="ui blue left ribbon label">Senarai Notes</a>
<a href="{{ route('timesheet::form.penambahannote') }}" class="ui right floated small primary labeled icon button"> <a href="{{ route('timesheet::form.penambahannote') }}" class="ui right floated small yellow labeled icon button">
<i class="plus icon"></i>Add New Project <i class="plus icon"></i>Add New Notes
</a>
<a href="{{ route('timesheet::form.penambahannote') }}" class="ui right floated small yellow labeled icon button">
<i class="plus icon"></i>Add New Notes
</a><br> </a><br>
<table class="ui celled padded table"> <table class="ui celled padded table">
...@@ -30,7 +33,7 @@ ...@@ -30,7 +33,7 @@
</table> </table>
<button class="center aligned ui teal compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month]) }}';"> <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> <i class="angle double left icon"></i>
Back Overhead Form
</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]) }}';"> <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]) }}';">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
......
...@@ -21,47 +21,10 @@ input[type=number] { ...@@ -21,47 +21,10 @@ input[type=number] {
</div> </div>
</div> </div>
<!-- <div class="ui tiny modal description">
<div class="header">
Overhead Description
</div>
<div class="content">
<form class="ui form" action="{{ route('timesheet::form.addOverheadDescription') }}" method="POST">
{{csrf_field()}}
<input type="hidden" name="userId" value="{{$userId}}">
<input type="hidden" name="year" value="{{$year}}">
<input type="hidden" name="month" value="{{$month}}">
<input type="hidden" name="phase" value="{{$phase}}">
<div class="two fields">
<div class="six wide field">
<label>Task</label>
<select class="" name="task" required="required">
<option value="">Task</option>
@foreach($project as $key =>$value)
<option value="{{$value->o_overhead_desc}}">{{$value->o_overhead_desc}}</option>
@endforeach
</select>
</div>
<div class="five wide field">
<label>Date</label>
<input type="date" name="date" required>
</div>
</div>
<div class="field">
<label>Description</label>
<textarea rows="3" name="description" required></textarea>
</div>
<button class="ui close button">Cancel</button>
<button class="ui blue button" type="submit">Submit</button>
</form>
</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>
<br> <br>
<br> <!-- <form class="ui form">
<form class="ui form">
<div class="field"> <div class="field">
<div class="three fields"> <div class="three fields">
<div class="one wide field"> <div class="one wide field">
...@@ -78,13 +41,8 @@ input[type=number] { ...@@ -78,13 +41,8 @@ input[type=number] {
</div> </div>
</div> </div>
</div> </div>
</form> </form> -->
<br> <br>
<!-- <button class="center aligned ui green compact labeled icon button" id="description">
<i class="plus icon"></i>
Description
</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.overheadForm', ['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.overheadForm', ['phase' => 2, 'month' => $month, 'year' => $year]) }}';">
...@@ -178,7 +136,7 @@ input[type=number] { ...@@ -178,7 +136,7 @@ input[type=number] {
} }
?> ?>
<td > <td >
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> <input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@endfor @endfor
...@@ -201,7 +159,7 @@ input[type=number] { ...@@ -201,7 +159,7 @@ input[type=number] {
} }
?> ?>
<td > <td >
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> <input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@endfor @endfor
...@@ -357,19 +315,6 @@ input[type=number] { ...@@ -357,19 +315,6 @@ input[type=number] {
console.log("currenttotal --> " + currenttotal); console.log("currenttotal --> " + currenttotal);
// var currentTtotal = document.getElementById('total-'+pid).value;
// var total = document.getElementById('total-'+pid).value;
// if(total == null || total == 0){
// total = 0;
// }else{
// total = document.getElementById('total-'+pid).value;
// }
// if (input.value < 0) input.value = 0;
// if (input.value > 24) input.value = 24
// else total = Number(input.value)+Number(currentTtotal);
document.getElementById('total-'+pid).value = currenttotal; document.getElementById('total-'+pid).value = currenttotal;
} }
</script> </script>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<label>Task</label> <label>Task</label>
<select name="task" class="ui fluid dropdown"> <select name="task" class="ui fluid dropdown">
@foreach($task as $key => $value) @foreach($task as $key => $value)
<option value="{{$value->id}}">{{$value->o_overhead_desc}}</option> <option value="{{$value->id}}">{{data_get($value,'o_overhead_desc')}}</option>
@endforeach @endforeach
<option value="0">Others</option> <option value="0">Others</option>
</select> </select>
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::maintenance.updaterole' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.updaterole' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="id" value="{{$role->id}}"> <input type="hidden" name="id" value="{{data_get($role,'id')}}">
<div class="field"> <div class="field">
<label>Role Description</label> <label>Role Description</label>
<input type="text" name="role" value="{{$role->role}} "> <input type="text" name="role" value="{{data_get($role,'role')}} ">
</div> </div>
<div class="field"> <div class="field">
<label>Role Status</label> <label>Role Status</label>
......
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::maintenance.updateprojectteam')}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.updateprojectteam')}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="id" value="{{$team->id}} "> <input type="hidden" name="id" value="{{data_get($team,'id')}} ">
<input type="hidden" name="pid" value="{{$team->fk_project_id}} "> <input type="hidden" name="pid" value="{{data_get($team,'fk_project_id')}} ">
<div class="field"> <div class="field">
<label for="projectteam">Project Team</label> <label for="projectteam">Project Team</label>
<input type="text" name="projectteam" value="{{$team->pt_team}}" readonly="readonly"> <input type="text" name="projectteam" value="{{data_get($team,'pt_team')}}" readonly="readonly">
</div> </div>
<div class="field"> <div class="field">
<label>Role</label> <label>Role</label>
<select name="role" class="ui fluid dropdown"> <select name="role" class="ui fluid dropdown">
<option value="{{$team->role_id}}">{{$teamRole->role}}</option> <option value="{{data_get($team,'role_id')}}">{{data_get($teamRole,'role')}}</option>
@foreach($role as $key => $value) @foreach($role as $key => $value)
<option value="{{$value->id}} ">{{$value->role}}</option> <option value="{{data_get($value,'id')}} ">{{data_get($value,'role')}}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
......
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui blue left ribbon label">Edit Overhead</a>
<br><br>
<form class="ui form" action="{{ route('timesheet::maintenance.updateoverhead' )}}" method="POST">
{{csrf_field()}}
<input type="hidden" name="id" value="{{data_get($data,'id')}}">
<div class="field">
<label>Overhead Description</label>
<input type="text" name="description" value="{{ data_get($data,'o_overhead_desc') }}">
</div>
<div class="field">
<label>Role Status</label>
<select name="status" class="ui fluid dropdown">
<option value="1">Active</option>
<option value="0">Inactive</option>
</select>
</div>
<button class="ui green button" type="submit">Update</button>
</form>
</div>
@endsection
\ No newline at end of file
...@@ -6,27 +6,28 @@ ...@@ -6,27 +6,28 @@
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::maintenance.addnewproject' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.addnewproject' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<div class="field"> <div class="two fields">
<label>Project Code</label> <div class="five wide field">
<input type="text" name="projectcode" placeholder="Project Code"> <label>Project Code</label>
</div> <input type="text" name="projectcode" placeholder="Project Code">
<div class="field"> </div>
<label>Project Name</label> <div class="five wide field">
<input type="text" name="projectname" placeholder="Project Name"> <label>Project Name</label>
<input type="text" name="projectname" placeholder="Project Name">
</div>
</div> </div>
<div class="field"> <div class="field">
<label>Project Manager</label> <label>Project Manager</label>
<select name="projectmanager" class="ui fluid dropdown"> <select name="projectmanager" class="ui fluid dropdown">
<option value="">Project Manager</option> <option value="">Project Manager</option>
@foreach($pm as $key => $value) @foreach($pm as $key => $value)
<option value="{{$value->staff_id}}">{{$value->fullname}}</option> <option value="{{data_get($value,'staff_id')}}">{{data_get($value,'fullname')}}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
<div class="field"> <div class="field">
<label>Project Status</label> <label>Project Status</label>
<select name="status" class="ui fluid dropdown"> <select name="status" class="ui fluid dropdown">
<!-- <option value="">Project Status</option> -->
<option value="1">Active</option> <option value="1">Active</option>
<option value="0">Inactive</option> <option value="0">Inactive</option>
</select> </select>
......
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
<form class="ui form" action="{{ route('timesheet::maintenance.addprojectteam' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.addprojectteam' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="pid" value="{{$pid}}"> <input type="hidden" name="pid" value="{{$pid}}">
<input type="hidden" name="pcode" value="{{ $project->p_project_code }}"> <input type="hidden" name="pcode" value="{{ data_get($project,'p_project_code') }}">
<input type="hidden" name="pname" value="{{ $project->p_project_description }}"> <input type="hidden" name="pname" value="{{ data_get($project,'p_project_description') }}">
<div class="field"> <div class="field">
<label>Project Code</label> <label>Project Code</label>
<input onselect="myDepartment()" type="text" name="projectcode" placeholder="Project Code" value="{{ $project->p_project_code }} | {{ $project->p_project_description }}" readonly="readonly"> <input onselect="myDepartment()" type="text" name="projectcode" placeholder="Project Code" value="{{ data_get($project,'p_project_code') }} | {{ data_get($project,'p_project_description') }}" readonly="readonly">
</div> </div>
<div class="field"> <div class="field">
<label>Department</label> <label>Department</label>
<select onchange="selectDepartment(value);" name="department" id="department" class="ui fluid dropdown"> <select onchange="selectDepartment(value);" name="department" id="department" class="ui fluid dropdown">
<option value="">Department</option> <option value="">Department</option>
@foreach($departments as $key => $department) @foreach($departments as $key => $department)
<option value="{{$department->id}}">{{$department->code}} | {{$department->description}} </option> <option value="{{data_get($department,'id')}}">{{data_get($department,'code')}} | {{data_get($department,'description')}} </option>
@endforeach @endforeach
</select> </select>
</div> </div>
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
<div class="default text">Staff Name</div> <div class="default text">Staff Name</div>
<div class="menu" id="divstaff" name="divstaff"> <div class="menu" id="divstaff" name="divstaff">
@foreach($staffs as $key => $staff) @foreach($staffs as $key => $staff)
<div class="item" data-value="{{$staff->id}}" data-text="{{$staff->fullname}}"> <div class="item" data-value="{{data_get($staff,'id')}}" data-text="{{data_get($staff,'fullname')}}">
{{$staff->fullname}} {{data_get($staff,'fullname')}}
</div> </div>
@endforeach @endforeach
</div> </div>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<select name="role" class="ui fluid dropdown"> <select name="role" class="ui fluid dropdown">
<option value="">Role</option> <option value="">Role</option>
@foreach($roles as $key => $role) @foreach($roles as $key => $role)
<option value="{{$role->id}}"> {{$role->role}} </option> <option value="{{data_get($role,'id')}}"> {{data_get($role,'role')}} </option>
@endforeach @endforeach
</select> </select>
</div> </div>
...@@ -64,9 +64,7 @@ ...@@ -64,9 +64,7 @@
@push('script') @push('script')
<script> <script>
function myDepartment() { function myDepartment() {
alert('{{ data_get($project,'p_project_description') }}');
alert('{{ $project->p_project_description }}');
} }
</script> </script>
...@@ -97,11 +95,4 @@ function myDepartment() { ...@@ -97,11 +95,4 @@ function myDepartment() {
} }
</script> </script>
<!-- <script>
function selectedTeam() {
var selectBox = document.getElementById("selectBox");
var selectedValue = selectBox.options[selectBox.selectedIndex].value;
alert(selectedValue);
}
</script> -->
@endpush @endpush
\ No newline at end of file
@extends('ui::layouts.app') @extends('ui::layouts.app')
@section('content') @section('content')
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Senarai Overhead</a> <a class="ui blue left ribbon label">Senarai Overhead</a>
<a href="{{ route('timesheet::maintenance.penambahanOverhead')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Penambahan Lookup Overhead <a href="{{ route('timesheet::maintenance.penambahanOverhead')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Penambahan Lookup Overhead
...@@ -9,17 +10,22 @@ ...@@ -9,17 +10,22 @@
<table class="ui celled padded table"> <table class="ui celled padded table">
<thead> <thead>
<tr> <tr>
<th>No</th> <th style="width: 5%" class="center aligned">No</th>
<th>Overhead Lookup</th> <th>Overhead Lookup</th>
<th>Status</th> <th style="width: 10%" class="center aligned">Status</th>
<th style="width: 10%" class="center aligned">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($overheads as $key => $overhead) @foreach($overheads as $key => $overhead)
<tr> <tr>
<td>{{$key+1}} </td> <td class="center aligned">{{$key+1}} </td>
<td>{{$overhead['lkp_overhead']}} </td> <td>{{$overhead['lkp_overhead']}} </td>
<td>{{$overhead['status']}} </td> <td class="center aligned">{{$overhead['status']}} </td>
<td class="center aligned">
<a href="{{ route('timesheet::maintenance.editoverhead', ['id'=>data_get($overhead, ['id'])])}}" class="ui center aligned small olive button"><i class="edit icon"></i>Edit
</a>
</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -7,22 +7,22 @@ ...@@ -7,22 +7,22 @@
<a href="{{ route('timesheet::maintenance.penambahanPeranan')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Role <a href="{{ route('timesheet::maintenance.penambahanPeranan')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Role
</a> </a>
<br> <br>
<table class="ui celled padded table"> <table class="ui celled padded unstackable table">
<thead> <thead>
<tr> <tr>
<th>No</th> <th class="center aligned" style="width: 4%;">No</th>
<th>Role Description</th> <th>Role Description</th>
<th>Status</th> <th class="center aligned" style="width: 10%;">Status</th>
<th>Action</th> <th class="center aligned" style="width: 10%;">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($roles as $key => $role) @foreach($roles as $key => $role)
<tr> <tr>
<td>{{$key+1}} </td> <td class="center aligned">{{$key+1}} </td>
<td>{{$role['role']}} </td> <td>{{$role['role']}} </td>
<td>{{$role['status']}} </td> <td class="center aligned">{{$role['status']}} </td>
<td><a href="{{ route('timesheet::maintenance.editPeranan', ['id' => $role['id']]) }}">Edit</a></td> <td class="center aligned"><a href="{{ route('timesheet::maintenance.editPeranan', ['id' => $role['id']]) }}">Edit</a></td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -9,22 +9,22 @@ ...@@ -9,22 +9,22 @@
<input type="hidden" name="staffid" value="staffid"> <input type="hidden" name="staffid" value="staffid">
<div class="field"> <div class="field">
<label>Project Code</label> <label>Project Code</label>
<input type="text" name="projectcode" value="{{$project->p_project_code}}" disabled="disabled"> <input type="text" name="projectcode" value="{{data_get($project,'p_project_code')}}" disabled="disabled">
</div> </div>
<div class="field"> <div class="field">
<label>Project Name</label> <label>Project Name</label>
<input type="text" name="projectname" value="{{$project->p_project_description}}" disabled="disabled"> <input type="text" name="projectname" value="{{data_get($project,'p_project_description')}}" disabled="disabled">
</div> </div>
<div class="field"> <div class="field">
<label>Project Manager</label> <label>Project Manager</label>
<select name="projectmanager" class="ui fluid dropdown"> <select name="projectmanager" class="ui fluid dropdown">
<option value="{{$project->p_project_task_team}}"> <option value="{{data_get($project,'p_project_task_team')}}">
@foreach($pm as $key => $value) @foreach($pm as $key => $value)
@if($value->staff_id == $project->p_project_task_team){{$value->fullname}}@endif @if($value->staff_id == $project->p_project_task_team){{data_get($value,'fullname')}}@endif
@endforeach @endforeach
</option> </option>
@foreach($pm as $key => $value) @foreach($pm as $key => $value)
<option value="{{$value->staff_id}}">{{$value->fullname}}</option> <option value="{{data_get($value,'staff_id')}}">{{data_get($value,'fullname')}}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
......
...@@ -42,6 +42,8 @@ Route::group( ...@@ -42,6 +42,8 @@ Route::group(
Route::get('senaraiOverhead',['uses' => 'MaintenanceController@senaraiOverhead', 'as' => 'maintenance.senaraiOverhead']); Route::get('senaraiOverhead',['uses' => 'MaintenanceController@senaraiOverhead', 'as' => 'maintenance.senaraiOverhead']);
Route::get('penambahanOverhead',['uses' => 'MaintenanceController@penambahanOverhead', 'as' => 'maintenance.penambahanOverhead']); Route::get('penambahanOverhead',['uses' => 'MaintenanceController@penambahanOverhead', 'as' => 'maintenance.penambahanOverhead']);
Route::post('addoverheadlookup',['uses' => 'MaintenanceController@addoverheadlookup', 'as' => 'maintenance.addoverheadlookup']); Route::post('addoverheadlookup',['uses' => 'MaintenanceController@addoverheadlookup', 'as' => 'maintenance.addoverheadlookup']);
Route::get('editoverhead',['uses' => 'MaintenanceController@editoverhead', 'as' => 'maintenance.editoverhead']);
Route::post('updateoverhead',['uses' => 'MaintenanceController@updateoverhead', 'as' => 'maintenance.updateoverhead']);
Route::get('senaraiPeranan',['uses' => 'MaintenanceController@senaraiPeranan', 'as' => 'maintenance.senaraiPeranan']); Route::get('senaraiPeranan',['uses' => 'MaintenanceController@senaraiPeranan', 'as' => 'maintenance.senaraiPeranan']);
Route::get('penambahanPeranan',['uses' => 'MaintenanceController@penambahanPeranan', 'as' => 'maintenance.penambahanPeranan']); Route::get('penambahanPeranan',['uses' => 'MaintenanceController@penambahanPeranan', 'as' => 'maintenance.penambahanPeranan']);
......
...@@ -9,6 +9,7 @@ use Portal\Timesheet\Model\Users; ...@@ -9,6 +9,7 @@ use Portal\Timesheet\Model\Users;
use Portal\Timesheet\Model\Ts_master; use Portal\Timesheet\Model\Ts_master;
use Portal\Timesheet\Model\Ts_detail; use Portal\Timesheet\Model\Ts_detail;
use Portal\Timesheet\Model\Project; use Portal\Timesheet\Model\Project;
use Portal\Timesheet\Model\Tproject;
use Portal\Timesheet\Model\Department; use Portal\Timesheet\Model\Department;
use Portal\Timesheet\Model\Pteam; use Portal\Timesheet\Model\Pteam;
use Portal\Timesheet\Model\Staff_info; use Portal\Timesheet\Model\Staff_info;
...@@ -16,6 +17,7 @@ use Portal\Timesheet\Model\Overhead; ...@@ -16,6 +17,7 @@ use Portal\Timesheet\Model\Overhead;
use Portal\Timesheet\Model\Role; use Portal\Timesheet\Model\Role;
use Portal\Timesheet\Model\VwViewer; use Portal\Timesheet\Model\VwViewer;
use Portal\Timesheet\Model\VwReviewProfile; use Portal\Timesheet\Model\VwReviewProfile;
use Portal\Timesheet\Model\VwReviewDetails;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Input;
use File; use File;
...@@ -160,6 +162,12 @@ class DashboardController extends Controller ...@@ -160,6 +162,12 @@ class DashboardController extends Controller
->where('tm_phase', $request->phase) ->where('tm_phase', $request->phase)
->get() ; ->get() ;
$details = VwReviewDetails::where('year', $curryear)
->where('month', $request->month)
->where('phase', $request->phase)
->where('verifier', $hod->id)
->get();
$checktd = Ts_detail::where('tm_year', $curryear) $checktd = Ts_detail::where('tm_year', $curryear)
->where('tm_month', $request->month) ->where('tm_month', $request->month)
->where('tm_phase', $request->phase) ->where('tm_phase', $request->phase)
...@@ -167,24 +175,7 @@ class DashboardController extends Controller ...@@ -167,24 +175,7 @@ class DashboardController extends Controller
->orwhereNotNull('td_overhead_note') ->orwhereNotNull('td_overhead_note')
->get(); ->get();
$cpt = Pteam::where('pt_project_type', 1) return view('timesheet::dashboard.timesheetReview', compact('profile', 'staffs', 'details', 'checkts', 'checktd'));
->get();
$ncpt = Pteam::where('pt_project_type', 2)
->get();
$cp = Project::where('p_project_sts', 1)
->where('p_project_type', 1)
->get();
$ncp = Project::where('p_project_sts', 1)
->where('p_project_type', 2)
->get();
$pmname = Staff_info::where('fk_lkp_department', 4)
->get();
return view('timesheet::dashboard.timesheetReview', compact('profile', 'staffs', 'checkts', 'checktd', 'cpt', 'ncpt', 'cp', 'ncp', 'pmname'));
} }
public function revaction(Request $request) public function revaction(Request $request)
...@@ -214,7 +205,11 @@ class DashboardController extends Controller ...@@ -214,7 +205,11 @@ class DashboardController extends Controller
]); ]);
$td = Ts_detail::where('fk_tm_id', $request->tmid) $td = Ts_detail::where('fk_tm_id', $request->tmid)
->update([ 'td_timesheet_sts' => 3 ]); ->update([ 'td_timesheet_sts' => 3 ]);
$tp = Tproject::where('fk_tm_id', $request->tmid)
->update(['tp_timesheet_sts' => 3]);
} else { } else {
dd('rejected'); dd('rejected');
} }
...@@ -343,7 +338,7 @@ class DashboardController extends Controller ...@@ -343,7 +338,7 @@ class DashboardController extends Controller
$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[0] = ""; $tempOverhead[0] = "";
...@@ -413,6 +408,7 @@ class DashboardController extends Controller ...@@ -413,6 +408,7 @@ class DashboardController extends Controller
public function tsubmit(Request $request) public function tsubmit(Request $request)
{ {
$today = Carbon::today()->toDateString(); $today = Carbon::today()->toDateString();
$submit = 2; $submit = 2;
...@@ -429,6 +425,9 @@ class DashboardController extends Controller ...@@ -429,6 +425,9 @@ class DashboardController extends Controller
$td = Ts_detail::where('fk_tm_id', $request->tid) $td = Ts_detail::where('fk_tm_id', $request->tid)
->update([ 'td_timesheet_sts' => 2 ]); ->update([ 'td_timesheet_sts' => 2 ]);
$tp = Tproject::where('fk_tm_id', $request->tid)
->update(['tp_timesheet_sts' => 2]);
return redirect()->route('timesheet::dashboard.index')->withSuccess('Timesheet has been submitted!'); return redirect()->route('timesheet::dashboard.index')->withSuccess('Timesheet has been submitted!');
} }
......
...@@ -379,7 +379,8 @@ class MaintenanceController extends Controller ...@@ -379,7 +379,8 @@ class MaintenanceController extends Controller
public function senaraiOverhead() public function senaraiOverhead()
{ {
$overhead = Overhead::all(); $overhead = Overhead::where('o_overhead_sts', 1)
->get();
$overheads = []; $overheads = [];
...@@ -416,6 +417,24 @@ class MaintenanceController extends Controller ...@@ -416,6 +417,24 @@ class MaintenanceController extends Controller
->with('success', 'Role Updated'); ->with('success', 'Role Updated');
} }
public function editoverhead(Request $request)
{
$data = Overhead::where('id',$request->id)
->first();
return view('timesheet::maintenance.editoverhead', compact('data'));
}
public function updateoverhead(Request $request)
{
$data = Overhead::where('id', $request->id)
->update([
'o_overhead_desc' => $request->description,
'o_overhead_sts' => $request->status
]);
return redirect()->route('timesheet::maintenance.senaraiOverhead');
}
public function loadstaff($dept) public function loadstaff($dept)
{ {
$staffs = Staff_info::where('fk_lkp_department',$dept) $staffs = Staff_info::where('fk_lkp_department',$dept)
......
<?php
namespace Portal\Timesheet\Model;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class VwReviewDetails extends Model
{
use Notifiable;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'vw_review_details';
/**
* undocumented function
*
* @return void
* @author
**/
public function info()
{
}
}
...@@ -55,7 +55,7 @@ class ServiceProvider extends BaseServiceProvider ...@@ -55,7 +55,7 @@ class ServiceProvider extends BaseServiceProvider
->data('icon', 'tachometer alternate icon') ->data('icon', 'tachometer alternate icon')
->active('home/*'); ->active('home/*');
$dashboard->add(__('vwviewer'), url('/vwviewer/')) $dashboard->add(__('VW Viewer'), url('/vwviewer/'))
->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'))
......
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