Commit 10dcfc09 by Azhan Hannan

cosmetic - set button export to the left. option to filter report summary by department or by all.

parent 0b78a1ff
......@@ -7,7 +7,7 @@
Report Summary
</div>
<button class="right floated center aligned ui violet compact labeled icon button" onclick="window.location.href='{{ route('timesheet::export.exportsummary', ['month'=> $intmonth, 'year'=> $year]) }}';">
<button class="floated center aligned ui violet compact labeled icon button" onclick="window.location.href='{{ route('timesheet::export.exportsummary', ['month'=> $intmonth, 'year'=> $year]) }}';">
<i class="file excel outline icon"></i>
Export to Excel
</button>
......
......@@ -12,6 +12,7 @@
<div class="five wide field">
<label>Department</label>
<select name="dept" class="ui fluid dropdown" required="required">
<option value="all">All staffs</option>
@foreach($dept as $key => $value)
<option value="{{data_get($value, 'id')}}">{{ data_get($value,'description') }}</option>
@endforeach
......
......@@ -83,11 +83,19 @@ class ReportController extends Controller
// dd($ovhours);
$chargeproject = VwChargeable::all();
// $nonchargeproject = VwNonChargeable::all();
$staffs = VwStaff::orderby('deptID')
->where('deptID','!=', 8)
->where('deptID', $request->dept)
if ($request->dept == 'all') {
$staffs = VwStaff::orderby('deptID')
->where('deptID','!=', 8)
->get();
}
else
{
$staffs = VwStaff::orderby('deptID')
->where('deptID','!=', 8)
->where('deptID', $request->dept)
->get();
}
$year = date('Y');
if ($request->year) {
......
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