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 @@
</div>
<br>
@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>
......
<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] {
<div class="ui segment">
<a class="ui blue left ribbon label">Chargeable Form</a>
<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)
<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]) }}';">
<i class="angle double right icon"></i>
Non-Chargeable Form
......@@ -155,8 +127,6 @@ input[type=number] {
@for($i = 15; $i < $daymonth; $i++)
<?php
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
......
......@@ -63,10 +63,15 @@ input[type=number] {
<i class="angle double left icon"></i>
Non-Chargeable Form
</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>
Notes
</button>
@if($checkoverhead)
<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>
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]) }}';">
<i class="angle double right icon"></i>
Timesheet Viewer
......
......@@ -18,7 +18,7 @@
<option value="0">Inactive</option>
</select>
</div>
<button class="ui button" type="submit">Add</button>
<button class="ui blue button" type="submit">Add</button>
</form>
</div>
@endsection
\ No newline at end of file
......@@ -3,8 +3,8 @@
@section('content')
<div class="ui segment">
<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 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>Add Overhead Lookup
</a>
<br>
<table class="ui celled padded table">
......
......@@ -3,7 +3,7 @@
@section('content')
<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>
<br>
......
......@@ -3,7 +3,7 @@
@section('content')
<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>
<br>
......@@ -28,7 +28,10 @@
<td>{{$project['projectteam']}} </td>
<td>{{ data_get($project, 'role') }}</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>
@endforeach
</tbody>
......
......@@ -408,14 +408,15 @@ class DashboardController extends Controller
->first();
// dd(Staff_info::all());
$hod = Staff_info::find($user->penyokong)
->fullname;
$penyokong = Staff_info::where('penyokong', 0)
->get();
// $hod = Staff_info::find($user->penyokong)
// ->fullname;
$bod = Staff_info::select('id', 'fullname')
->whereIn('id', [1,45,46,47,48])
->get();
// $penyokong = Staff_info::where('penyokong', 0)
// ->get();
// dd($penyokong);
// $bod = Staff_info::select('id', 'fullname')
// ->whereIn('id', [1,45,46,47,48])
// ->get();
$year = date('Y');
......@@ -576,7 +577,7 @@ class DashboardController extends Controller
}
// 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)
......
......@@ -729,9 +729,6 @@ class FormController extends Controller
->where('tm_phase', $phase)
->first();
// dd($checkoverhead);
//kalau ada, dia gi ke edit
if($checkoverhead)
{
......@@ -749,7 +746,7 @@ class FormController extends Controller
// 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)
......
......@@ -436,7 +436,7 @@ class MaintenanceController extends Controller
$data->save();
return redirect()->route('timesheet::maintenance.senaraiOverhead')
->with('success', 'Role Updated');
->with('success', 'Overhead lookup added!');
}
public function editoverhead(Request $request)
......@@ -454,7 +454,8 @@ class MaintenanceController extends Controller
'o_overhead_desc' => $request->description,
'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)
......
......@@ -40,18 +40,6 @@ use Maatwebsite\Excel\Facades\Excel;
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()
{
$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