Commit 37a1a6de by Azhan Hannan

filter, hide save button if submitted, page chargeable overhead notelist

parent 8169db45
...@@ -50,7 +50,7 @@ input[type=number] { ...@@ -50,7 +50,7 @@ input[type=number] {
<thead> <thead>
<tr> <tr>
<?php <?php
// dd(count($lat)); // dd(data_get($check,'tm_timesheet_master_sts'));
?> ?>
<th colspan="2" rowspan="2" class="center aligned">Chargeable</th> <th colspan="2" rowspan="2" class="center aligned">Chargeable</th>
<!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> --> <!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> -->
...@@ -294,17 +294,17 @@ input[type=number] { ...@@ -294,17 +294,17 @@ input[type=number] {
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
@if($projectlist == []) <?php
<button type="submit" class="ui right floated aligned ui blue compact labeled icon button"> // dd(count($projectlist));
<i class="save icon"></i> ?>
Save @if(data_get($check,'tm_timesheet_master_sts') == 1 || data_get($check,'tm_timesheet_master_sts') == null)
</button> @if(count($projectlist) > 0)
@else <button type="submit" class="ui right floated aligned ui blue compact labeled icon button">
<button type="submit" class="ui right floated aligned ui blue compact labeled icon button"> <i class="save icon"></i>
<i class="save icon"></i> Save as Draft
Save as Draft </button>
</button>
@endif @endif
@endif
</form> </form>
<br> <br>
<br> <br>
......
...@@ -75,10 +75,10 @@ ...@@ -75,10 +75,10 @@
Back To Overhead Form Back To Overhead Form
</button> </button>
<button type="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]) }}';"> <a href="{{ route('timesheet::dashboard.timesheetViewer', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}" type="button" class="center aligned ui pink compact right labeled icon button" target="_blank">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
Timesheet Viewer Timesheet Viewer
</button> </a>
@endif @endif
<table class="ui celled structured table unstackable"> <table class="ui celled structured table unstackable">
...@@ -91,26 +91,32 @@ ...@@ -91,26 +91,32 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($onotes as $key => $value) @if(count($onotes) > 0)
@foreach($onotes as $key => $value)
<tr>
<td>{{$key+1}} </td>
<td class="single line">
<input type="hidden" name="date[{{$key}}]" value="{{data_get($value,'td_date')}}">
{{ date("d-m-Y", strtotime(data_get($value,'td_date'))) }}
</td>
<td class="single line">
<input type="hidden" name="oid[{{$key}}]" value="{{data_get($value,'fk_o_id')}}">
{{data_get($value,'td_overhead_desc')}}
</td>
<td class="single line">
@if(data_get($value,'td_overhead_note'))
<textarea rows="3" type="text" name="note[{{$key}}]" value="{{data_get($value,'td_overhead_note')}}" required="required">{{data_get($value,'td_overhead_note')}}</textarea>
@else
<textarea rows="3" type="text" name="note[{{$key}}]" placeholder="Fill in the description for your task" required="required"></textarea>
@endif
</td>
</tr>
@endforeach
@else
<tr> <tr>
<td>{{$key+1}} </td> <td colspan="4" class="center aligned">No overhead Selected</td>
<td class="single line">
<input type="hidden" name="date[{{$key}}]" value="{{data_get($value,'td_date')}}">
{{ date("d-m-Y", strtotime(data_get($value,'td_date'))) }}
</td>
<td class="single line">
<input type="hidden" name="oid[{{$key}}]" value="{{data_get($value,'fk_o_id')}}">
{{data_get($value,'td_overhead_desc')}}
</td>
<td class="single line">
@if(data_get($value,'td_overhead_note'))
<textarea rows="3" type="text" name="note[{{$key}}]" value="{{data_get($value,'td_overhead_note')}}" required="required">{{data_get($value,'td_overhead_note')}}</textarea>
@else
<textarea rows="3" type="text" name="note[{{$key}}]" placeholder="Fill in the description for your task" required="required"></textarea>
@endif
</td>
</tr> </tr>
@endforeach @endif
<!-- @foreach($notes as $key => $value) <!-- @foreach($notes as $key => $value)
<tr> <tr>
...@@ -122,9 +128,15 @@ ...@@ -122,9 +128,15 @@
@endforeach --> @endforeach -->
</tbody> </tbody>
</table> </table>
<button type="submit" class="ui right floated aligned ui orange compact button"> <?php
Save // dd(count($onotes));
</button> ?>
@if(data_get($checknotelist, 'tm_timesheet_master_sts') == 1 && count($onotes) > 0)
<button type="submit" class="ui right floated aligned ui orange compact button">
Save as Draft
</button>
@endif
</form> </form>
<br> <br>
<br> <br>
......
...@@ -280,10 +280,16 @@ input[type=number] { ...@@ -280,10 +280,16 @@ input[type=number] {
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
<?php
// dd(data_get($checkoverhead,'tm_timesheet_master_sts'));
?>
@if(data_get($checkoverhead,'tm_timesheet_master_sts') == 1 || data_get($checkoverhead,'tm_timesheet_master_sts') == null)
<button type="submit" class="ui right floated aligned ui blue compact labeled icon button"> <button type="submit" class="ui right floated aligned ui blue compact labeled icon button">
<i class="save icon"></i> <i class="save icon"></i>
Save as Draft Save as Draft
</button> </button>
@endif
</form> </form>
<br> <br>
<br> <br>
......
...@@ -170,6 +170,8 @@ class FormController extends Controller ...@@ -170,6 +170,8 @@ 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)
...@@ -209,7 +211,7 @@ class FormController extends Controller ...@@ -209,7 +211,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')); return view('timesheet::form.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year', 'hour', 'strdays', 'lat', 'check'));
} }
public function savechargeablehours(Request $request) public function savechargeablehours(Request $request)
...@@ -1536,7 +1538,7 @@ class FormController extends Controller ...@@ -1536,7 +1538,7 @@ class FormController extends Controller
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->first(); ->first();
// dd($checknotelist); // dd(data_get($checknotelist, 'tm_timesheet_master_sts'));
if ($checknotelist) { if ($checknotelist) {
...@@ -1567,7 +1569,7 @@ class FormController extends Controller ...@@ -1567,7 +1569,7 @@ class FormController extends Controller
// dd($list); // dd($list);
return view('timesheet::form.notelist', compact('notes', 'phase', 'month', 'year', 'fk_tm_id', 'staff', 'onotes', 'page', 'checktp')); return view('timesheet::form.notelist', compact('notes', 'phase', 'month', 'year', 'fk_tm_id', 'staff', 'onotes', 'page', 'checktp', 'checknotelist'));
} }
public function penambahannote() public function penambahannote()
......
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