Commit d37f6e18 by hannan

changes in timesheet

parent 27511bf4
<?php
namespace App\Exports;
use App\User;
// use Illuminate\Contracts\Support\Responsable;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
// class UsersExport implements FromCollection, Responsable
class UsersExport implements FromView, ShouldAutoSize
{
use Exportable;
// private $fileName = "Ringkasan Laporan.xlsx";
/**
* @return \Illuminate\Support\Collection
*/
public function view(): View
{
// dd(User::all());
return view('timesheet::exports.users', [
'users' => User::all()
]);
}
}
...@@ -760,6 +760,7 @@ ...@@ -760,6 +760,7 @@
</div> </div>
<br> <br>
@if($curruser->id == $user->penyokong) @if($curruser->id == $user->penyokong)
<button type="button" class="ui green button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetReview',[ 'phase' => $phase, 'month' => $month ]) }}';">Back</button> <button type="button" class="ui green button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetReview',[ 'phase' => $phase, 'month' => $month ]) }}';">Back</button>
......
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
@foreach($users as $key => $user)
<tr>
<td>{{ $user->name }}</td>
<td>{{ $user->email }}</td>
</tr>
@endforeach
</tbody>
</table>
\ No newline at end of file
...@@ -18,38 +18,10 @@ input[type=number] { ...@@ -18,38 +18,10 @@ 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>
<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> <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 -->
<button class="center aligned ui violet compact right labeled icon button" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';"> <button class="center aligned ui violet compact right labeled icon button" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
Non-Chargeable Form Non-Chargeable Form
...@@ -155,8 +127,6 @@ input[type=number] { ...@@ -155,8 +127,6 @@ input[type=number] {
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<?php <?php
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
......
...@@ -63,10 +63,15 @@ input[type=number] { ...@@ -63,10 +63,15 @@ input[type=number] {
<i class="angle double left icon"></i> <i class="angle double left icon"></i>
Non-Chargeable Form Non-Chargeable Form
</button> </button>
<button class="right floated 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> @if($checkoverhead)
Notes <button class="right floated 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] ) }} ';">
</button> <i class="plus icon"></i>
Notes
</button>
@else
@endif
<button class="center aligned ui pink compact right labeled icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';"> <button class="center aligned ui pink 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>
Timesheet Viewer Timesheet Viewer
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<option value="0">Inactive</option> <option value="0">Inactive</option>
</select> </select>
</div> </div>
<button class="ui button" type="submit">Add</button> <button class="ui blue button" type="submit">Add</button>
</form> </form>
</div> </div>
@endsection @endsection
\ No newline at end of file
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
@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">List of 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>Add Overhead Lookup
</a> </a>
<br> <br>
<table class="ui celled padded table"> <table class="ui celled padded table">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
@section('content') @section('content')
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Senarai Project</a> <a class="ui blue left ribbon label">List of Project</a>
<a href="{{ route('timesheet::maintenance.penambahanProject')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Project <a href="{{ route('timesheet::maintenance.penambahanProject')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Project
</a> </a>
<br> <br>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
@section('content') @section('content')
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Senarai Project Team</a> <a class="ui blue left ribbon label">List of Project Team</a>
<a href="{{ route('timesheet::maintenance.penambahanProjectTeam', ['id' => $pid]) }} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Project Team <a href="{{ route('timesheet::maintenance.penambahanProjectTeam', ['id' => $pid]) }} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Project Team
</a> </a>
<br> <br>
...@@ -28,7 +28,10 @@ ...@@ -28,7 +28,10 @@
<td>{{$project['projectteam']}} </td> <td>{{$project['projectteam']}} </td>
<td>{{ data_get($project, 'role') }}</td> <td>{{ data_get($project, 'role') }}</td>
<td>{{$project['status']}} </td> <td>{{$project['status']}} </td>
<td><a href="{{ route('timesheet::maintenance.editprojectteam', ['id' => $project['id']])}} ">Edit</a></td> <td>
<button class="compact ui button" onclick="window.location.href='{{ route('timesheet::maintenance.editprojectteam', ['id' => $project['id']])}}';">Edit
</button>
</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -408,14 +408,15 @@ class DashboardController extends Controller ...@@ -408,14 +408,15 @@ class DashboardController extends Controller
->first(); ->first();
// dd(Staff_info::all()); // dd(Staff_info::all());
$hod = Staff_info::find($user->penyokong) // $hod = Staff_info::find($user->penyokong)
->fullname; // ->fullname;
$penyokong = Staff_info::where('penyokong', 0)
->get();
$bod = Staff_info::select('id', 'fullname') // $penyokong = Staff_info::where('penyokong', 0)
->whereIn('id', [1,45,46,47,48]) // ->get();
->get(); // dd($penyokong);
// $bod = Staff_info::select('id', 'fullname')
// ->whereIn('id', [1,45,46,47,48])
// ->get();
$year = date('Y'); $year = date('Y');
...@@ -576,7 +577,7 @@ class DashboardController extends Controller ...@@ -576,7 +577,7 @@ class DashboardController extends Controller
} }
// dd($check->id); // dd($check->id);
return view('timesheet::dashboard.timesheetViewer', compact('curruser', 'user','profile', 'dept', 'hod', 'phase', 'month', 'year', 'strMonth', 'daymonth', 'chargeablelist', 'nonchargeablelist', 'overheadlist', 'chargehour', 'nonchargehour', 'totalchargehrs', 'totalnonchargehrs', 'totaloverheadhrs', 'overheadhour', 'notes', 'check', 'strdays', 'penyokong', 'bod')); return view('timesheet::dashboard.timesheetViewer', compact('curruser', 'user','profile', 'dept', 'phase', 'month', 'year', 'strMonth', 'daymonth', 'chargeablelist', 'nonchargeablelist', 'overheadlist', 'chargehour', 'nonchargehour', 'totalchargehrs', 'totalnonchargehrs', 'totaloverheadhrs', 'overheadhour', 'notes', 'check', 'strdays'));
} }
public function tsubmit(Request $request) public function tsubmit(Request $request)
......
...@@ -729,9 +729,6 @@ class FormController extends Controller ...@@ -729,9 +729,6 @@ class FormController extends Controller
->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($checkoverhead) if($checkoverhead)
{ {
...@@ -749,7 +746,7 @@ class FormController extends Controller ...@@ -749,7 +746,7 @@ class FormController extends Controller
// dd($checkoverhead->id); // dd($checkoverhead->id);
return view('timesheet::form.overheadForm', compact('projectlist','userId','month','phase','daymonth','year', 'hour', 'project', 'fk_tm_id', 'strdays')); return view('timesheet::form.overheadForm', compact('checkoverhead','projectlist','userId','month','phase','daymonth','year', 'hour', 'project', 'fk_tm_id', 'strdays'));
} }
public function saveoverheadhours(Request $request) public function saveoverheadhours(Request $request)
......
...@@ -436,7 +436,7 @@ class MaintenanceController extends Controller ...@@ -436,7 +436,7 @@ class MaintenanceController extends Controller
$data->save(); $data->save();
return redirect()->route('timesheet::maintenance.senaraiOverhead') return redirect()->route('timesheet::maintenance.senaraiOverhead')
->with('success', 'Role Updated'); ->with('success', 'Overhead lookup added!');
} }
public function editoverhead(Request $request) public function editoverhead(Request $request)
...@@ -454,7 +454,8 @@ class MaintenanceController extends Controller ...@@ -454,7 +454,8 @@ class MaintenanceController extends Controller
'o_overhead_desc' => $request->description, 'o_overhead_desc' => $request->description,
'o_overhead_sts' => $request->status 'o_overhead_sts' => $request->status
]); ]);
return redirect()->route('timesheet::maintenance.senaraiOverhead'); return redirect()->route('timesheet::maintenance.senaraiOverhead')
->with('success', 'Overhead lookup updated!');
} }
public function loadstaff($dept) public function loadstaff($dept)
......
...@@ -40,18 +40,6 @@ use Maatwebsite\Excel\Facades\Excel; ...@@ -40,18 +40,6 @@ use Maatwebsite\Excel\Facades\Excel;
class ReportController extends Controller class ReportController extends Controller
{ {
public function export(Request $request)
{
// dd($request);
$month = date('F', mktime(0,0,0,$request->month, 1, date('Y')));
$year = strval($request->year);
return (new UsersExport)->download('Ringkasan Laporan '.$month.' '.$year.'.xlsx');
// return new UsersExport;
}
public function ringkasanLaporan() public function ringkasanLaporan()
{ {
$dept = Department::all() $dept = Department::all()
......
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