Commit 0afec7d0 by Azhan Hannan

Log Pia #131 -> BDD

parent 18ac43da
...@@ -220,9 +220,9 @@ ...@@ -220,9 +220,9 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td style="width: 4%;"></td> <td style="width: 15%;">{{ data_get($staff,'attachment.filename') }}</td>
<td> <td>
<a href="{{ asset(data_get($value,'attachment.path'))}}" target="_blank"> <a href="{{ asset(data_get($staff,'attachment.path'))}}" target="_blank">
<button class="ui active button"> <button class="ui active button">
<i class="download icon"></i> <i class="download icon"></i>
......
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id')) @if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr> <tr>
<td style="width: 25;">{{data_get($tp, 'tp_project_name')}}</td> <td style="width: 25%;">{{data_get($tp, 'tp_project_name')}}</td>
<td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td> <td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned"> <td style="width: 10%;" class="center aligned">
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }} {{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }}
......
...@@ -133,12 +133,18 @@ ...@@ -133,12 +133,18 @@
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
@if( data_get($staffinfo,'fk_lkp_department') == '7' && data_get($staffinfo,'penyokong') == '0' )
<th style="width: 20%;">Overhead</th>
<th style="width: 20%;">Approver</th>
<th style="width: 35%;">Bod Remarks</th>
@else
<th style="width: 17%;">Overhead</th> <th style="width: 17%;">Overhead</th>
<th style="width: 15%;">Verifier</th> <th style="width: 15%;">Verifier</th>
<!-- <th style="width: 5%;" class="center aligned">Total Hours</th>
<th style="width: 5%;" class="center aligned">Total Days</th> -->
<th style="width: 20%;">Hod Remarks</th> <th style="width: 20%;">Hod Remarks</th>
<th style="width: 20%;">Bod Remarks</th> <th style="width: 20%;">Bod Remarks</th>
@endif
<!-- <th style="width: 5%;" class="center aligned">Total Hours</th>
<th style="width: 5%;" class="center aligned">Total Days</th> -->
<th style="width: 13%;" class="text-center">Status</th> <th style="width: 13%;" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th> <th style="width: 12%;" class="text-center">Action</th>
</tr> </tr>
...@@ -150,12 +156,18 @@ ...@@ -150,12 +156,18 @@
@else @else
@foreach($overhead as $key => $tpoverhead) @foreach($overhead as $key => $tpoverhead)
<tr> <tr>
<td style="width: 15;">{{data_get($tpoverhead,'tp_project_name')}}</td> @if( data_get($staffinfo,'fk_lkp_department') == '7' && data_get($staffinfo,'penyokong') == '0' )
<td style="width: 15;" class="single line">{{data_get($tpoverhead,'hod.fullname')}}</td> <td style="width: 20%;">{{data_get($tpoverhead,'tp_project_name')}}</td>
<!-- <td style="width: 5%;" class="center aligned">{{data_get($tpoverhead,'tp_hours')}}</td> <td style="width: 20%;" class="single line">{{data_get($tpoverhead,'bod.fullname')}}</td>
<td style="width: 5%;" class="center aligned">{{data_get($tpoverhead,'tp_hours')/8}}</td> --> <td style="width: 35%;">{{data_get($tpoverhead,'approver_remark')}}</td>
@else
<td style="width: 15%;">{{data_get($tpoverhead,'tp_project_name')}}</td>
<td style="width: 20%;">{{data_get($tpoverhead,'verifier_remark')}}</td> <td style="width: 20%;">{{data_get($tpoverhead,'verifier_remark')}}</td>
<td style="width: 15%;" class="single line">{{data_get($tpoverhead,'hod.fullname')}}</td>
<td style="width: 20%;">{{data_get($tpoverhead,'approver_remark')}}</td> <td style="width: 20%;">{{data_get($tpoverhead,'approver_remark')}}</td>
@endif
<!-- <td style="width: 5%;" class="center aligned">{{data_get($tpoverhead,'tp_hours')}}</td>
<td style="width: 5%;" class="center aligned">{{data_get($tpoverhead,'tp_hours')/8}}</td> -->
<td style="width: 13%;" class="text-center"> <td style="width: 13%;" class="text-center">
@if(data_get($tpoverhead,'tp_timesheet_sts') == 1) Draft @if(data_get($tpoverhead,'tp_timesheet_sts') == 1) Draft
@elseif(data_get($tpoverhead,'tp_timesheet_sts') == 2) Submitted @elseif(data_get($tpoverhead,'tp_timesheet_sts') == 2) Submitted
......
...@@ -32,13 +32,6 @@ ...@@ -32,13 +32,6 @@
<br> <br>
@if(data_get($staff,'fk_lkp_department') == 7)
<button type="button" class="right floated aligned ui olive compact labeled icon button" id="uploadmodal">
<i class="file icon"></i>
Upload File
</button>
@endif
<form class="ui form horizontal" action="{{ route('timesheet::form.savenote') }}" method="POST"> <form class="ui form horizontal" action="{{ route('timesheet::form.savenote') }}" method="POST">
{{csrf_field()}} {{csrf_field()}}
...@@ -52,6 +45,13 @@ ...@@ -52,6 +45,13 @@
</a> --> </a> -->
@if(data_get($staff,'fk_lkp_department') == 7)
<button type="button" class="right floated aligned ui olive compact labeled icon button" id="uploadmodal">
<i class="file icon"></i>
Upload Files
</button>
@endif
@if($page) @if($page)
<input type="hidden" name="page" value="{{$page}}"> <input type="hidden" name="page" value="{{$page}}">
......
...@@ -193,6 +193,11 @@ class DashboardController extends Controller ...@@ -193,6 +193,11 @@ class DashboardController extends Controller
if (($roleid == ('5'||'6'))) { if (($roleid == ('5'||'6'))) {
$staffinfo = Staff_info::where('id',Auth::id())
->with('pelulus')
->first();
// dd($staffinfo);
$staffid = Users::find(Auth::id()) $staffid = Users::find(Auth::id())
->u_staffID; ->u_staffID;
...@@ -211,6 +216,7 @@ class DashboardController extends Controller ...@@ -211,6 +216,7 @@ class DashboardController extends Controller
->with('project') ->with('project')
->with('overhead') ->with('overhead')
->with('hod') ->with('hod')
->with('bod')
->get(); ->get();
// dd($projects); // dd($projects);
...@@ -221,7 +227,7 @@ class DashboardController extends Controller ...@@ -221,7 +227,7 @@ class DashboardController extends Controller
} }
)->paginate(15); )->paginate(15);
return view('timesheet::dashboard.dashboardstaff',compact('user', 'timesheet', 'staffs', 'projects')); return view('timesheet::dashboard.dashboardstaff',compact('user', 'timesheet', 'staffs', 'projects', 'roleid', 'staffinfo'));
}if ($roleid == '3') { }if ($roleid == '3') {
...@@ -1259,7 +1265,7 @@ class DashboardController extends Controller ...@@ -1259,7 +1265,7 @@ class DashboardController extends Controller
->update( ->update(
[ [
'tm_timesheet_master_sts' => 5, 'tm_timesheet_master_sts' => 5,
'bod_rejected_at' => $today, 'bod_dissaproved_at' => $today,
]); ]);
} }
...@@ -1626,6 +1632,23 @@ class DashboardController extends Controller ...@@ -1626,6 +1632,23 @@ class DashboardController extends Controller
if( $roleid == '9' ) if( $roleid == '9' )
{ {
$checkpmhod = Tproject::where('tp_project_type', 1)
->where('fk_tm_id',$request->tid)
->first();
if ($checkpmhod)
{
Ts_detail::where('fk_tm_id', $request->tid)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->tid)
->update([
'tp_timesheet_sts' => 3,
'verifier_remark' => 'Verified',
] );
}
else
{
Ts_master::where('id', $request->tid) Ts_master::where('id', $request->tid)
->update([ 'tm_timesheet_master_sts' => 3 ]); ->update([ 'tm_timesheet_master_sts' => 3 ]);
...@@ -1638,6 +1661,7 @@ class DashboardController extends Controller ...@@ -1638,6 +1661,7 @@ class DashboardController extends Controller
'verifier_remark' => 'Verified', 'verifier_remark' => 'Verified',
] ); ] );
} }
}
if( ($roleid != ('9'||'2'||'8')) && (data_get($user,'penyokong') == '0') ) if( ($roleid != ('9'||'2'||'8')) && (data_get($user,'penyokong') == '0') )
{ {
...@@ -1651,6 +1675,46 @@ class DashboardController extends Controller ...@@ -1651,6 +1675,46 @@ class DashboardController extends Controller
->update([ 'tp_timesheet_sts' => 3] ); ->update([ 'tp_timesheet_sts' => 3] );
} }
if ( (data_get($user,'penyokong') == '0') && (data_get($user,'fk_lkp_department') == '7'))
{
// dd('bdd & takde penyokong')
$checkbdd = Tproject::where('tp_project_type', 1)
->where('fk_tm_id',$request->tid)
->first();
if ($checkbdd)
{
Ts_detail::where('fk_tm_id', $request->tid)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->tid)
->update([
'tp_timesheet_sts' => 3,
'tp_verified_at' => today()->toDateString(),
'verifier_remark' => 'verified',
]);
}
else
{
Ts_master::where('id', $request->tid)
->update([
'tm_timesheet_master_sts' => 3,
'tm_verified_at' => today()->toDateString(),
]);
Ts_detail::where('fk_tm_id', $request->tid)
->update([ 'td_timesheet_sts' => 3 ]);
Tproject::where('fk_tm_id', $request->tid)
->update([
'tp_timesheet_sts' => 3,
'tp_verified_at' => today()->toDateString(),
'verifier_remark' => 'verified',
]);
}
}
// dd($user->penyokong);
return redirect()->route('timesheet::dashboard.index')->withSuccess('Timesheet has been submitted!'); return redirect()->route('timesheet::dashboard.index')->withSuccess('Timesheet has been submitted!');
} }
......
...@@ -33,6 +33,16 @@ class Staff_info extends Model ...@@ -33,6 +33,16 @@ class Staff_info extends Model
return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','penyokong'); return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','penyokong');
} }
public function penyokong()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','penyokong');
}
public function pelulus()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','pelulus');
}
// public function infopelulus() // public function infopelulus()
// { // {
// return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','pelulus'); // return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','pelulus');
......
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