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
816246a0
Commit
816246a0
authored
Jun 13, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes in maintenance screen
parent
0b2bb244
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
211 additions
and
91 deletions
+211
-91
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
+0
-1
packages/portal/timesheet/resources/views/dashboard/penambahanProject.blade.php
+2
-2
packages/portal/timesheet/resources/views/dashboard/penambahanProjectTeam.blade.php
+38
-29
packages/portal/timesheet/resources/views/dashboard/senaraiProject.blade.php
+13
-13
packages/portal/timesheet/resources/views/dashboard/senaraiProjectTeam.blade.php
+12
-10
packages/portal/timesheet/routes/web.php
+1
-0
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+102
-31
packages/portal/timesheet/src/Model/Department.php
+1
-1
packages/portal/timesheet/src/Model/Project.php
+4
-4
packages/portal/timesheet/src/Model/Staff_info.php
+38
-0
No files found.
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
View file @
816246a0
...
...
@@ -20,7 +20,6 @@ input[type=number] {
<a class="
ui
blue
left
ribbon
label
">Chargeable Form</a>
<br>
<hr>
Day =
{
{$day}
}
<br>
Timesheet for month =
{
{$month}
}
<br>
Year =
{
{$year}
}
<br>
...
...
packages/portal/timesheet/resources/views/dashboard/penambahanProject.blade.php
View file @
816246a0
...
...
@@ -18,8 +18,8 @@
<label>Project Manager</label>
<select name="
projectmanager
" class="
ui
fluid
dropdown
">
<option value="">Project Manager</option>
<option value="
84
5
">Rashdan</option>
<option value="
865
">Maimunah</option>
<option value="
84
2
">Rashdan</option>
<option value="
920
">Maimunah</option>
</select>
</div>
<div class="
field
">
...
...
packages/portal/timesheet/resources/views/dashboard/penambahanProjectTeam.blade.php
View file @
816246a0
...
...
@@ -4,22 +4,19 @@
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Add New Project Team</a>
<br><br>
<form class="
ui
form
">
<form class="
ui
form
"
action="
{{
route
(
'timesheet::dashboard.addprojectteam'
)}}
" method="
POST
"
>
{
{csrf_field()}
}
<div class="
field
">
<label>Project Code</label>
<input
type="
text
" name="
projectcode
" placeholder="
Project
Code
">
<input
onselect="
myDepartment
()
" type="
text
" name="
projectcode
" placeholder="
Project
Code
" value="
{{
$project
->
p_project_code
}}
|
{{
$project
->
p_project_description
}}
">
</div>
<div class="
field
">
<label>Department</label>
<select
name
="
department
" class="
ui
fluid
dropdown
">
<select
onchange="
selectDepartment
(
value
);
" name="
department
" id
="
department
" class="
ui
fluid
dropdown
">
<option value="">Department</option>
<option value="
1
">TMS</option>
<option value="
2
">PSS</option>
<option value="
3
">PMS</option>
<option value="
4
">PCS</option>
<option value="
5
">SPD</option>
<option value="
6
">Finance | HR | Admin</option>
@foreach(
$departments
as
$key
=>
$department
)
<option value="
{{
$department
->
id
}}
">
{
{$department->code}
}
|
{
{$department->description}
}
</option>
@endforeach
</select>
</div>
<div class="
field
">
...
...
@@ -28,31 +25,18 @@
<input type="
hidden
" name="
staffId
">
<i class="
dropdown
icon
"></i>
<div class="
default
text
">Staff Name</div>
<div class="
menu
">
<div class="
item
" data-value="
fezrul
" data-text="
Fezrul
">
Fezrul
</div>
<div class="
item
" data-value="
afif
" data-text="
Afif
">
Afif
</div>
<div class="
item
" data-value="
rizuan
" data-text="
Ridzuan
">
Wan Ridzuan
</div>
<div class="
item
" data-value="
rafezah
" data-text="
Rafezah
">
Rafezah
</div>
<div class="
item
" data-value="
fahmi
" data-text="
Fahmi
">
Fahmi
</div>
<div class="
item
" data-value="
shameel
" data-text="
Shameel
">
Shameel
<div class="
menu
" id="
selectBox
">
@foreach(
$staffs
as
$key
=>
$staff
)
<div class="
item
" data-value="
{{
$staff
->
id
}}
" data-text="
{{
$staff
->
fullname
}}
">
{
{$staff->fullname}
}
</div>
@endforeach
</div>
</div>
</div>
<div class="
field
">
<label>Project Status</label>
<select class="
ui
fluid
dropdown
">
<select
name="
status
"
class="
ui
fluid
dropdown
">
<option value="">Project Status</option>
<option value="
1
">Active</option>
<option value="
2
">Inactive</option>
...
...
@@ -62,6 +46,30 @@
<button class="
ui
green
button
" type="
button
" onclick="
window
.
location
.
href
=
''
;
">Back</button>
</form>
</div>
<!-- <p id="
demo
"></p> -->
@endsection
@push('script')
<script>
function myDepartment() {
alert('{{
$project->p_project_description
}}');
}
</script>
<script>
function selectDepartment(i) {
// var selectBox = document.getElementById("
department
");
// var selectedValue = selectBox.options[selectBox.selectedIndex].value;
alert(i);
}
</script>
<script>
function selectedTeam() {
var selectBox = document.getElementById("
selectBox
");
var selectedValue = selectBox.options[selectBox.selectedIndex].value;
alert(selectedValue);
}
</script>
@endpush
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/senaraiProject.blade.php
View file @
816246a0
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Senarai Project</a>
<div class="
ui
right
floated
small
primary
labeled
icon
button
">
<i class="
plus
icon
"></i></i> Add New Project
</div>
<a href="
{{
route
(
'timesheet::dashboard.penambahanProject'
)}}
" class="
ui
right
floated
small
primary
labeled
icon
button
"><i class="
plus
icon
"></i>Add New Project
</a>
<br>
<table class="
ui
celled
padded
table
">
<thead>
<tr>
...
...
@@ -16,21 +15,22 @@
<th>Project Name</th>
<th>Project Manager</th>
<th>Status</th>
<th>
Project Team
</th>
<th>
Action
</th>
</tr>
</thead>
<tbody>
@foreach(
$projectlist
as
$key
=>
$project
)
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
<a href="">Project Team</a>
</td>
<td>
{
{$key+1}
}
</td>
<td>
{
{$project['projectcode']}
}
</td>
<td>
{
{$project['projectname']}
}
</td>
<td>
{
{$project['projectmanager']}
}
</td>
<td>
{
{$project['status']}
}
</td>
<td><a href="
{{
route
(
'timesheet::dashboard.senaraiProjectTeam'
,
[
'id'
=>
$project
[
'id'
]])
}}
">Project Team</a></td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th colspan="
6
">
...
...
packages/portal/timesheet/resources/views/dashboard/senaraiProjectTeam.blade.php
View file @
816246a0
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Senarai Project Team</a>
<div class="
ui
right
floated
small
primary
labeled
icon
button
">
<i class="
plus
icon
"></i></i> Add New Project Team
</div>
<a href="
{{
route
(
'timesheet::dashboard.penambahanProjectTeam'
,
[
'id'
=>
$pid
])
}}
" class="
ui
right
floated
small
primary
labeled
icon
button
"><i class="
plus
icon
"></i>Add New Project Team
</a>
<br>
<table class="
ui
celled
padded
table
">
<thead>
<tr>
...
...
@@ -20,15 +19,18 @@
</tr>
</thead>
<tbody>
@foreach(
$projectlist
as
$key
=>
$project
)
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
{
{$key+1}
}
</td>
<td>
{
{$project['projectcode']}
}
</td>
<td>
{
{$project['projectname']}
}
</td>
<td>
{
{$project['projectteam']}
}
</td>
<td>
{
{$project['status']}
}
</td>
<td><
a href="">Edit</a><
/td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th colspan="
6
">
...
...
packages/portal/timesheet/routes/web.php
View file @
816246a0
...
...
@@ -17,6 +17,7 @@ Route::group(
Route
::
get
(
'senaraiProjectTeam'
,[
'uses'
=>
'DashboardController@senaraiProjectTeam'
,
'as'
=>
'dashboard.senaraiProjectTeam'
]);
Route
::
get
(
'penambahanProjectTeam'
,[
'uses'
=>
'DashboardController@penambahanProjectTeam'
,
'as'
=>
'dashboard.penambahanProjectTeam'
]);
Route
::
post
(
'addnewproject'
,[
'uses'
=>
'DashboardController@addnewproject'
,
'as'
=>
'dashboard.addnewproject'
]);
Route
::
post
(
'addprojectteam'
,[
'uses'
=>
'DashboardController@addprojectteam'
,
'as'
=>
'dashboard.addprojectteam'
]);
Route
::
get
(
'perkhidmatan'
,[
'uses'
=>
'DashboardController@perkhidmatan'
,
'as'
=>
'dashboard.perkhidmatan'
]);
Route
::
get
(
'borangBolehCaj'
,[
'uses'
=>
'DashboardController@borangBolehCaj'
,
'as'
=>
'dashboard.borangBolehCaj'
]);
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
816246a0
...
...
@@ -9,7 +9,9 @@ use Portal\Timesheet\Model\Users;
use
Portal\Timesheet\Model\Ts_master
;
use
Portal\Timesheet\Model\Ts_detail
;
use
Portal\Timesheet\Model\Project
;
use
Portal\Timesheet\Model\Department
;
use
Portal\Timesheet\Model\Pteam
;
use
Portal\Timesheet\Model\Staff_info
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
File
;
...
...
@@ -74,7 +76,26 @@ class DashboardController extends Controller
public
function
senaraiProject
()
{
return
view
(
'timesheet::dashboard.senaraiProject'
);
$project
=
Project
::
all
();
$projectlist
=
[];
// nanti project code query dari table project:
foreach
(
$project
as
$key
=>
$value
)
{
$projectlist
[]
=
[
'id'
=>
$value
->
id
,
'projectcode'
=>
$value
->
p_project_code
,
'projectname'
=>
$value
->
p_project_description
,
'projectmanager'
=>
$value
->
projectManager
->
fullname
,
'status'
=>
$value
->
p_project_sts
,
];
}
return
view
(
'timesheet::dashboard.senaraiProject'
,
compact
(
'projectlist'
));
}
public
function
penambahanProject
()
...
...
@@ -86,27 +107,99 @@ class DashboardController extends Controller
public
function
addnewproject
(
Request
$request
)
{
$user
=
users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
// $userId = $user->u_staffID;
$project
=
new
Project
;
$project
->
p_project_code
=
$request
->
projectcode
;
$project
->
p_project_description
=
$request
->
projectname
;
$project
->
p_project_task_team
=
$request
->
projectmanager
;
$project
->
p_project_sts
=
$request
->
status
;
$project
->
updated_by
=
$user
->
u_staffID
;
// dd($project);
$project
->
save
();
return
redirect
()
->
route
(
'timesheet::dashboard.penambahanProject'
);
}
public
function
senaraiProjectTeam
()
public
function
senaraiProjectTeam
(
Request
$request
)
{
return
view
(
'timesheet::dashboard.senaraiProjectTeam'
);
$pid
=
$request
->
id
;
$project
=
Pteam
::
where
(
'fk_project_id'
,
$request
->
id
)
->
get
();
$projectlist
=
[];
// dd($project);
// nanti project code query dari table project:
foreach
(
$project
as
$key
=>
$value
)
{
$projectlist
[]
=
[
'id'
=>
$value
->
id
,
'projectcode'
=>
$value
->
toProject
->
p_project_code
,
'projectname'
=>
$value
->
pt_project_description
,
'projectteam'
=>
$value
->
pt_team
,
'status'
=>
$value
->
pt_project_task_sts
,
];
}
public
function
penambahanProjectTeam
()
return
view
(
'timesheet::dashboard.senaraiProjectTeam'
,
compact
(
'projectlist'
,
'project'
,
'pid'
));
}
public
function
penambahanProjectTeam
(
Request
$request
)
{
return
view
(
'timesheet::dashboard.penambahanProjectTeam'
);
$project
=
Project
::
where
(
'id'
,
$request
->
id
)
->
first
();
//find($request->id);
$departments
=
Department
::
all
()
->
except
([
7
,
8
]);
foreach
(
$departments
as
$key
=>
$value
)
{
$staffs
=
Staff_info
::
where
(
'fk_lkp_department'
,
$value
->
id
)
->
get
();
// dd($value->id);
}
return
view
(
'timesheet::dashboard.penambahanProjectTeam'
,
compact
(
'project'
,
'departments'
,
'staffs'
));
}
public
function
addprojectteam
(
Request
$request
)
{
$user
=
Users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$project
=
Project
::
where
(
'p_project_code'
,
'='
,
$request
->
projectcode
)
->
first
();
$expstaff
=
explode
(
','
,
$request
->
staffId
);
foreach
(
$expstaff
as
$key
=>
$value
)
{
$staff
=
Staff_info
::
where
(
'staff_id'
,
$value
)
->
first
();
$pt
=
new
Pteam
;
$pt
->
fk_project_id
=
$project
->
id
;
$pt
->
pt_project_description
=
$project
->
p_project_description
;
$pt
->
pt_team
=
$staff
->
fullname
;
$pt
->
pt_staff_id
=
$value
;
$pt
->
pt_project_task_sts
=
$request
->
status
;
$pt
->
updated_by
=
$user
->
id
;
$pt
->
save
();
}
// dd($request->staffId);
// $data = new Pteam;
// $data->fk_project_id = $project->id;
// // $data->pt_team = $staff->fullname;
// $data->pt_staff_id = explode(',', $request->staffId);
// $data->pt_project_description = $project->p_project_description;
// $data->pt_project_task_sts = $request->status;
// $data->updated_by = $user->u_staffID;
// $data->save();
return
redirect
()
->
route
(
'timesheet::dashboard.penambahanProjectTeam'
);
}
public
function
perkhidmatan
()
...
...
@@ -121,6 +214,8 @@ class DashboardController extends Controller
$project
=
Pteam
::
where
(
'pt_staff_id'
,
$user
->
u_staffID
)
->
get
();
$projectlist
=
[];
// nanti project code query dari table project:
foreach
(
$project
as
$key
=>
$value
)
{
...
...
@@ -135,30 +230,6 @@ class DashboardController extends Controller
}
// $sampleTimesheet_dtl[] = [
// 'td_project' => '1',
// 'td_project_code' => 'nani',
// 'td_project_name' => 'kore',
// ];
// $sampleTimesheet_dtl[] = [
// 'td_project' => '2',
// 'td_project_code' => 'nani2',
// 'td_project_name' => 'kore2',
// ];
// dd($sampleTimesheet_dtl[0]['td_date']);
// if (day == $i+1)
// $check if (td_hours != null) {{td_hours}}
//sample dulu
$phase
=
1
;
...
...
packages/portal/timesheet/src/Model/Department.php
View file @
816246a0
...
...
@@ -11,7 +11,7 @@ class Department extends Model
*
* @var string
*/
protected
$table
=
'department'
;
protected
$table
=
'
lkp_
department'
;
/**
...
...
packages/portal/timesheet/src/Model/Project.php
View file @
816246a0
...
...
@@ -13,10 +13,10 @@ class Project extends Model
*/
protected
$table
=
'project'
;
// public function project_code
()
//
{
// return $this->hasMany('Portal\Timesheet\Model\Ts_detail','td_project','id
');
//
}
public
function
projectManager
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Staff_info'
,
'staff_id'
,
'p_project_task_team
'
);
}
/**
* undocumented function
...
...
packages/portal/timesheet/src/Model/Staff_info.php
0 → 100644
View file @
816246a0
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
Staff_info
extends
Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'staff_info'
;
public
function
department
()
{
return
$this
->
hasMany
(
'Portal\Timesheet\Model\Department'
,
'id'
,
'fk_lkp_department'
);
}
// public function project_code()
// {
// return $this->hasMany('Portal\Timesheet\Model\Ts_detail','td_project','id');
// }
/**
* 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