Gitlab@Informatics
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IV PERSON SYSTEM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
62160158
IV PERSON SYSTEM
Commits
b02f0a78
Commit
b02f0a78
authored
3 years ago
by
62160112
Browse files
Options
Downloads
Patches
Plain Diff
ส่วนลบในการจัดการ department
parent
6db4f56f
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
html/team0/application/controllers/Demo/Supavich_controller.php
+142
-4
142 additions, 4 deletions
...eam0/application/controllers/Demo/Supavich_controller.php
html/team0/application/views/Demo/v_supavich.php
+79
-661
79 additions, 661 deletions
html/team0/application/views/Demo/v_supavich.php
with
221 additions
and
665 deletions
html/team0/application/controllers/Demo/Supavich_controller.php
+
142
−
4
View file @
b02f0a78
...
@@ -15,7 +15,10 @@ class Supavich_controller extends CI_Controller {
...
@@ -15,7 +15,10 @@ class Supavich_controller extends CI_Controller {
'ips_address'
=>
'ips_address.adr_id=ips_personnel.p_id'
,
'ips_address'
=>
'ips_address.adr_id=ips_personnel.p_id'
,
)
//table to join
)
//table to join
)
->
result
();
//getjoin
)
->
result
();
//getjoin
$dpm
=
$this
->
IPS_model
->
get_join
(
'ips_department'
,
''
,
//colum in database
)
->
result
();
$person_get_edu_data
=
$this
->
IPS_model
->
get_join
(
$person_get_edu_data
=
$this
->
IPS_model
->
get_join
(
'ips_education_bg'
,
'ips_education_bg'
,
''
,
//colum in database
''
,
//colum in database
...
@@ -63,9 +66,9 @@ class Supavich_controller extends CI_Controller {
...
@@ -63,9 +66,9 @@ class Supavich_controller extends CI_Controller {
)
//table to join
)
//table to join
)
->
result
();
//getjoin
)
->
result
();
//getjoin
$working_exp_resume
=
$this
->
IPS_model
->
get_working_exp_resume
()
->
result
();
//
$working_exp_resume = $this->IPS_model->get_working_exp_resume()->result();
$get_data_person
[
'dpm'
]
=
$dpm
;
$get_data_person
[
'working_resume'
]
=
$working_exp_resume
;
//
$get_data_person['working_resume'] = $working_exp_resume;
$get_data_person
[
'person'
]
=
$person_get_data
[
0
];
$get_data_person
[
'person'
]
=
$person_get_data
[
0
];
$get_data_person
[
'education'
]
=
$person_get_edu_data
;
$get_data_person
[
'education'
]
=
$person_get_edu_data
;
$get_data_person
[
'p_work'
]
=
$person_get_previous_work_data
;
$get_data_person
[
'p_work'
]
=
$person_get_previous_work_data
;
...
@@ -102,6 +105,141 @@ class Supavich_controller extends CI_Controller {
...
@@ -102,6 +105,141 @@ class Supavich_controller extends CI_Controller {
$this
->
output
->
set_content_type
(
'application/json'
)
->
set_output
(
json_encode
(
$json
));
$this
->
output
->
set_content_type
(
'application/json'
)
->
set_output
(
json_encode
(
$json
));
}
}
public
function
get_dpm
()
{
$department
=
$this
->
IPS_model
->
get_join
(
'ips_department'
,
''
,
//colum in database
)
->
result
();
$data
[
'dpm'
]
=
$department
;
$json
[
'html'
]
=
$this
->
load
->
view
(
'Demo/v_supavich'
,
$data
,
TRUE
);
$this
->
output
->
set_content_type
(
'application/json'
)
->
set_output
(
json_encode
(
$json
));
}
public
function
delete_dpm
()
{
$get_working_active
=
$this
->
IPS_model
->
get_data
(
'ips_working_experience'
,
array
(
'w_dpm_id'
=>
$this
->
input
->
post
(
'dpm_id'
),
'w_status'
=>
1
));
$get_working_deactive
=
$this
->
IPS_model
->
get_data
(
'ips_working_experience'
,
array
(
'w_dpm_id'
=>
$this
->
input
->
post
(
'dpm_id'
),
'w_status'
=>
0
));
if
(
sizeof
(
$get_working_deactive
)
>
0
&&
sizeof
(
$get_working_active
)
==
0
)
{
$data
=
array
(
'dpm_status'
=>
"0"
);
$where
=
array
(
'dpm_id'
=>
$this
->
input
->
post
(
'dpm_id'
)
);
$this
->
IPS_model
->
update
(
'ips_department'
,
$data
,
$where
);
$this
->
output
->
set_content_type
(
'appication/json'
)
->
set_output
(
json_encode
([
'status'
=>
1
,
'msg'
=>
'บันทึกสำเร็จ'
]));
}
else
if
(
sizeof
(
$get_working_active
)
>
0
)
{
$this
->
output
->
set_content_type
(
'appication/json'
)
->
set_output
(
json_encode
([
'status'
=>
2
,
'msg'
=>
'บันทึกไม่สำเร็จ'
]));
}
else
if
(
sizeof
(
$get_working_active
)
==
0
&&
sizeof
(
$get_working_deactive
)
==
0
)
{
$array_where
=
array
(
'dpm_id'
=>
$this
->
input
->
post
(
'dpm_id'
)
);
$this
->
IPS_model
->
delete
(
'ips_department'
,
$array_where
);
$this
->
output
->
set_content_type
(
'appication/json'
)
->
set_output
(
json_encode
([
'status'
=>
1
,
'msg'
=>
'บันทึกสำเร็จ'
]));
}
}
public
function
ex01
()
{
$date_list
=
array
(
'02-03-2022'
,
'01-03-2022'
,
'03-03-2022'
,
'02-09-2021'
,
'02-03-2022'
);
usort
(
$date_list
,
function
(
$a
,
$b
)
{
$dateTimestamp1
=
strtotime
(
$a
);
$dateTimestamp2
=
strtotime
(
$b
);
return
$dateTimestamp1
<
$dateTimestamp2
?
-
1
:
1
;
});
$date_min
=
strval
(
$date_list
[
0
]);
$date_max
=
strval
(
$date_list
[
count
(
$date_list
)
-
1
]);
$min_diff
=
new
DateTime
(
$date_min
);
$max_diff
=
new
DateTime
(
$date_max
);
$get_year_max
=
$max_diff
->
format
(
"Y"
);
$get_year_max
=
$get_year_max
+
543
;
$get_year_min
=
$min_diff
->
format
(
"Y"
);
$get_year_min
=
$get_year_min
+
543
;
echo
'Max. date = '
.
date_format
(
$max_diff
,
'D d F'
)
.
" "
.
$get_year_max
;
echo
'<br/>'
;
echo
'Min. date = '
.
date_format
(
$min_diff
,
'D d F'
)
.
" "
.
$get_year_min
;
echo
'<br/>'
;
echo
'Difference Between Max and Min Date = '
.
$min_diff
->
diff
(
$max_diff
)
->
days
;
}
public
function
ex02
()
{
//$arr = array(30,3,1,5,18);
$arr
=
array
(
1
,
6
,
8
,
4
,
16
);
// Coding back-end 02 here!!!!
$max_arr
=
max
(
$arr
);
$min_arr
=
min
(
$arr
);
$arr_size
=
sizeof
(
$arr
);
$missing
=
""
;
$prime
=
""
;
$sum_prime
=
0
;
for
(
$i
=
$min_arr
;
$i
<=
$max_arr
;
$i
++
)
{
for
(
$j
=
0
;
$j
<
$arr_size
;
$j
++
)
{
if
(
$i
==
$arr
[
$j
])
{
break
;
}
else
{
if
(
$j
==
$arr_size
-
1
)
{
if
(
$i
!=
$arr
[
$j
])
{
$missing
.
=
$i
.
","
;
}
}
}
}
$check
=
0
;
if
(
$i
!==
1
)
{
$check
=
1
;
for
(
$k
=
2
;
$k
<=
$i
/
$k
;
$k
++
)
{
if
(
$i
%
$k
==
0
)
{
$check
=
0
;
break
;
}
}
}
if
(
$check
==
1
)
{
$prime
.
=
$i
.
","
;
$sum_prime
+=
$i
;
}
}
echo
'List of Numbers => '
;
for
(
$k
=
0
;
$k
<
$arr_size
;
$k
++
)
{
if
(
$k
==
0
)
{
echo
$arr
[
$k
];
}
else
{
echo
','
.
$arr
[
$k
];
}
}
$missing
=
substr_replace
(
$missing
,
""
,
-
1
);
$prime
=
substr_replace
(
$prime
,
""
,
-
1
);
echo
'<br>'
;
echo
'Missing Numbers => '
.
$missing
;
echo
'<br>'
;
echo
'Missing Prime Numbers => '
.
$prime
;
echo
'<br>'
;
echo
"Sum of Prime Number is => "
.
$sum_prime
;
// Coding back-end 02 here!!!!
}
// public function better_edit()
// public function better_edit()
// {
// {
// $filename = "default.jpg";
// $filename = "default.jpg";
...
...
This diff is collapsed.
Click to expand it.
html/team0/application/views/Demo/v_supavich.php
+
79
−
661
View file @
b02f0a78
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment