Commit 27db5a1f by Azhan Hannan

HR Dashboard - accesss untuk review semua timesheet staff

parent c051f0cf
......@@ -27,5 +27,6 @@ final class Permission extends Enum
const pmverify = 'pmverify';
const pdapproval = 'pdapproval';
const tsapproval = 'tsapproval';
const stafftimesheet = 'stafftimesheet';
}
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui blue left ribbon label">Select Month & Phase</a>
<br><br>
<form class="ui form" action="{{ route('timesheet::dashboard.hrstaffstimesheet') }}" method="POST">
{{csrf_field()}}
<div class="@if($currmonth == 1) three fields @else two fields @endif">
<div class="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="field">
<label>Phase</label>
<select name="phase" class="ui fluid dropdown" required="required">
<option value="1">1st Half-month</option>
<option value="2">2nd Half-month</option>
</select>
</div>
@if($currmonth == 1)
<div class="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>
@else
<div class="field">
<label>Year</label>
<input type="text" name="year" class="ui fluid dropdown" value="{{ $curryear }}" readonly="readonly">
</div>
@endif
</div>
<div class="two fields">
<div class="field">
<label>Department</label>
<select onchange="selectDepartment(value);"
name="department"
id="department"
class="ui fluid dropdown">
<option value="">Department</option>
@foreach($departments as $key => $department)
<option value="{{data_get($department,'id')}}">{{data_get($department,'code')}} | {{data_get($department,'description')}} </option>
@endforeach
</select>
</div>
<div class="field">
<label>Staff Name</label>
<div class="ui fluid search selection dropdown">
<input type="hidden" name="staffId">
<i class="dropdown icon"></i>
<div class="default text">Staff Name</div>
<div class="menu" id="divstaff" name="divstaff">
</div>
</div>
</div>
</div>
<button class="ui green button" type="submit">View Timesheet</button>
</form>
</div>
@endsection
@push('script')
<script>
function selectDepartment(i) {
// alert(i);
$.ajax({
url: "{{ URL::to('ajax/stafflist')}}"+"/"+i,
type: "get",
beforeSend: function ()
{
// $("#exampleModalCenter").modal('show');
block('loading-screen');
},
success: function(html)
{
// document.getElementById('nhtml2').style.display = 'none';
// $("#exampleModalCenter").modal('hide');
$('#divstaff').html(html);
// window.location.replace("{{ URL::to('ad/index')}}");
unblock('loading-screen');
}
});
}
</script>
@endpush
\ No newline at end of file
......@@ -28,6 +28,8 @@ Route::group(
Route::get('filterReview',['uses' => 'DashboardController@filterReview', 'as' => 'dashboard.filterReview']);
Route::get('filterViewer',['uses' => 'DashboardController@filterViewer', 'as' => 'dashboard.filterViewer']);
Route::get('filterApproval',['uses' => 'DashboardController@filterApproval', 'as' => 'dashboard.filterApproval']);
Route::get('filterHrStaffsTimesheet',['uses' => 'DashboardController@filterHrStaffsTimesheet', 'as' => 'dashboard.filterHrStaffsTimesheet']);
Route::post('hrstaffstimesheet',['uses' => 'DashboardController@hrstaffstimesheet', 'as' => 'dashboard.hrstaffstimesheet']);
Route::post('pmverifyselectmonthphase', ['uses' => 'DashboardController@pmverifyselectmonthphase', 'as' => 'dashboard.pmverifyselectmonthphase']);
Route::post('reviewselectmonthphase', ['uses' => 'DashboardController@reviewselectmonthphase', 'as' => 'dashboard.reviewselectmonthphase']);
Route::post('viewerselectmonthphase', ['uses' => 'DashboardController@viewerselectmonthphase', 'as' => 'dashboard.viewerselectmonthphase']);
......@@ -45,7 +47,6 @@ Route::group(
Route::get('approveallaction', ['uses' => 'DashboardController@approveallaction', 'as' => 'dashboard.approveallaction']);
Route::post('approvalall', ['uses' => 'DashboardController@approvalall', 'as' => 'dashboard.approvalall']);
//laporan
Route::get('ringkasanLaporan', ['uses' => 'ReportController@ringkasanLaporan', 'as' => 'report.ringkasanLaporan']);
Route::post('generateRingkasan', ['uses' => 'ReportController@generateRingkasan', 'as' => 'report.generateRingkasan']);
......
......@@ -2201,4 +2201,37 @@ class DashboardController extends Controller
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected successfully');
}
}
public function filterHrStaffsTimesheet()
{
$currmonth = date('n');
$curryear = date('Y');
$month = [];
for ($m=1; $m<=12; $m++) {
$month[] = date('F', mktime(0,0,0,$m, 1, date('Y')));
}
$departments = Department::all()
->except([7,8]);
// ->except($departments->code,['']);
foreach ($departments as $key => $value)
{
$staffs = Users::with('toStaffInfo')
->where('status','ACTIVE')
->get();
}
return view('timesheet::dashboard.filterHrStaffsTimesheet', compact('month', 'curryear', 'currmonth', 'departments', 'staffs'));
}
public function hrstaffstimesheet(Request $request){
// dd($request);
$user = Staff_info::where('fk_users', data_get($request,'staffId'))->first();
return redirect()->route('timesheet::dashboard.timesheetViewer', ['phase' => $request->phase, 'month' =>$request->month, 'user'=>$user->staff_id, 'year'=>$request->year]);
}
}
\ No newline at end of file
......@@ -106,16 +106,20 @@ class ServiceProvider extends BaseServiceProvider
$laporan = $this->app['laravolt.menu']->add(__('Report'))->data('icon', 'align justify');
$laporan->add(__('Report Summary'), route('timesheet::report.ringkasanLaporan'))
->data('icon', 'file alternate outline icon')
->active('pengurusan/*')
->active('laporan/*')
->data('permission', Permission::laporan);
$laporan->add(__('Report by Project'), route('timesheet::report.projectReport'))
->data('icon', 'file alternate outline icon')
->active('pengurusan/*')
->active('laporan/*')
->data('permission', Permission::laporan);
$laporan->add(__('Report by Department'), route('timesheet::report.deptreport'))
->data('icon', 'file alternate outline icon')
->active('pengurusan/*')
->data('permission', Permission::laporan);
->active('laporan/*')
->data('permission', Permission::laporan);
$laporan->add(__('Staff Timesheets'), route('timesheet::dashboard.filterHrStaffsTimesheet'))
->data('icon', 'file alternate outline icon')
->active('laporan/*')
->data('permission', Permission::stafftimesheet);
$Projek = $this->app['laravolt.menu']->add(__('Project Management'))->data('icon', 'align justify');
$Projek->add(__('List of Project'), route('timesheet::maintenance.senaraiProject'))
......
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