Commit fb69f16c by hannan

display day in timesheet viewer, chargeable, nonchargeable and overhead form

parent 416672cb
...@@ -36,45 +36,10 @@ ...@@ -36,45 +36,10 @@
<tr> <tr>
<td>Month</td> <td>Month</td>
<td>:</td> <td>:</td>
<td> <td>{{ $strMonth }}</td>
<div class="ui form">
<div class="field">
<select class="ui search dropdown">
<option value="" selected="">{{$strMonth}}</option>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
</div>
</div>
</td>
<td>Phase</td> <td>Phase</td>
<td>:</td> <td>:</td>
<td> <td>{{ $phase }}</td>
<div class="ui form">
<div class="field">
<select class="ui search dropdown">
@if($phase == 1)
<option value="{{ $phase }}">{{ $phase }}</option>
<option value="2">2</option>
@else
<option value="{{ $phase }}">{{ $phase }}</option>
<option value="1">1</option>
@endif
</select>
</div>
</div>
</td>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -83,30 +48,43 @@ ...@@ -83,30 +48,43 @@
<table id="printtable2" class="ui celled structured table unstackable"> <table id="printtable2" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th colspan="3">Chargeable</th> <th colspan="3" rowspan="2" class="center aligned">Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="2">Total</th> <th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td style="width: 4%;"></td>
<td style="width: 10%;">Project Code</td>
<td style="width: 13%;">Project Name</td>
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<td>{{$i+1}}</td> <th>{{$i+1}}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<td>{{$i+1}}</td> <th>{{$i+1}}</th>
@endfor @endfor
@endif @endif
<td>Hours</td>
<td>Days</td>
</tr> </tr>
<tr>
<th style="width: 4%;"></th>
<th style="width: 10%;">Project Code</th>
<th style="width: 13%;">Project Name</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach($chargeablelist as $key => $projectchargeable) @foreach($chargeablelist as $key => $projectchargeable)
<?php $totalcharge = 0; ?> <?php $totalcharge = 0; ?>
<tr> <tr>
...@@ -220,29 +198,42 @@ ...@@ -220,29 +198,42 @@
<table id="printtable3" class="ui celled structured table unstackable"> <table id="printtable3" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th colspan="2">Non-Chargeable</th> <th colspan="2" rowspan="2" class="center aligned">Non-Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="2">Total</th> <th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td style="width: 4%;"></td>
<td style="width: 23%;">Task</td>
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<td>{{$i+1}}</td> <th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
<th style="width: 4%;"></th>
<th style="width: 23%;">Task</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<td>{{$i+1}}</td> <th>{{$strdays[$i]}}</th>
@endfor @endfor
@endif @endif
<td>Hours</td> <th>Hours</th>
<td>Days</td> <th>Days</th>
</tr> </tr>
</thead>
<tbody>
@foreach($nonchargeablelist as $key => $projectnonchargeable) @foreach($nonchargeablelist as $key => $projectnonchargeable)
<?php $totalnoncharge = 0; ?> <?php $totalnoncharge = 0; ?>
...@@ -356,29 +347,42 @@ ...@@ -356,29 +347,42 @@
<table id="printtable4" class="ui celled structured table unstackable"> <table id="printtable4" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th colspan="2">Overhead</th> <th colspan="2" rowspan="2" class="center aligned">Overhead</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="2">Total</th> <th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td style="width: 4%;"></td>
<td style="width: 23%;">Overhead</td>
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<td>{{$i+1}}</td> <th>{{$i+1}}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<td>{{$i+1}}</td> <th>{{$i+1}}</th>
@endfor @endfor
@endif @endif
<td>Hours</td>
<td>Days</td>
</tr> </tr>
<tr>
<th style="width: 4%;"></th>
<th style="width: 23%;">Overhead</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach($overheadlist as $key => $projectoverhead) @foreach($overheadlist as $key => $projectoverhead)
<?php $totaloverhead = 0; ?> <?php $totaloverhead = 0; ?>
<tr> <tr>
...@@ -489,7 +493,7 @@ ...@@ -489,7 +493,7 @@
<table id="printtable5" class="ui celled structured table unstackable"> <table id="printtable5" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th colspan="2">Note:</th> <th colspan="2" class="center aligned">Note</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
...@@ -48,26 +48,39 @@ input[type=number] { ...@@ -48,26 +48,39 @@ input[type=number] {
<table class="ui celled structured table unstackable"> <table class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th colspan="2">Chargeable</th> <th colspan="2" rowspan="2" class="center aligned">Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th> <th rowspan="2">
<button type="submit" class="fluid center aligned ui blue compact labeled icon button"> <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i> <i class="save icon"></i>
Save Save
</button> </button>
</th> </th>
</tr> </tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th>
@endfor
@endif
</tr>
<tr> <tr>
<th class="single line">Project Code</th> <th class="single line">Project Code</th>
<th class="single line">Project Name</th> <th class="single line">Project Name</th>
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th> <th>{{ $strdays[$i] }}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th> <th>{{ $strdays[$i] }}</th>
@endfor @endfor
@endif @endif
......
...@@ -101,25 +101,38 @@ input[type=number] { ...@@ -101,25 +101,38 @@ input[type=number] {
<table class="ui celled structured table unstackable"> <table class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th class="single line">Non-Chargeable</th> <th rowspan="2" class="single line" class="center aligned">Non-Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th> <th rowspan="2">
<button type="submit" class="fluid center aligned ui blue compact labeled icon button"> <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i> <i class="save icon"></i>
Save Save
</button> </button>
</th> </th>
</tr> </tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th>
@endfor
@endif
</tr>
<tr> <tr>
<th class="single line">Project Name</th> <th class="single line">Project Name</th>
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th> <th>{{ $strdays[$i] }}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th> <th>{{ $strdays[$i] }}</th>
@endfor @endfor
@endif @endif
......
...@@ -101,25 +101,37 @@ input[type=number] { ...@@ -101,25 +101,37 @@ input[type=number] {
<table class="ui celled structured unstackable table" > <table class="ui celled structured unstackable table" >
<thead> <thead>
<tr> <tr>
<th>Overhead</th> <th rowspan="2" class="center aligned">Overhead</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th> <th rowspan="2">
<button type="submit" class="fluid center aligned ui blue compact labeled icon button"> <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i> <i class="save icon"></i>
Save Save
</button> </button>
</th> </th>
</tr> </tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th>
@endfor
@endif
</tr>
<tr> <tr>
<th>Task</th> <th>Task</th>
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th> <th>{{ $strdays[$i] }}</th>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th> <th>{{ $strdays[$i] }}</th>
@endfor @endfor
@endif @endif
<th>Total Hours</th> <th>Total Hours</th>
......
...@@ -110,12 +110,6 @@ class DashboardController extends Controller ...@@ -110,12 +110,6 @@ class DashboardController extends Controller
$phase = 2; $phase = 2;
} }
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$myDate = $month.'/'.$day.'/'.$year;
$date = Carbon::createFromFormat('m/d/Y', $myDate);
$strMonth = $date->format('F');
if(isset($request->phase)) if(isset($request->phase))
{ {
$phase = $request->phase; $phase = $request->phase;
...@@ -129,6 +123,24 @@ class DashboardController extends Controller ...@@ -129,6 +123,24 @@ class DashboardController extends Controller
{ {
$year = $request->year; $year = $request->year;
} }
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$myDate = $month.'/'.$day.'/'.$year;
$date = Carbon::createFromFormat('m/d/Y', $myDate);
$strdays = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
}
$strMonth = $date->format('F');
$chargeable = 1; $chargeable = 1;
$nonchargeable = 2; $nonchargeable = 2;
...@@ -140,11 +152,7 @@ class DashboardController extends Controller ...@@ -140,11 +152,7 @@ class DashboardController extends Controller
$nonchargeableproject = Pteam::where('pt_staff_id',$user->staff_id) $nonchargeableproject = Pteam::where('pt_staff_id',$user->staff_id)
->where('pt_project_type', $nonchargeable) ->where('pt_project_type', $nonchargeable)
->get(); ->get();
// $overheadproject = Overhead::where('o_overhead_sts',1)
// ->get();
$chargeablelist = []; $chargeablelist = [];
$nonchargeablelist = []; $nonchargeablelist = [];
...@@ -246,7 +254,7 @@ class DashboardController extends Controller ...@@ -246,7 +254,7 @@ class DashboardController extends Controller
->orderby('td_date') ->orderby('td_date')
->get(); ->get();
return view('timesheet::dashboard.timesheetViewer', compact('user', 'dept', 'hod', 'phase', 'month', 'year', 'day', 'strMonth', 'daymonth', 'chargeablelist', 'nonchargeablelist', 'overheadlist', 'chargehour', 'nonchargehour', 'totalchargehrs', 'totalnonchargehrs', 'totaloverheadhrs', 'overheadhour', 'notes', 'check')); return view('timesheet::dashboard.timesheetViewer', compact('user', 'dept', 'hod', 'phase', 'month', 'year', 'day', 'strMonth', 'daymonth', 'chargeablelist', 'nonchargeablelist', 'overheadlist', 'chargehour', 'nonchargehour', 'totalchargehrs', 'totalnonchargehrs', 'totaloverheadhrs', 'overheadhour', 'notes', 'check', 'strdays'));
} }
......
...@@ -79,6 +79,16 @@ class FormController extends Controller ...@@ -79,6 +79,16 @@ class FormController extends Controller
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year); $daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$strdays = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
}
$check = Ts_master::where('tm_staff_id', $userId) $check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year) ->where('tm_year', $year)
->where('tm_month', $month) ->where('tm_month', $month)
...@@ -95,7 +105,7 @@ class FormController extends Controller ...@@ -95,7 +105,7 @@ class FormController extends Controller
$hour = null; $hour = null;
} }
return view('timesheet::form.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour')); return view('timesheet::form.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour', 'strdays'));
} }
public function savechargeablehours(Request $request) public function savechargeablehours(Request $request)
...@@ -255,6 +265,16 @@ class FormController extends Controller ...@@ -255,6 +265,16 @@ class FormController extends Controller
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year); $daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$strdays = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
}
$check = Ts_master::where('tm_staff_id', $userId) $check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year) ->where('tm_year', $year)
->where('tm_month', $month) ->where('tm_month', $month)
...@@ -272,7 +292,7 @@ class FormController extends Controller ...@@ -272,7 +292,7 @@ class FormController extends Controller
$hour = null; $hour = null;
} }
return view('timesheet::form.nonChargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour','nonchargeables')); return view('timesheet::form.nonChargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour','nonchargeables','strdays'));
} }
public function addnonchargeabletask(Request $request) public function addnonchargeabletask(Request $request)
...@@ -548,6 +568,16 @@ class FormController extends Controller ...@@ -548,6 +568,16 @@ class FormController extends Controller
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year); $daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$strdays = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
}
$check = Ts_master::where('tm_staff_id', $userId) $check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year) ->where('tm_year', $year)
->where('tm_month', $month) ->where('tm_month', $month)
...@@ -569,7 +599,7 @@ class FormController extends Controller ...@@ -569,7 +599,7 @@ class FormController extends Controller
// dd($check->id); // dd($check->id);
return view('timesheet::form.overheadForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour', 'project', 'check')); return view('timesheet::form.overheadForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour', 'project', 'check', 'strdays'));
} }
public function saveoverheadhours(Request $request) public function saveoverheadhours(Request $request)
......
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