Commit fba11573 by Azhan Hannan

Comment Demo #10. Screen resubmit, display date → last updated date when click save button.

parent 7066d4b9
...@@ -25,6 +25,17 @@ input[type=number] { ...@@ -25,6 +25,17 @@ input[type=number] {
<br> <br>
<br> <br>
@if($lastupdated)
<div class="ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;">
<strong>
Last Updated : {{ date('d/m/Y', strtotime(data_get($lastupdated,'updated_at'))) }}
</strong>
</div>
</div>
@endif
<div class="ui right floated center compact aligned basic right button"> <div class="ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;"> <div class="header item" style="color: #000000;">
<strong> <strong>
......
...@@ -27,8 +27,20 @@ input[type=number] { ...@@ -27,8 +27,20 @@ input[type=number] {
Overhead Form Overhead Form
</h3> </h3>
</a> </a>
<br> <br>
<br> <br>
@if($lastupdated)
<div class="ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;">
<strong>
Last Updated : {{ date('d/m/Y', strtotime(data_get($lastupdated,'updated_at'))) }}
</strong>
</div>
</div>
@endif
<div class="ui right floated center compact aligned basic right button"> <div class="ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;"> <div class="header item" style="color: #000000;">
<strong> <strong>
......
...@@ -10,6 +10,16 @@ ...@@ -10,6 +10,16 @@
<a class="ui right floated center compact aligned right orange button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($profile,'staffid') ,'phase' => data_get($profile,'tp_phase'), 'month' => data_get($profile,'tp_month'), 'year' => data_get($profile,'tp_year')]) }}" target="_blank">View Timesheet</a> <a class="ui right floated center compact aligned right orange button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($profile,'staffid') ,'phase' => data_get($profile,'tp_phase'), 'month' => data_get($profile,'tp_month'), 'year' => data_get($profile,'tp_year')]) }}" target="_blank">View Timesheet</a>
@if($profile)
<div class="ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;">
<strong>
Last Updated : {{ date('d/m/Y', strtotime(data_get($profile,'updated_at'))) }}
</strong>
</div>
</div>
@endif
<div class="ui right floated center compact aligned basic right button"> <div class="ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;"> <div class="header item" style="color: #000000;">
<strong> <strong>
......
...@@ -14,6 +14,16 @@ ...@@ -14,6 +14,16 @@
<br> <br>
<br> <br>
@if($profile)
<div class="ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;">
<strong>
Last Updated : {{ date('d/m/Y', strtotime(data_get($profile,'updated_at'))) }}
</strong>
</div>
</div>
@endif
<div class="ui right floated center compact aligned basic right button"> <div class="ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;"> <div class="header item" style="color: #000000;">
<strong> <strong>
......
...@@ -151,15 +151,22 @@ class FormController extends Controller ...@@ -151,15 +151,22 @@ class FormController extends Controller
$year = $request->year; $year = $request->year;
} }
$lastupdated = Tproject::where('staffid', $userId)
->where('tp_project_type', $chargeable)
->where('tp_phase', $phase)
->where('tp_month', $month)
->where('tp_year', $year)
->first();
// dd($lastupdated);
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year); $daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
// dd($daymonth);
$strdays = []; $strdays = [];
for ($i=0; $i < $daymonth; $i++) { for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l'); $strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
// dd($strday);
$strdays[$i] = substr($strday, 0, 3); $strdays[$i] = substr($strday, 0, 3);
} }
...@@ -170,8 +177,6 @@ class FormController extends Controller ...@@ -170,8 +177,6 @@ class FormController extends Controller
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->first(); ->first();
// dd(data_get($check, 'tm_timesheet_master_sts'));
if($check) if($check)
{ {
$hour = Ts_detail::where('fk_tm_id',$check->id) $hour = Ts_detail::where('fk_tm_id',$check->id)
...@@ -211,7 +216,7 @@ class FormController extends Controller ...@@ -211,7 +216,7 @@ class FormController extends Controller
// dd(date_parse_from_format('Y-m-d', data_get($lat1,'DATE'))['day']); // dd(date_parse_from_format('Y-m-d', data_get($lat1,'DATE'))['day']);
// dd(date('d')); // dd(date('d'));
return view('timesheet::form.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year', 'hour', 'strdays', 'lat', 'check')); return view('timesheet::form.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year', 'hour', 'strdays', 'lat', 'check', 'lastupdated'));
} }
public function savechargeablehours(Request $request) public function savechargeablehours(Request $request)
...@@ -817,6 +822,14 @@ class FormController extends Controller ...@@ -817,6 +822,14 @@ class FormController extends Controller
$year = $request->year; $year = $request->year;
} }
$lastupdated = Tproject::where('staffid', $userId)
->where('tp_project_type', 3)
->where('tp_phase', $phase)
->where('tp_month', $month)
->where('tp_year', $year)
->first();
// dd($lastupdated);
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year); $daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$strdays = []; $strdays = [];
...@@ -1463,7 +1476,7 @@ class FormController extends Controller ...@@ -1463,7 +1476,7 @@ class FormController extends Controller
$fk_tm_id = null; $fk_tm_id = null;
} }
return view('timesheet::form.overheadForm', compact('checkoverhead','projectlist','userId','month','phase','daymonth','year', 'hour', 'project', 'fk_tm_id', 'strdays', 'lat')); return view('timesheet::form.overheadForm', compact('checkoverhead','projectlist','userId','month','phase','daymonth','year', 'hour', 'project', 'fk_tm_id', 'strdays', 'lat', 'lastupdated'));
} }
public function saveoverheadhours(Request $request) public function saveoverheadhours(Request $request)
...@@ -2082,7 +2095,7 @@ class FormController extends Controller ...@@ -2082,7 +2095,7 @@ class FormController extends Controller
->with('project') ->with('project')
->with('overhead') ->with('overhead')
->first(); ->first();
// dd($profile); // dd($profile);
$month = data_get($profile,'tp_month'); $month = data_get($profile,'tp_month');
// dump($month); // dump($month);
$year = data_get($profile,'tp_year'); $year = data_get($profile,'tp_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