Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3f-timesheet
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dockers
3f-timesheet
Commits
3d0c9b61
Commit
3d0c9b61
authored
Jun 01, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update migration and model. screen for changeable form.
parent
4f801480
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
269 additions
and
54 deletions
+269
-54
database/migrations/2022_05_27_170927_create_timesheet_dtl_table.php
+13
-8
database/migrations/2022_05_31_111954_change_datatype_pt_project_task_team_in_project_task.php
+4
-4
database/migrations/2022_05_31_112552_change_datatype_d_department_code_in_department.php
+5
-8
database/migrations/2022_05_31_162450_alter_users_table.php
+37
-0
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
+15
-28
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+51
-6
packages/portal/timesheet/src/Model/Department.php
+29
-0
packages/portal/timesheet/src/Model/Overhead.php
+29
-0
packages/portal/timesheet/src/Model/P_task.php
+28
-0
packages/portal/timesheet/src/Model/Ts_detail.php
+29
-0
packages/portal/timesheet/src/Model/Ulevel.php
+29
-0
No files found.
database/migrations/2022_05_27_170927_create_timesheet_
tb
l_table.php
→
database/migrations/2022_05_27_170927_create_timesheet_
dt
l_table.php
View file @
3d0c9b61
...
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
...
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Migrations\Migration
;
class
CreateTimesheet
Tb
lTable
extends
Migration
class
CreateTimesheet
Dt
lTable
extends
Migration
{
{
/**
/**
* Run the migrations.
* Run the migrations.
...
@@ -13,20 +13,25 @@ class CreateTimesheetTblTable extends Migration
...
@@ -13,20 +13,25 @@ class CreateTimesheetTblTable extends Migration
*/
*/
public
function
up
()
public
function
up
()
{
{
Schema
::
create
(
'timesheet_
tb
l'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'timesheet_
dt
l'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
increments
(
'id'
);
$table
->
date
(
'td_date'
)
->
nullable
();
$table
->
date
(
'td_date'
)
->
nullable
();
$table
->
string
(
'
td_project
'
,
10
)
->
nullable
();
$table
->
string
(
'
fk_p_project_code
'
,
10
)
->
nullable
();
$table
->
integer
(
'
fk_
tm_id'
)
->
nullable1
()
->
unsigned
();
$table
->
integer
(
'tm_id'
)
->
nullable1
()
->
unsigned
();
$table
->
integer
(
'
fk_
tm_staff_id'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'tm_staff_id'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'
fk_
tm_month'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'tm_month'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'
fk_
tm_phase'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'tm_phase'
)
->
nullable
()
->
unsigned
();
$table
->
string
(
'td_project_name'
,
50
)
->
nullable
();
$table
->
string
(
'td_project_name'
,
50
)
->
nullable
();
$table
->
integer
(
'td_hours'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'td_hours'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'td_timesheet_sts'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'td_timesheet_sts'
)
->
nullable
()
->
unsigned
();
$table
->
string
(
'td_approval_remark'
,
100
)
->
nullable
();
$table
->
string
(
'td_approval_remark'
,
100
)
->
nullable
();
$table
->
string
(
'td_review_remark'
,
100
)
->
nullable
();
$table
->
string
(
'td_review_remark'
,
100
)
->
nullable
();
$table
->
integer
(
'td_project_type'
)
->
nullable
()
->
unsigned
();
$table
->
integer
(
'fk_o_id'
)
->
nullable
()
->
unsigned
();
$table
->
string
(
'td_overhead_desc'
,
50
)
->
nullable
();
$table
->
string
(
'td_overhead_note'
,
100
)
->
nullable
();
$table
->
string
(
'td_non_chargeable_desc'
,
100
)
->
nullable
();
$table
->
timestamps
();
$table
->
timestamps
();
$table
->
integer
(
'updated_by'
)
->
nullable
();
$table
->
integer
(
'updated_by'
)
->
nullable
();
...
@@ -41,6 +46,6 @@ class CreateTimesheetTblTable extends Migration
...
@@ -41,6 +46,6 @@ class CreateTimesheetTblTable extends Migration
*/
*/
public
function
down
()
public
function
down
()
{
{
Schema
::
dropIfExists
(
'timesheet_
tb
l'
);
Schema
::
dropIfExists
(
'timesheet_
dt
l'
);
}
}
}
}
database/migrations/2022_05_31_
094032_change_datatype_p_project_code_in_project_tbl
.php
→
database/migrations/2022_05_31_
111954_change_datatype_pt_project_task_team_in_project_task
.php
View file @
3d0c9b61
...
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
...
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Migrations\Migration
;
class
ChangeDatatypeP
ProjectCodeInProjectTbl
extends
Migration
class
ChangeDatatypeP
tProjectTaskTeamInProjectTask
extends
Migration
{
{
/**
/**
* Run the migrations.
* Run the migrations.
...
@@ -13,8 +13,8 @@ class ChangeDatatypePProjectCodeInProjectTbl extends Migration
...
@@ -13,8 +13,8 @@ class ChangeDatatypePProjectCodeInProjectTbl extends Migration
*/
*/
public
function
up
()
public
function
up
()
{
{
Schema
::
table
(
'project'
,
function
(
Blueprint
$table
)
{
Schema
::
table
(
'project
_task
'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'p_project_code'
,
50
)
->
nullable
()
->
change
();
$table
->
integer
(
'pt_project_task_team'
)
->
unsigned
(
)
->
nullable
()
->
change
();
});
});
}
}
...
@@ -25,7 +25,7 @@ class ChangeDatatypePProjectCodeInProjectTbl extends Migration
...
@@ -25,7 +25,7 @@ class ChangeDatatypePProjectCodeInProjectTbl extends Migration
*/
*/
public
function
down
()
public
function
down
()
{
{
Schema
::
table
(
'project'
,
function
(
Blueprint
$table
)
{
Schema
::
table
(
'project
_task
'
,
function
(
Blueprint
$table
)
{
//
//
});
});
}
}
...
...
database/migrations/2022_05_3
0_155341_add_td_project_type_to_timesheet_dtl_table
.php
→
database/migrations/2022_05_3
1_112552_change_datatype_d_department_code_in_department
.php
View file @
3d0c9b61
...
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
...
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Migrations\Migration
;
class
AddTdProjectTypeToTimesheetDtlTable
extends
Migration
class
ChangeDatatypeDDepartmentCodeInDepartment
extends
Migration
{
{
/**
/**
* Run the migrations.
* Run the migrations.
...
@@ -13,12 +13,9 @@ class AddTdProjectTypeToTimesheetDtlTable extends Migration
...
@@ -13,12 +13,9 @@ class AddTdProjectTypeToTimesheetDtlTable extends Migration
*/
*/
public
function
up
()
public
function
up
()
{
{
Schema
::
rename
(
'timesheet_tbl'
,
'timesheet_dtl'
);
Schema
::
table
(
'department'
,
function
(
Blueprint
$table
)
{
Schema
::
table
(
'timesheet_dtl'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'd_department_code'
,
10
)
->
nullable
()
->
change
();
$table
->
integer
(
'td_project_type'
)
->
after
(
'td_review_remark'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'fk_overhead'
)
->
after
(
'td_project_type'
)
->
unsigned
()
->
nullable
();
$table
->
string
(
'td_overhead_note'
,
100
)
->
after
(
'fk_overhead'
)
->
nullable
();
$table
->
string
(
'td_non_chargeable_desc'
,
100
)
->
after
(
'td_overhead_note'
)
->
nullable
();
});
});
}
}
...
@@ -29,7 +26,7 @@ class AddTdProjectTypeToTimesheetDtlTable extends Migration
...
@@ -29,7 +26,7 @@ class AddTdProjectTypeToTimesheetDtlTable extends Migration
*/
*/
public
function
down
()
public
function
down
()
{
{
Schema
::
table
(
'
timesheet_dtl
'
,
function
(
Blueprint
$table
)
{
Schema
::
table
(
'
department
'
,
function
(
Blueprint
$table
)
{
//
//
});
});
}
}
...
...
database/migrations/2022_05_31_162450_alter_users_table.php
0 → 100644
View file @
3d0c9b61
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
AlterUsersTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
integer
(
'u_staffID'
)
->
after
(
'name'
)
->
unsigned
()
->
nullable
();
$table
->
string
(
'fk_d_department_code'
,
10
)
->
after
(
'u_staffID'
)
->
nullable
();
$table
->
integer
(
'updated_by'
)
->
after
(
'updated_at'
)
->
nullable
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'u_staffID'
);
$table
->
dropColumn
(
'fk_d_department_code'
);
});
}
}
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
View file @
3d0c9b61
...
@@ -19,9 +19,17 @@ input[type=number] {
...
@@ -19,9 +19,17 @@ input[type=number] {
<
div
class
="
ui
segment
">
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Chargeable Form</a>
<a class="
ui
blue
left
ribbon
label
">Chargeable Form</a>
<br><br>
<br><br>
User Id =
{
{$userId}
}
<hr>
<hr>
Timesheet for
{
{$month}
}
, phase
{
{$phase}
}
Day =
{
{$day}
}
@if(
$day
==1)
naisu
@endif
{
{$sampleTimesheet_dtl[0]['td_date']}
}
<br>
Timesheet for month =
{
{$month}
}
<br>
Year =
{
{$year}
}
<br>
Phase =
{
{$phase}
}
<br>
<br>
<hr>
<hr>
<form class="
ui
form
" action="
{{
url
(
'saveHours'
)}}
" method="
POST
">
<form class="
ui
form
" action="
{{
url
(
'saveHours'
)}}
" method="
POST
">
...
@@ -38,23 +46,15 @@ input[type=number] {
...
@@ -38,23 +46,15 @@ input[type=number] {
</button>
</button>
</th>
</th>
</tr>
</tr>
<tr>
<tr>
<th >Project Code</th>
<th >Project Code</th>
<th >Project Name</th>
<th >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>
{
{$i+1}
}
</th>
@endfor
@endfor
@else
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$i+1}
}
</th>
<th>
{
{$i+1}
}
</th>
@endfor
@endfor
...
@@ -67,46 +67,33 @@ input[type=number] {
...
@@ -67,46 +67,33 @@ input[type=number] {
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
@foreach(
$sampleTimesheet_dtl
as
$key
=>
$project
)
@foreach(
$samplequery
as
$key
=>
$project
)
<tr>
<tr>
<td>
<td>
{
{$project['
p
code']}
}
{
{$project['
td_project_
code']}
}
</td>
</td>
<td>
<td>
{
{$project['
p
name']}
}
{
{$project['
td_project_
name']}
}
</td>
</td>
@if(
$phase
== 1)
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<td >
<td >
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
hour
[{{
$project
[
'
pid'
]}}][{{
$i
+
1
}}]
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
);
">
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
hour
[{{
$project
[
'
td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$project
[
'td_date'
]
==
$i
+
1
)
{{
$project
[
'td_hours'
]}}
@
endif
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
);
">
</td>
</td>
@endfor
@endfor
@else
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<td >
<td >
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
hour
[{{
$project
[
'
pid
'
]}}][{{
$i
+
1
}}]
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
);
">
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
hour
[{{
$project
[
'
td_project
'
]}}][{{
$i
+
1
}}]
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
);
">
</td>
</td>
@endfor
@endfor
@endif
@endif
<td>
<td>
<input type="
number
" onkeypress="
onlynumber
(
event
)
" name="" style="
padding
-
right
:
4
px
;
padding
-
left
:
4
px
;
" onchange="
limiter
(
this
);
" readonly="">
<input type="
number
" onkeypress="
onlynumber
(
event
)
" name="" style="
padding
-
right
:
4
px
;
padding
-
left
:
4
px
;
" onchange="
limiter
(
this
);
" readonly="">
</td>
</td>
</tr>
</tr>
@endforeach
@endforeach
</tbody>
</tbody>
</table>
</table>
</form>
</form>
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
3d0c9b61
...
@@ -15,6 +15,7 @@ use App\Mail\StatusAccept;
...
@@ -15,6 +15,7 @@ use App\Mail\StatusAccept;
use
App\Mail\StatusReject
;
use
App\Mail\StatusReject
;
use
Mail
;
use
Mail
;
use
Curl
;
use
Curl
;
use
Auth
;
class
DashboardController
extends
Controller
class
DashboardController
extends
Controller
{
{
...
@@ -59,7 +60,6 @@ class DashboardController extends Controller
...
@@ -59,7 +60,6 @@ class DashboardController extends Controller
}
}
if
(
$roleid
==
'4'
)
{
if
(
$roleid
==
'4'
)
{
return
view
(
'timesheet::dashboard.approval'
);
return
view
(
'timesheet::dashboard.approval'
);
}
}
...
@@ -77,11 +77,13 @@ class DashboardController extends Controller
...
@@ -77,11 +77,13 @@ class DashboardController extends Controller
public
function
borangBolehCaj
(
Request
$request
)
public
function
borangBolehCaj
(
Request
$request
)
{
{
$userId
=
Auth
::
id
();
$projectcode
=
'Project Code'
;
$projectcode
=
'Project Code'
;
$projectname
=
'Project Name'
;
$projectname
=
'Project Name'
;
// nanti project code query dari table project:
// nanti project code query dari table project:
//
$samplequery
[]
=
[
$samplequery
[]
=
[
'pcode'
=>
'LHD2021'
,
'pcode'
=>
'LHD2021'
,
...
@@ -98,17 +100,54 @@ class DashboardController extends Controller
...
@@ -98,17 +100,54 @@ class DashboardController extends Controller
];
];
$sampleTimesheet_dtl
[]
=
[
'td_id'
=>
'1'
,
'td_date'
=>
date
(
'j-n-Y'
,
strtotime
(
'6/5/2022'
)),
'td_project'
=>
'1'
,
'tm_id'
=>
'1'
,
'tm_staff_id'
=>
'1000'
,
'project_type'
=>
'1'
,
'fk_o_id'
=>
''
,
'tm_month'
=>
'6'
,
'tm_phase'
=>
'1'
,
'td_project_code'
=>
'LHD20212'
,
'td_project_name'
=>
'SMART'
,
'td_hours'
=>
'5'
];
$sampleTimesheet_dtl
[]
=
[
'td_id'
=>
'2'
,
'td_date'
=>
date
(
'j-n-Y'
,
strtotime
(
'6/5/2022'
)),
'td_project'
=>
'2'
,
'tm_id'
=>
'1'
,
'tm_staff_id'
=>
'1000'
,
'project_type'
=>
'1'
,
'fk_o_id'
=>
''
,
'tm_month'
=>
'6'
,
'tm_phase'
=>
'1'
,
'td_project_code'
=>
'LHD2021'
,
'td_project_name'
=>
'APIM'
,
'td_hours'
=>
'3'
,
//sample dulu
];
// dd($sampleTimesheet_dtl[0]['td_date']);
// if (day == $i+1)
// $check if (td_hours != null) {{td_hours}}
//sample dulu
$phase
=
1
;
$phase
=
1
;
$month
=
date
(
'n'
);
$month
=
date
(
'n'
);
$year
=
date
(
'Y'
);
$year
=
date
(
'Y'
);
$day
=
date
(
'j'
);
if
(
isset
(
$request
->
phase
))
if
(
isset
(
$request
->
phase
))
{
{
...
@@ -125,7 +164,6 @@ class DashboardController extends Controller
...
@@ -125,7 +164,6 @@ class DashboardController extends Controller
$year
=
$request
->
year
;
$year
=
$request
->
year
;
}
}
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
// dd($phase);
// dd($phase);
...
@@ -140,7 +178,7 @@ class DashboardController extends Controller
...
@@ -140,7 +178,7 @@ class DashboardController extends Controller
//dia g ke edit, klu xde g create.php
//dia g ke edit, klu xde g create.php
//kalau ada juga = bawak data details
//kalau ada juga = bawak data details
return
view
(
'timesheet::dashboard.borangBolehCaj'
,
compact
(
'
projectcode'
,
'projectname'
,
'month'
,
'phase'
,
'samplequery'
,
'daymonth
'
));
return
view
(
'timesheet::dashboard.borangBolehCaj'
,
compact
(
'
userId'
,
'projectcode'
,
'projectname'
,
'month'
,
'phase'
,
'samplequery'
,
'daymonth'
,
'year'
,
'sampleTimesheet_dtl'
,
'day
'
));
}
}
public
function
kalendarCharge
()
public
function
kalendarCharge
()
...
@@ -161,6 +199,13 @@ class DashboardController extends Controller
...
@@ -161,6 +199,13 @@ class DashboardController extends Controller
public
function
saveHours
(
Request
$request
)
public
function
saveHours
(
Request
$request
)
{
{
dd
(
$request
);
dd
(
$request
);
// tm_master = Ts_master::where('tm_staff_id','=',Auth::id())
// ->where('tm_month','=',$tm_month)
// ->get();
// if(isset(tm_master))
// {
// }
//first = check dah ade ke belum
//first = check dah ade ke belum
...
...
packages/portal/timesheet/src/Model/Department.php
0 → 100644
View file @
3d0c9b61
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
Department
extends
Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'department'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
packages/portal/timesheet/src/Model/Overhead.php
0 → 100644
View file @
3d0c9b61
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
Overhead
extends
Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'overhead'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
packages/portal/timesheet/src/Model/P_task.php
0 → 100644
View file @
3d0c9b61
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
P_task
extends
Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'project_task'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
packages/portal/timesheet/src/Model/Ts_detail.php
0 → 100644
View file @
3d0c9b61
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
Ts_detail
extends
Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'timesheet_dtl'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
packages/portal/timesheet/src/Model/Ulevel.php
0 → 100644
View file @
3d0c9b61
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
ULevel
extends
Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'access_level'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment