Commit fb69f16c by hannan

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

parent 416672cb
......@@ -36,45 +36,10 @@
<tr>
<td>Month</td>
<td>:</td>
<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>{{ $strMonth }}</td>
<td>Phase</td>
<td>:</td>
<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>
<td>{{ $phase }}</td>
</tr>
</tbody>
</table>
......@@ -83,30 +48,43 @@
<table id="printtable2" class="ui celled structured table unstackable">
<thead>
<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="2">Total</th>
<th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td style="width: 10%;">Project Code</td>
<td style="width: 13%;">Project Name</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<td>{{$i+1}}</td>
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<td>{{$i+1}}</td>
<th>{{$i+1}}</th>
@endfor
@endif
<td>Hours</td>
<td>Days</td>
</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)
<?php $totalcharge = 0; ?>
<tr>
......@@ -220,29 +198,42 @@
<table id="printtable3" class="ui celled structured table unstackable">
<thead>
<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="2">Total</th>
<th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td style="width: 23%;">Task</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<td>{{$i+1}}</td>
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<td>{{$i+1}}</td>
<th>{{$i+1}}</th>
@endfor
@endif
<td>Hours</td>
<td>Days</td>
</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
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach($nonchargeablelist as $key => $projectnonchargeable)
<?php $totalnoncharge = 0; ?>
......@@ -356,29 +347,42 @@
<table id="printtable4" class="ui celled structured table unstackable">
<thead>
<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="2">Total</th>
<th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td style="width: 23%;">Overhead</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<td>{{$i+1}}</td>
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<td>{{$i+1}}</td>
<th>{{$i+1}}</th>
@endfor
@endif
<td>Hours</td>
<td>Days</td>
</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)
<?php $totaloverhead = 0; ?>
<tr>
......@@ -489,7 +493,7 @@
<table id="printtable5" class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="2">Note:</th>
<th colspan="2" class="center aligned">Note</th>
</tr>
</thead>
<tbody>
......
......@@ -48,9 +48,9 @@ input[type=number] {
<table class="ui celled structured table unstackable">
<thead>
<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>
<th rowspan="2">
<button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save
......@@ -58,8 +58,6 @@ input[type=number] {
</th>
</tr>
<tr>
<th class="single line">Project Code</th>
<th class="single line">Project Name</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
......@@ -71,6 +69,21 @@ input[type=number] {
@endfor
@endif
</tr>
<tr>
<th class="single line">Project Code</th>
<th class="single line">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>Total Hours</th>
</tr>
</thead>
......
......@@ -101,9 +101,9 @@ input[type=number] {
<table class="ui celled structured table unstackable">
<thead>
<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>
<th rowspan="2">
<button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save
......@@ -111,7 +111,6 @@ input[type=number] {
</th>
</tr>
<tr>
<th class="single line">Project Name</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
......@@ -123,6 +122,20 @@ input[type=number] {
@endfor
@endif
</tr>
<tr>
<th class="single line">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>Total Hours</th>
</tr>
<tr>
......
......@@ -101,9 +101,9 @@ input[type=number] {
<table class="ui celled structured unstackable table" >
<thead>
<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>
<th rowspan="2">
<button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i>
Save
......@@ -111,7 +111,6 @@ input[type=number] {
</th>
</tr>
<tr>
<th>Task</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
......@@ -122,6 +121,19 @@ input[type=number] {
<th>{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
<th>Task</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>Total Hours</th>
</tr>
</thead>
......
......@@ -110,12 +110,6 @@ class DashboardController extends Controller
$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))
{
$phase = $request->phase;
......@@ -130,6 +124,24 @@ class DashboardController extends Controller
$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;
$nonchargeable = 2;
$overhead = 3;
......@@ -142,10 +154,6 @@ class DashboardController extends Controller
->where('pt_project_type', $nonchargeable)
->get();
// $overheadproject = Overhead::where('o_overhead_sts',1)
// ->get();
$chargeablelist = [];
$nonchargeablelist = [];
$overheadlist = [];
......@@ -246,7 +254,7 @@ class DashboardController extends Controller
->orderby('td_date')
->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
$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)
->where('tm_year', $year)
->where('tm_month', $month)
......@@ -95,7 +105,7 @@ class FormController extends Controller
$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)
......@@ -255,6 +265,16 @@ class FormController extends Controller
$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)
->where('tm_year', $year)
->where('tm_month', $month)
......@@ -272,7 +292,7 @@ class FormController extends Controller
$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)
......@@ -548,6 +568,16 @@ class FormController extends Controller
$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)
->where('tm_year', $year)
->where('tm_month', $month)
......@@ -569,7 +599,7 @@ class FormController extends Controller
// 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)
......
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