Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
CO-OP Search
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kittisak Maneewong
CO-OP Search
Commits
de38734c
Commit
de38734c
authored
Apr 23, 2019
by
Kittisak Maneewong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
b2e43c83
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
79 additions
and
30 deletions
+79
-30
CompanyController.php
app/Http/Controllers/CompanyController.php
+10
-14
JobController.php
app/Http/Controllers/JobController.php
+26
-3
app.js
public/js/app.js
+0
-0
Company1556008562.jpeg
public/uploads/Company1556008562.jpeg
+0
-0
Company1556018257.jpeg
public/uploads/Company1556018257.jpeg
+0
-0
route.js
resources/js/route.js
+6
-0
ConfigCompany.vue
resources/js/views/ConfigCompany.vue
+0
-4
CreateJob.vue
resources/js/views/CreateJob.vue
+4
-4
EditJob.vue
resources/js/views/EditJob.vue
+0
-0
Employer.vue
resources/js/views/Employer.vue
+10
-1
Managejob.vue
resources/js/views/Managejob.vue
+23
-4
No files found.
app/Http/Controllers/CompanyController.php
View file @
de38734c
...
...
@@ -84,8 +84,12 @@ class CompanyController extends Controller
*/
public
function
show
(
$id
)
{
$company
=
Company
::
where
(
'user_id'
,
$id
)
->
first
();
return
response
()
->
json
([
'company'
=>
$company
]);
$exists
=
Company
::
where
(
'user_id'
,
$id
)
->
exists
();
if
(
$exists
)
{
return
response
()
->
json
([
'exists'
=>
true
,
'company'
=>
Company
::
where
(
'user_id'
,
$id
)
->
first
()]);
}
else
{
return
response
()
->
json
([
'exists'
=>
false
,
'company'
=>
User
::
where
(
'id'
,
$id
)
->
first
()]);
}
}
/**
...
...
@@ -113,28 +117,22 @@ class CompanyController extends Controller
*/
public
function
update
(
Request
$request
,
$id
)
{
$imageCompany
=
null
;
$imageMap
=
null
;
$company
=
Company
::
find
(
$id
);
if
(
$request
->
get
(
'imageCompany'
)
!==
$
request
->
get
(
'currentImageCompany'
)
)
{
if
(
$request
->
get
(
'imageCompany'
)
!==
$
company
->
imageCompany
)
{
if
(
$request
->
get
(
'imageCompany'
)
!==
'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png'
)
{
$image
=
$request
->
get
(
'imageCompany'
);
$name
=
'Company'
.
time
()
.
'.'
.
explode
(
'/'
,
explode
(
':'
,
substr
(
$image
,
0
,
strpos
(
$image
,
';'
)))[
1
])[
1
];
\Image
::
make
(
$request
->
get
(
'imageCompany'
))
->
save
(
public_path
(
'uploads/'
)
.
$name
);
$imageCompany
=
'/uploads/'
.
$name
;
$
company
->
imageCompany
=
'/uploads/'
.
$name
;
}
}
else
{
$imageCompany
=
$request
->
get
(
'imageCompany'
);
}
if
(
$request
->
get
(
'imageMap'
)
!==
$
request
->
get
(
'currentImageMap'
)
)
{
if
(
$request
->
get
(
'imageMap'
)
!==
$
company
->
imageMap
)
{
if
(
$request
->
get
(
'imageMap'
))
{
$image
=
$request
->
get
(
'imageMap'
);
$name
=
'Map'
.
time
()
.
'.'
.
explode
(
'/'
,
explode
(
':'
,
substr
(
$image
,
0
,
strpos
(
$image
,
';'
)))[
1
])[
1
];
\Image
::
make
(
$request
->
get
(
'imageMap'
))
->
save
(
public_path
(
'uploads/'
)
.
$name
);
$
imageMap
=
'/uploads/'
.
$name
;
$
company
->
imageMap
=
'/uploads/'
.
$name
;
;
}
}
else
{
$imageMap
=
$request
->
get
(
'imageMap'
);
}
$company
->
company_name
=
$request
->
get
(
'company_name'
);
$company
->
company_owner
=
$request
->
get
(
'company_owner'
);
...
...
@@ -147,8 +145,6 @@ class CompanyController extends Controller
$company
->
amphoe
=
$request
->
get
(
'amphoe'
);
$company
->
province
=
$request
->
get
(
'province'
);
$company
->
zipcode
=
$request
->
get
(
'zip_code'
);
$company
->
imageCompany
=
$imageCompany
;
$company
->
imageMap
=
$imageMap
;
$company
->
lat
=
$request
->
get
(
'lat'
);
$company
->
long
=
$request
->
get
(
'lng'
);
$company
->
about
=
$request
->
get
(
'about'
);
...
...
app/Http/Controllers/JobController.php
View file @
de38734c
...
...
@@ -79,7 +79,9 @@ class JobController extends Controller
*/
public
function
edit
(
$id
)
{
//
$job
=
Job
::
find
(
$id
);
$job
->
gender
=
explode
(
', '
,
$job
->
gender
);
return
response
()
->
json
([
'job'
=>
$job
]);
}
/**
...
...
@@ -91,7 +93,27 @@ class JobController extends Controller
*/
public
function
update
(
Request
$request
,
$id
)
{
//
$gender
=
null
;
if
(
$request
->
get
(
'gender'
))
{
$gender
=
implode
(
', '
,
$request
->
get
(
'gender'
));
}
$job
=
Job
::
find
(
$id
);
$job
->
job_title
=
$request
->
get
(
'job_title'
);
$job
->
job_type
=
$request
->
get
(
'job_type'
);
$job
->
department
=
$request
->
get
(
'department'
);
$job
->
salary
=
$request
->
get
(
'salary'
);
$job
->
branch
=
$request
->
get
(
'branch'
);
$job
->
day
=
$request
->
get
(
'day'
);
$job
->
time
=
$request
->
get
(
'time'
);
$job
->
gender
=
$gender
;
$job
->
num
=
$request
->
get
(
'num'
);
$job
->
degree
=
$request
->
get
(
'degree'
);
$job
->
gpax
=
$request
->
get
(
'gpax'
);
$job
->
phase
=
$request
->
get
(
'phase'
);
$job
->
feature
=
$request
->
get
(
'feature'
);
$job
->
role
=
$request
->
get
(
'role'
);
$job
->
welfare
=
$request
->
get
(
'welfare'
);
$job
->
save
();
}
/**
...
...
@@ -102,6 +124,7 @@ class JobController extends Controller
*/
public
function
destroy
(
$id
)
{
//
Job
::
destroy
(
$id
);
}
}
public/js/app.js
View file @
de38734c
This diff is collapsed.
Click to expand it.
public/uploads/Company1556008562.jpeg
0 → 100644
View file @
de38734c
124 KB
public/uploads/Company1556018257.jpeg
0 → 100644
View file @
de38734c
56.6 KB
resources/js/route.js
View file @
de38734c
...
...
@@ -17,6 +17,7 @@ import RegisterEmployer from './views/RegisterEmployer';
import
ManagejobEmployer
from
'./views/managejob.vue'
;
import
ConfigCompany
from
'./views/ConfigCompany.vue'
;
import
CreateJob
from
'./views/CreateJob.vue'
;
import
EditJob
from
'./views/EditJob.vue'
;
import
ShowJob
from
'./views/ShowJob.vue'
;
const
router
=
new
VueRouter
({
...
...
@@ -73,6 +74,11 @@ const router = new VueRouter({
configProfile
:
true
}
},
{
path
:
'editjob/:id'
,
name
:
'editJob'
,
component
:
EditJob
},
{
path
:
'configcompany'
,
name
:
'configcompany'
,
...
...
resources/js/views/ConfigCompany.vue
View file @
de38734c
...
...
@@ -246,8 +246,6 @@ export default {
status
:
'ยังไม่ได้เลือกไฟล์'
,
nameImage
:
null
,
company_data
:
{
currentImageCompany
:
null
,
currentImageMap
:
null
,
exists
:
false
,
user_id
:
null
,
imageCompany
:
'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png'
,
...
...
@@ -519,8 +517,6 @@ export default {
console
.
log
(
res
)
const
data
=
res
.
data
.
company
if
(
res
.
data
.
exists
)
{
this
.
company_data
.
currentImageCompany
=
data
.
imageCompany
this
.
company_data
.
currentImageMap
=
data
.
imageMap
this
.
company_data
.
exists
=
res
.
data
.
exists
this
.
company_data
.
about
=
data
.
about
this
.
company_data
.
addr
=
data
.
addr
...
...
resources/js/views/CreateJob.vue
View file @
de38734c
<
template
>
<div
class=
""
>
<v-layout
row
wrap
justify-center
>
<v-form
@
submit
.
prevent=
"createJob()"
ref=
"job"
>
<v-layout
row
wrap
justify-center
>
<v-flex
xs12
sm10
offset-sm-1
class=
"ma-2"
>
<v-flex
class=
"bg-title pa-2"
>
<v-layout
row
wrap
align-center
>
...
...
@@ -109,7 +109,7 @@
<v-flex
class=
"bg-body pa-4"
>
<v-layout
row
wrap
>
<v-flex
xs12
sm6
class=
"px-3"
>
<v-
combobox
<v-
select
v-model=
"job_data.gender"
:items=
"items"
label=
"เพศ"
...
...
@@ -131,7 +131,7 @@
{{
data
.
item
}}
</v-chip>
</
template
>
</v-
combobox
>
</v-
select
>
<v-select
label=
"ระดับการศึกษา"
v-model=
"job_data.degree"
...
...
@@ -176,8 +176,8 @@
</v-flex>
</v-flex>
<v-flex
xs12
sm10
offset-sm-1
class=
"my-1 text-xs-center text-sm-center."
><v-btn
type=
"submit"
round
dark
color=
"blue accent-3"
class=
"px-3 white--text"
>
เพิ่มข้อมูลงาน
</v-btn></v-flex>
</v-form>
</v-layout>
</v-form>
</div>
</template>
...
...
resources/js/views/EditJob.vue
0 → 100644
View file @
de38734c
This diff is collapsed.
Click to expand it.
resources/js/views/Employer.vue
View file @
de38734c
...
...
@@ -6,7 +6,7 @@
ยินดีต้อนรับ
</v-flex>
<v-flex
xs12
sm12
class=
"font-weight-bold black--text subheading"
>
ake8225
{{
user
}}
</v-flex>
</v-flex>
<v-flex
xs12
sm6
>
...
...
@@ -121,6 +121,7 @@
export
default
{
data
()
{
return
{
user
:
null
,
companies
:
{
about
:
null
,
addr
:
null
,
...
...
@@ -161,9 +162,17 @@ export default {
beforeMount
()
{
this
.
$store
.
dispatch
(
'checkEmployer'
)
.
then
(
res
=>
{
this
.
user
=
res
.
username
axios
.
get
(
`/api/companys/
${
res
.
id
}
`
)
.
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
data
.
exists
)
{
this
.
companies
=
res
.
data
.
company
}
else
{
this
.
companies
.
phone_no
=
res
.
data
.
company
.
tel
this
.
companies
.
email
=
res
.
data
.
company
.
email_employers
this
.
companies
.
company_name
=
res
.
data
.
company
.
company_name
}
if
(
!
this
.
companies
.
imageCompany
)
{
this
.
companies
.
imageCompany
=
'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png'
}
...
...
resources/js/views/Managejob.vue
View file @
de38734c
...
...
@@ -6,7 +6,7 @@
<v-text-field
v-model=
"search"
append-icon=
"search"
label=
"
Search
"
label=
"
ค้นหา
"
single-line
hide-details
></v-text-field>
...
...
@@ -17,6 +17,9 @@
:items=
"items"
class=
"elevation-1"
:search=
"search"
rows-per-page-text=
"จำนวนเเถวต่อหน้า"
no-results-text=
"ไม่พบข้อมูล"
no-data-text=
"ไม่มีข้อมูล"
>
<template
v-slot:items=
"props"
>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
id
}}
</td>
...
...
@@ -25,12 +28,15 @@
<td
width=
"15%"
class=
"text-sm-center"
>
{{
props
.
item
.
position
}}
</td>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
salary
}}
</td>
<td
width=
"20%"
class=
"text-sm-center"
>
<v-btn
depressed
class=
"mx-1"
fab
outline
small
color=
"cyan"
>
<v-layout
row
wrap
justify-center
>
<v-btn
depressed
class=
"mx-1"
fab
outline
small
color=
"cyan"
@
click=
"$router.push(`/employer/editjob/$
{props.item.job_id}`)">
<v-icon>
edit
</v-icon>
</v-btn>
<v-btn
depressed
class=
"mx-1"
fab
outline
small
color=
"red"
>
<v-btn
depressed
class=
"mx-1"
fab
outline
small
color=
"red"
@
click=
"deleteJob(props.item.job_id)"
>
<v-icon>
delete
</v-icon>
</v-btn>
</v-layout>
</td>
</
template
>
</v-data-table>
...
...
@@ -53,12 +59,21 @@ export default {
items
:
[]
}
},
beforeMount
()
{
methods
:
{
deleteJob
(
id
)
{
axios
.
delete
(
`/api/jobs/
${
id
}
`
)
.
then
(
res
=>
{
this
.
getData
()
})
.
catch
(
err
=>
{
console
.
log
(
err
.
response
)})
},
getData
()
{
this
.
$store
.
dispatch
(
'checkEmployer'
)
.
then
(
res
=>
{
axios
.
get
(
`/api/jobs/
${
res
.
id
}
`
)
.
then
(
res
=>
{
console
.
log
(
res
)
this
.
items
=
[]
const
jobs
=
res
.
data
.
jobs
for
(
let
i
=
0
;
i
<
jobs
.
length
;
i
++
)
{
this
.
items
.
push
({
...
...
@@ -77,5 +92,9 @@ export default {
})
.
catch
(
err
=>
{
console
.
log
(
err
.
response
)})
}
},
beforeMount
()
{
this
.
getData
()
}
}
</
script
>
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