Commit ec18097c by hannan

calculate hours and print timesheet review

parent 89c1ae9a
......@@ -96,9 +96,13 @@ class DashboardController extends Controller
$hod = Staff_info::find($user->penyokong)
->fullname;
$month = date('n');
$year = date('Y');
$day = date('j');
// $month = date('n');
// $year = date('Y');
// $day = date('j');
$month = 7;
$year = 2022;
$day = 2;
if ($day < 16) {
$phase = 1;
......@@ -116,7 +120,6 @@ class DashboardController extends Controller
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
......@@ -139,9 +142,8 @@ class DashboardController extends Controller
->where('pt_project_type', $nonchargeable)
->get();
$overheadproject = Overhead::where('o_overhead_sts',1)
->get();
// $overheadproject = Overhead::where('o_overhead_sts',1)
// ->get();
$chargeablelist = [];
......@@ -171,17 +173,6 @@ class DashboardController extends Controller
}
foreach ($overheadproject as $key => $value) {
$overheadlist[] = [
'pid' => $value->id,
'pname' => $value->o_overhead_desc,
];
}
$check = Ts_master::where('tm_staff_id', $user->staff_id)
->where('tm_year', $year)
->where('tm_month', $month)
......@@ -201,27 +192,36 @@ class DashboardController extends Controller
// ->where('td_hours', '!=', 0)
->get();
// $filledoverhead = Ts_detail::where('fk_tm_id',$check->id)
// ->where('td_project_type', $overhead)
// // ->where('td_hours', '!=', 0)
// ->get();
// foreach ($filledoverhead as $key => $value) {
// $temp[$key] =
// if($overheadlist[$key] != $overheadlist[$key+1]) {
// $overheadlist[] = [
// 'pid' => $value->fk_o_id,
// 'pname' => $value->td_overhead_desc,
// ];
// }
// }
// dd($overheadlist);
$overheadhour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead)
// ->where('td_hours', '!=', 0)
->where('td_hours', '!=', 0)
->get();
$tempOverhead = [];
$tempOverheadid = [];
$tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
$tempOverheadid[0] = $overheadhour[0]->fk_o_id;
$j = 0;
for($i = 0; $i < count($overheadhour); $i++){
if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
} else {
$j++;
$tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
$tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
}
}
foreach ($tempOverhead as $key => $value) {
$overheadlist[] = [
'pid' => $tempOverheadid[$key],
'pname' => $tempOverhead[$key],
];
}
}
else
......@@ -246,7 +246,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'));
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'));
}
......
......@@ -19,7 +19,59 @@
</head>
<body data-theme="{{ config('laravolt.ui.sidebar_theme') }}" class="{{ $bodyClass ?? '' }}">
<body data-theme="{{ config('laravolt.ui.sidebar_theme') }}" class="on-the-fly-behavior {{ $bodyClass ?? '' }}" id="body1">
<style scoped>
.print-fly {
background-color: white;
font-size:10px;
}
.print-flys {
background-color: white;
width:auto;
}
.on-the-fly-behavior {
background-image: url('{{ asset('assets/images/bg.png') }}');
background-repeat:no-repeat;
background-size: contain;
}
.langdisp
{
background-color: darkmagenta;
border-radius: 20px;
margin-right: 10px;
margin-top: 20px !important;
padding-top: 10px;
padding-bottom: 14px;
padding-right: 20px;
padding-left: 20px;"
}
@media (max-width: 1200px)
{
.on-the-fly-behavior {
background-image: url('{{ asset('assets/images/bg.png') }}');
background-repeat:no-repeat;
background-size: unset;
}
.langdisp
{
background-color: unset !important;
border-radius: unset !important;
margin: unset !important;
padding: unset !important;
}
}
</style>
@yield('body')
......
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