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
590108b0
Commit
590108b0
authored
Apr 24, 2019
by
Kittisak Maneewong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
successfully project
parent
b61018cb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
29 deletions
+53
-29
ApplicantController.php
app/Http/Controllers/ApplicantController.php
+2
-1
CompanyController.php
app/Http/Controllers/CompanyController.php
+4
-2
app.js
public/js/app.js
+0
-0
Employer.vue
resources/js/views/Employer.vue
+4
-2
showapplicant.vue
resources/js/views/showapplicant.vue
+43
-24
No files found.
app/Http/Controllers/ApplicantController.php
View file @
590108b0
...
...
@@ -55,7 +55,8 @@ class ApplicantController extends Controller
*/
public
function
show
(
$id
)
{
//
$applicants
=
Applicant
::
join
(
'jobs'
,
'applicants.job_id'
,
'jobs.id'
)
->
where
(
'jobs.user_id'
,
$id
)
->
get
();
return
response
()
->
json
([
'applicants'
=>
$applicants
]);
}
/**
...
...
app/Http/Controllers/CompanyController.php
View file @
590108b0
...
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use
App\Company
;
use
App\User
;
use
App\Job
;
use
App\Applicant
;
use
Illuminate\Http\Request
;
class
CompanyController
extends
Controller
...
...
@@ -87,10 +88,11 @@ class CompanyController extends Controller
{
$exists
=
Company
::
where
(
'user_id'
,
$id
)
->
exists
();
$count
=
Job
::
where
(
'user_id'
,
$id
)
->
count
();
$acount
=
Applicant
::
join
(
'jobs'
,
'applicants.job_id'
,
'jobs.id'
)
->
where
(
'jobs.user_id'
,
$id
)
->
count
();
if
(
$exists
)
{
return
response
()
->
json
([
'exists'
=>
true
,
'company'
=>
Company
::
where
(
'user_id'
,
$id
)
->
first
(),
'count'
=>
$count
]);
return
response
()
->
json
([
'exists'
=>
true
,
'company'
=>
Company
::
where
(
'user_id'
,
$id
)
->
first
(),
'count'
=>
$count
,
'acount'
=>
$acount
]);
}
else
{
return
response
()
->
json
([
'exists'
=>
false
,
'company'
=>
User
::
where
(
'id'
,
$id
)
->
first
(),
'count'
=>
$count
]);
return
response
()
->
json
([
'exists'
=>
false
,
'company'
=>
User
::
where
(
'id'
,
$id
)
->
first
(),
'count'
=>
$count
,
'acount'
=>
$acount
]);
}
}
...
...
public/js/app.js
View file @
590108b0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
resources/js/views/Employer.vue
View file @
590108b0
...
...
@@ -66,7 +66,7 @@
ผู้ที่สมัครงาน
</v-flex>
<v-flex
xs12
sm12
class=
"subheading font-weight-black"
>
0
คน
{{
countA
}}
คน
</v-flex>
</v-flex>
<v-flex
xs12
sm4
class=
"text-sm-center text-xs-center"
>
...
...
@@ -74,7 +74,7 @@
<v-icon
dark
small
>
fas fa-cogs
</v-icon>
จัดการข้อมูลงาน
</v-btn>
<v-btn
small
depressed
color=
"primary"
dark
>
<v-btn
small
depressed
color=
"primary"
dark
@
click=
"$router.push('/employer/showapplicant')"
>
<v-icon
dark
small
>
fas fa-users
</v-icon>
จัดการข้อมูลผู้สมัคร
</v-btn>
</v-flex>
...
...
@@ -127,6 +127,7 @@ export default {
user
:
null
,
exists
:
false
,
countJob
:
0
,
countA
:
0
,
companies
:
{
about
:
null
,
addr
:
null
,
...
...
@@ -172,6 +173,7 @@ export default {
.
then
(
res
=>
{
console
.
log
(
res
)
this
.
exists
=
res
.
data
.
exists
this
.
countA
=
res
.
data
.
acount
this
.
countJob
=
res
.
data
.
count
if
(
res
.
data
.
exists
)
{
this
.
companies
=
res
.
data
.
company
...
...
resources/js/views/showapplicant.vue
View file @
590108b0
...
...
@@ -23,22 +23,14 @@
no-data-text=
"ไม่มีข้อมูล"
>
<template
v-slot:items=
"props"
>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
id
}}
</td>
<td
width=
"30%"
class=
"text-sm-left"
>
{{
props
.
item
.
topic
}}
</td>
<td
width=
"15%"
class=
"text-sm-center"
>
{{
props
.
item
.
typejob
}}
</td>
<td
width=
"20%"
class=
"text-sm-center"
>
{{
props
.
item
.
position
}}
</td>
<td
width=
"5%"
class=
"text-sm-center"
>
{{
props
.
item
.
salary
}}
</td>
<td
width=
"20%"
class=
"text-sm-center"
>
<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"
@
click=
"deleteJob(props.item.job_id)"
>
<v-icon>
delete
</v-icon>
</v-btn>
</v-layout>
</td>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
name
}}
</td>
<td
width=
"35%"
class=
"text-sm-left"
>
{{
props
.
item
.
job_title
}}
</td>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
email
}}
</td>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
degree
}}
</td>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
major
}}
</td>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
faculty
}}
</td>
<td
width=
"10%"
class=
"text-sm-center"
>
{{
props
.
item
.
university
}}
</td>
<td
width=
"5%"
class=
"text-sm-center"
>
{{
props
.
item
.
gpax
}}
</td>
</
template
>
</v-data-table>
<v-layout
row
wrap
justify-center
>
...
...
@@ -53,18 +45,44 @@ export default {
return
{
search
:
''
,
headers
:
[
{
text
:
'ชื่อผุ้สมัคร'
,
value
:
'
id
'
,
align
:
'center'
},
{
text
:
'หัวข้องาน'
,
value
:
'
topic
'
,
align
:
'center'
},
{
text
:
'อีเมล'
,
value
:
'
typejob
'
,
align
:
'center'
},
{
text
:
'ระดับการศึกษา'
,
value
:
'
position
'
,
align
:
'center'
},
{
text
:
'สาขา'
,
value
:
'
salary
'
,
align
:
'center'
},
{
text
:
'คณะ'
,
value
:
'
salar
y'
,
align
:
'center'
},
{
text
:
'สถาบัน'
,
value
:
'
salar
y'
,
align
:
'center'
},
{
text
:
'gpax'
,
value
:
'
salary
'
,
align
:
'center'
}
{
text
:
'ชื่อผุ้สมัคร'
,
value
:
'
name
'
,
align
:
'center'
},
{
text
:
'หัวข้องาน'
,
value
:
'
job_title
'
,
align
:
'center'
},
{
text
:
'อีเมล'
,
value
:
'
email
'
,
align
:
'center'
},
{
text
:
'ระดับการศึกษา'
,
value
:
'
degree
'
,
align
:
'center'
},
{
text
:
'สาขา'
,
value
:
'
major
'
,
align
:
'center'
},
{
text
:
'คณะ'
,
value
:
'
facult
y'
,
align
:
'center'
},
{
text
:
'สถาบัน'
,
value
:
'
universit
y'
,
align
:
'center'
},
{
text
:
'gpax'
,
value
:
'
gpax
'
,
align
:
'center'
}
],
items
:
[]
}
},
beforeMount
()
{
this
.
$store
.
dispatch
(
'checkEmployer'
)
.
then
(
res
=>
{
axios
.
get
(
`/api/applicants/
${
res
.
id
}
`
)
.
then
(
res
=>
{
console
.
log
(
res
)
this
.
items
=
[]
res
.
data
.
applicants
.
forEach
(
item
=>
{
this
.
items
.
push
({
name
:
item
.
name
,
job_title
:
item
.
job_title
,
email
:
item
.
email
,
degree
:
item
.
degree
,
major
:
item
.
major
,
faculty
:
item
.
faculty
,
university
:
item
.
university
,
gpax
:
item
.
gpax
})
});
})
.
catch
(
err
=>
{
console
.
log
(
err
.
response
)})
})
.
catch
(
err
=>
{
console
.
log
(
err
.
response
)
})
}
}
</
script
>
\ No newline at end of file
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