Commit ad6d9497 by Azhan Hannan

changes

parent 2de0f0c5
...@@ -28,6 +28,7 @@ use File; ...@@ -28,6 +28,7 @@ use File;
use Redirect; use Redirect;
use App\Mail\StatusAccept; use App\Mail\StatusAccept;
use App\Mail\StatusReject; use App\Mail\StatusReject;
use App\Mail\EditProject;
use Mail; use Mail;
use Curl; use Curl;
use Auth; use Auth;
...@@ -333,7 +334,8 @@ class DashboardController extends Controller ...@@ -333,7 +334,8 @@ class DashboardController extends Controller
} }
} }
public function vwviewer(){ public function vwviewer()
{
$data = VwViewer::orderby('DEPARTMENT', 'DESC')->get(); $data = VwViewer::orderby('DEPARTMENT', 'DESC')->get();
// dd($data[0]); // dd($data[0]);
return view('timesheet::dashboard.vwviewer', compact('data')); return view('timesheet::dashboard.vwviewer', compact('data'));
...@@ -402,30 +404,30 @@ class DashboardController extends Controller ...@@ -402,30 +404,30 @@ class DashboardController extends Controller
return view('timesheet::dashboard.filterApproval', compact('month', 'curryear', 'currmonth')); return view('timesheet::dashboard.filterApproval', compact('month', 'curryear', 'currmonth'));
} }
public function viewerselectmonthphase(Request $request){ public function viewerselectmonthphase(Request $request)
{
return redirect()->route('timesheet::dashboard.timesheetViewer', ['phase' => $request->phase, 'month' =>$request->month]); return redirect()->route('timesheet::dashboard.timesheetViewer', ['phase' => $request->phase, 'month' =>$request->month]);
} }
public function pmverifyselectmonthphase(Request $request){ public function pmverifyselectmonthphase(Request $request)
{
return redirect()->route('timesheet::dashboard.projectVerify', ['phase' => $request->phase, 'month' =>$request->month]); return redirect()->route('timesheet::dashboard.projectVerify', ['phase' => $request->phase, 'month' =>$request->month]);
} }
public function reviewselectmonthphase(Request $request){ public function reviewselectmonthphase(Request $request)
{
return redirect()->route('timesheet::dashboard.timesheetReview', ['phase' => $request->phase, 'month' =>$request->month]); return redirect()->route('timesheet::dashboard.timesheetReview', ['phase' => $request->phase, 'month' =>$request->month]);
} }
public function approvalselectmonthphase(Request $request){ public function approvalselectmonthphase(Request $request)
{
return redirect()->route('timesheet::dashboard.timesheetApproval', ['phase' => $request->phase, 'month' =>$request->month]); return redirect()->route('timesheet::dashboard.timesheetApproval', ['phase' => $request->phase, 'month' =>$request->month]);
} }
public function timesheetApproval(Request $request) public function timesheetApproval(Request $request)
{ {
// dd($request);
$curryear = date('Y'); $curryear = date('Y');
if ($request->year) { if ($request->year) {
$curryear = $request->year; $curryear = $request->year;
...@@ -880,8 +882,6 @@ class DashboardController extends Controller ...@@ -880,8 +882,6 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
$pm = Users::find(Auth::id()); $pm = Users::find(Auth::id());
return view('timesheet::dashboard.projectaction', compact('profile', 'pm', 'page', 'staff', 'strMonth', 'year', 'month', 'phase', 'strdays', 'chargeablelist', 'chargehour', 'daymonth', 'totalchargehrs')); return view('timesheet::dashboard.projectaction', compact('profile', 'pm', 'page', 'staff', 'strMonth', 'year', 'month', 'phase', 'strdays', 'chargeablelist', 'chargehour', 'daymonth', 'totalchargehrs'));
...@@ -1435,6 +1435,7 @@ class DashboardController extends Controller ...@@ -1435,6 +1435,7 @@ class DashboardController extends Controller
->where('tp_project_type', 1) ->where('tp_project_type', 1)
->with('project') ->with('project')
->get(); ->get();
// dd($chargeableproject);
$chargeablelist = []; $chargeablelist = [];
$overheadlist = []; $overheadlist = [];
...@@ -1445,7 +1446,7 @@ class DashboardController extends Controller ...@@ -1445,7 +1446,7 @@ class DashboardController extends Controller
'pid' => $value->td_project, 'pid' => $value->td_project,
'pcode' => data_get($value,'project.p_project_code'), 'pcode' => data_get($value,'project.p_project_code'),
'pname' => data_get($value,'tp_project_name'), 'pname' => data_get($value,'project.p_project_description'),
]; ];
...@@ -2728,7 +2729,8 @@ class DashboardController extends Controller ...@@ -2728,7 +2729,8 @@ class DashboardController extends Controller
return view('timesheet::dashboard.filterHrStaffsTimesheet', compact('month', 'curryear', 'currmonth', 'departments', 'staffs', 'years')); return view('timesheet::dashboard.filterHrStaffsTimesheet', compact('month', 'curryear', 'currmonth', 'departments', 'staffs', 'years'));
} }
public function hrstaffstimesheet(Request $request){ public function hrstaffstimesheet(Request $request)
{
// dd($request); // dd($request);
$user = Staff_info::where('fk_users', data_get($request,'staffId'))->first(); $user = Staff_info::where('fk_users', data_get($request,'staffId'))->first();
......
...@@ -119,7 +119,7 @@ class FormController extends Controller ...@@ -119,7 +119,7 @@ class FormController extends Controller
->where('pt_project_task_sts', 1) ->where('pt_project_task_sts', 1)
->with('toProject') ->with('toProject')
->get(); ->get();
// dd($project);
$projectlist = []; $projectlist = [];
foreach ($project as $key => $value) { foreach ($project as $key => $value) {
...@@ -129,8 +129,8 @@ class FormController extends Controller ...@@ -129,8 +129,8 @@ class FormController extends Controller
$projectlist[] = [ $projectlist[] = [
'td_project' => $value->fk_project_id, 'td_project' => $value->fk_project_id,
'td_project_code' => $value->toProject->p_project_code, 'td_project_code' => data_get($value,'toProject.p_project_code'),
'td_project_name' => $value->toProject->p_project_description, 'td_project_name' => data_get($value,'toProject.p_project_description'),
]; ];
} }
...@@ -254,6 +254,7 @@ class FormController extends Controller ...@@ -254,6 +254,7 @@ class FormController extends Controller
foreach ($detail as $key => $value) foreach ($detail as $key => $value)
{ {
// dd($detail);
$projectid = $key; $projectid = $key;
foreach ($value as $keyday => $day) foreach ($value as $keyday => $day)
...@@ -314,7 +315,7 @@ class FormController extends Controller ...@@ -314,7 +315,7 @@ class FormController extends Controller
$project = Project::where('id', $projectid) $project = Project::where('id', $projectid)
->first(); ->first();
$tmdetail->td_project_name = $project->p_project_description; $tmdetail->td_project_name = data_get($project,'p_project_description');
$tmdetail->td_hours = $valuehour; $tmdetail->td_hours = $valuehour;
$tmdetail->td_timesheet_sts = 1; $tmdetail->td_timesheet_sts = 1;
$tmdetail->updated_by = $userId; $tmdetail->updated_by = $userId;
......
...@@ -16,9 +16,18 @@ class Pteam extends Model ...@@ -16,9 +16,18 @@ class Pteam extends Model
use SoftDeletes; use SoftDeletes;
protected $table = 'project_team'; protected $table = 'project_team';
public function toProjectFormList()
{
return $this->hasOne('Portal\Timesheet\Model\Project','id','fk_project_id')
->where('p_project_sts', 1)
->where('deleted_at', null);
}
public function toProject() public function toProject()
{ {
return $this->hasOne('Portal\Timesheet\Model\Project','id','fk_project_id')->where('p_project_sts', 1)->withTrashed(); return $this->hasOne('Portal\Timesheet\Model\Project','id','fk_project_id')
->where('p_project_sts', 1)
->withTrashed();
} }
public function toRole() public function toRole()
......
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