Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
Kinetic on Steroids
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
Kenneth Kaigu
Kinetic on Steroids
Commits
ca2dd9e0
Commit
ca2dd9e0
authored
Mar 20, 2019
by
Kenneth Kaigu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an employee to the database and display the employee to ensure that they are visible on the ui
parent
cc4a1fdd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
512 additions
and
323 deletions
+512
-323
workspace.xml
.idea/workspace.xml
+147
-60
EmployeeController.php
app/Http/Controllers/EmployeeController.php
+16
-52
app.kinetic.js
public/js/app.kinetic.js
+236
-0
dashboard.blade.php
resources/views/Dashboard/dashboard.blade.php
+30
-83
index.blade.php
resources/views/Employees/index.blade.php
+82
-127
Employeesmaster.blade.php
resources/views/Layout/Employeesmaster.blade.php
+1
-1
No files found.
.idea/workspace.xml
View file @
ca2dd9e0
This diff is collapsed.
Click to expand it.
app/Http/Controllers/EmployeeController.php
View file @
ca2dd9e0
...
@@ -60,9 +60,24 @@ class EmployeeController extends Controller
...
@@ -60,9 +60,24 @@ class EmployeeController extends Controller
'nhif'
=>
[
'required'
],
'nhif'
=>
[
'required'
],
'nssf'
=>
[
'required'
],
'nssf'
=>
[
'required'
],
'employmentdate'
=>
[
'required'
],
'employmentdate'
=>
[
'required'
],
'gender'
=>
[
'required'
],
'gender'
=>
[
'required'
],
'yearsofexperience'
=>
[
'required'
],
'yearsofexperience'
=>
[
'required'
],
]);
]);
$employeeTest
->
prefix
=
$request
->
prefix
;
$employeeTest
->
firstname
=
$request
->
firstname
;
$employeeTest
->
middlename
=
$request
->
middlename
;
$employeeTest
->
lastname
=
$request
->
lastname
;
$employeeTest
->
phonenumber
=
$request
->
phonenumber
;
$employeeTest
->
krapin
=
$request
->
krapin
;
$employeeTest
->
nhif
=
$request
->
nhif
;
$employeeTest
->
nssf
=
$request
->
nssf
;
$employeeTest
->
employmentdate
=
$request
->
employmentdate
;
$employeeTest
->
gender
=
$request
->
gender
;
$employeeTest
->
yearsofexperience
=
$request
->
yearsofexperience
;
$employeeTest
->
saveOrFail
();
return
response
()
->
json
(
$employeeTest
);
}
}
/**
/**
...
@@ -169,55 +184,4 @@ class EmployeeController extends Controller
...
@@ -169,55 +184,4 @@ class EmployeeController extends Controller
}
}
public
function
personalinfo
(
Request
$request
)
{
$request
->
validate
([
'name'
=>
'required'
,
'dateofBirth'
=>
'required'
,
'relation'
=>
'required'
,
]);
$dependant
=
new
Dependants
([
'name'
=>
$request
->
get
(
'name'
),
'dateofBirth'
=>
$request
->
get
(
'dateofBirth'
),
'relation'
=>
$request
->
get
(
'relation'
),
]);
$dependant
->
save
();
return
redirect
(
'/employees/create'
)
->
with
(
'success'
,
'Dependant has been added'
);
}
public
function
dependantedit
(
$id
)
{
$dependant
=
Dependants
::
find
(
$id
);
return
redirect
(
'/employees/create'
,
compact
(
'dependant'
));
}
public
function
updateDependant
(
Request
$request
,
$id
)
{
$request
->
validate
([
'name'
=>
'required'
,
'dateofBirth'
=>
'required'
,
'relation'
=>
'required'
,
]);
$dependant
=
Dependants
::
find
(
$id
);
$dependant
->
name
=
$request
->
get
(
'name'
);
$dependant
->
dateofBirth
=
$request
->
get
(
'dateofBirth'
);
$dependant
->
relation
=
$request
->
get
(
'relation'
);
$dependant
->
save
();
return
redirect
(
'/employees/create'
)
->
with
(
'success'
,
'Dependant has been updated'
);
}
public
function
dependantdestroy
(
$id
)
{
$dependant
=
Dependants
::
find
(
$id
);
dd
(
$dependant
);
$dependant
->
delete
();
return
redirect
(
'/employees/create'
)
->
with
(
'success'
,
'Dependant has been deleted successfully'
);
}
}
}
public/js/app.kinetic.js
View file @
ca2dd9e0
This diff is collapsed.
Click to expand it.
resources/views/Dashboard/dashboard.blade.php
View file @
ca2dd9e0
<!doctype html>
@
extends
(
'Layout.Employeesmaster'
)
<html
lang=
"{{ str_replace('_', '-', app()->getLocale()) }}"
>
<head>
@
section
(
'title'
,
'Dashboard'
)
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
@
section
(
'content'
)
<
div
class
="
scrollable
padder
">
<title>
Laravel
</title>
<ul class="
breadcrumb
no
-
border
no
-
radius
b
-
b
b
-
light
pull
-
in
">
<li><a href=""><i class="
fa
fa
-
home
"></i> Home</a></li>
<!-- Fonts -->
<li class="
active
">Dashboard</li>
<link
href=
"https://fonts.googleapis.com/css?family=Nunito:200,600"
rel=
"stylesheet"
type=
"text/css"
>
</ul>
<div class="
m
-
b
-
md
">
<!-- Styles -->
<h3 class="
m
-
b
-
none
">Dashboard</h3>
<style>
<small>Welcome back, User Name</small>
html
,
body
{
</div>
background-color
:
#fff
;
<section class="
panel
panel
-
default
">
color
:
#636b6f
;
<div class="
row
m
-
l
-
none
m
-
r
-
none
bg
-
light
lter
">
font-family
:
'Nunito'
,
sans-serif
;
<div class="
col
-
sm
-
6
col
-
md
-
3
padder
-
v
b
-
r
b
-
light
">
font-weight
:
200
;
<span class="
fa
-
stack
fa
-
2
x
pull
-
left
m
-
r
-
sm
">
height
:
100vh
;
<i class="
fa
fa
-
circle
fa
-
stack
-
2
x
text
-
info
"></i>
margin
:
0
;
<i class="
fa
fa
-
male
fa
-
stack
-
1
x
text
-
white
"></i>
}
</span>
<a class="
clear
" href="
#">
.full-height
{
<
span
class
="
h3
block
m
-
t
-
xs
"><strong>{{ \App\EmployeeTest::all()->count() }}</strong></span>
height
:
100vh
;
<small class="
text
-
muted
text
-
uc
">Employees</small>
}
</a>
</div>
.flex-center
{
</div>
align-items
:
center
;
</section>
display
:
flex
;
</div>
justify-content
:
center
;
@endsection
}
.position-ref
{
position
:
relative
;
}
.top-right
{
position
:
absolute
;
right
:
10px
;
top
:
18px
;
}
.content
{
text-align
:
center
;
}
.title
{
font-size
:
84px
;
}
.links
>
a
{
color
:
#636b6f
;
padding
:
0
25px
;
font-size
:
13px
;
font-weight
:
600
;
letter-spacing
:
.1rem
;
text-decoration
:
none
;
text-transform
:
uppercase
;
}
.m-b-md
{
margin-bottom
:
30px
;
}
</style>
</head>
<body>
<div
class=
"flex-center position-ref full-height"
>
@if (Route::has('login'))
<div
class=
"top-right links"
>
@auth
<a
href=
"{{ url('/home') }}"
>
Home
</a>
@else
<a
href=
"{{ route('login') }}"
>
Login
</a>
@if (Route::has('register'))
<a
href=
"{{ route('register') }}"
>
Register
</a>
@endif
@endauth
</div>
@endif
</div>
</div>
</body>
</html>
resources/views/Employees/index.blade.php
View file @
ca2dd9e0
...
@@ -2,137 +2,92 @@
...
@@ -2,137 +2,92 @@
@
section
(
'title'
,
'Employees'
)
@
section
(
'title'
,
'Employees'
)
<
style
>
<
style
>
#import_file
{
#import_file
{
-
webkit
-
appearance
:
none
;
-
webkit
-
appearance
:
none
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
opacity
:
0
;
opacity
:
0
;
width
:
100
%
;
width
:
100
%
;
height
:
100
%
;
height
:
100
%
;
}
}
</
style
>
</
style
>
@
section
(
'content'
)
@
section
(
'content'
)
<
section
id
=
"content"
>
<
section
id
=
"content"
>
<
section
class
="
scrollable
padder
">
<
section
class
="
scrollable
padder
">
<ul class="
breadcrumb
no
-
border
no
-
radius
b
-
b
b
-
light
pull
-
in
">
<ul class="
breadcrumb
no
-
border
no
-
radius
b
-
b
b
-
light
pull
-
in
">
<li><a href="
.
"><i class="
fa
fa
-
home
"></i> Home</a></li>
<li><a href="
.
"><i class="
fa
fa
-
home
"></i> Home</a></li>
<li class="
active
">Employees</li>
<li class="
active
">Employees</li>
</ul>
</ul>
<div class=container-fluid>
@if ( session('success') )
<div class=row style="
float
:
right
;
position
:
relative
">
<div class="
alert
alert
-
success
alert
-
dismissible
" role="
alert
">
<div class=col-md-3 style=width:49.5%>
<button type="
button
" class="
close
" data-dismiss="
alert
" aria-label="
Close
">
<a href="
{{
route
(
'export'
)
}}
">
<span aria-hidden="
true
">×</span>
<button class="
btn
btn
-
success
">Download Excel xls</button>
<span class="
sr
-
only
">Close</span>
</a>
</button>
</div>
<strong>{{ session('success') }}</strong>
<div class=col-md-3 style=width:49.5%>
</div>
<form action="
{{
route
(
'import'
)
}}
" method="
POST
" enctype="
multipart
/
form
-
data
"
@endif
id="
importForm
">
{{ csrf_field() }}
@if (session('error'))
<input type="
file
" name="
file
" class="
form
-
control
" id="
import_file
">
<div class="
alert
alert
-
danger
alert
-
dismissible
" role="
alert
">
<input type="
submit
" class="
btn
btn
-
success
" value="
Import
File
">
<button type="
button
" class="
close
" data-dismiss="
alert
" aria-label="
Close
">
</form>
<span aria-hidden="
true
">×</span>
</div>
<span class="
sr
-
only
">Close</span>
</div>
</button>
<div class=row>
<strong>{{ session('error') }}</strong>
<legend style="
padding
:
25
px
5
px
5
px
10
px
">Employees</legend>
</div>
<div class="
pull
-
right
" style="
margin
:
5
px
20
px
5
px
10
px
;
">
@endif
<a href="
{{
route
(
'employees.create'
)
}}
" class="
btn
btn
-
info
btn
-
sm
"><i class="
fa
fa
-
plus
"></i>Add
Employee</a>
@if (count(
$errors
) > 0)
</div>
<div class="
alert
alert
-
danger
">
</div>
<a href="
#" class="close" data-dismiss="alert" aria-label="close">×</a>
<div class=row style="
padding
:
0
px
5
px
5
px
10
px
">
<
div
>
<div class="
table
-
responsive
" style="
padding
:
0
px
5
px
5
px
10
px
">
@
foreach
(
$errors
->
all
()
as
$error
)
<table class="
table
table
-
striped
m
-
b
-
sm
datagrid
">
<
p
>
{{
$error
}}
</
p
>
<thead>
@
endforeach
<tr>
</
div
>
<th>Action</th>
</
div
>
<th>First Name</th>
@
endif
<th>Last Name</th>
<
div
class
=
container
-
fluid
>
<th>Email</th>
<
div
class
=
row
style
=
"float:right;position:relative"
>
<th>Phone No.</th>
<
div
class
=
col
-
md
-
3
style
=
width
:
49.5
%>
</tr>
<
a
href
=
"{{ route('export') }}"
><
button
class
="
btn
btn
-
success
">Download Excel xls</button></a>
</thead>
</div>
<tbody>
<div class=col-md-3 style=width:49.5%>
@foreach(\App\EmployeeTest::all() as
$employee
)
<form action="
{{
route
(
'import'
)
}}
" method="
POST
" enctype="
multipart
/
form
-
data
" id="
importForm
">
<tr>
{{ csrf_field() }}
<td>
<input type="
file
" name="
file
" class="
form
-
control
" id="
import_file
" >
<a href=""><span class="
btn
btn
-
default
btn
-
sm
"><i class="
fa
fa
-
eye
no
-
margin
"></i></span></a>
<input type="
submit
" class="
btn
btn
-
success
" value="
Import
File
" >
<a href=""><span class="
btn
btn
-
default
btn
-
sm
"><i class="
fa
fa
-
edit
no
-
margin
"></i></span></a>
</form>
</div>
</div>
<div class=row>
<legend style="
padding
:
25
px
5
px
5
px
10
px
">Employees</legend>
<div class="
pull
-
right
" style="
margin
:
5
px
20
px
5
px
10
px
;
">
<a href="
{{
route
(
'employees.create'
)
}}
" class="
btn
btn
-
info
btn
-
sm
"><i class="
fa
fa
-
plus
"></i>Add Employee</a>
</div>
</div>
<div class=row style="
padding
:
0
px
5
px
5
px
10
px
">
<div class="
table
-
responsive
" style="
padding
:
0
px
5
px
5
px
10
px
">
<table class="
table
table
-
striped
m
-
b
-
sm
datagrid
">
<thead>
<tr>
<th>Action</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Phone No.</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href=""><span class="
btn
btn
-
default
btn
-
sm
"><i class="
fa
fa
-
eye
no
-
margin
"></i></span></a>
<a href=""><span class="
btn
btn
-
default
btn
-
sm
"><i class="
fa
fa
-
edit
no
-
margin
"></i></span></a>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="
2
" class="
text
-
center
">Nothing to display</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<script>
var form = document.getElementById('importForm');
var input = document.getElementById('import_file');
var change_running = false;
input.addEventListener('change', function(){
if(!change_running){
setTimeout(function(){
change_running = true;
form.submit();
change_running = false;
}, 300);
}
});
</script>
@endsection
@section('footer-include')
<!-- fuelux -->
<script src="
/
js
/
libs
/
underscore
-
min
.
js
"></script>
<script src="
/
js
/
fuelux
/
fuelux
.
js
"></script>
{{--<script src="
js
/
fuelux
/
demo
.
datagrid
.
js
"></script>--}}
<!-- select2 -->
@endsection
@section('j-script')
</td>
<!-- Jquery -->
<td>{{
$employee->firstname
}} {{
$employee->middlename
}} </td>
<td>{{
$employee->lastname
}}</td>
<td>{{
$employee->email
?? '' }}</td>
<td>{{
$employee->phonenumber
}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</section>
</section>
<script>
<script>
$(document).on('ready', function(){
var form = document.getElementById('importForm');
var input = document.getElementById('import_file');
var change_running = false;
input.addEventListener('change', function () {
if (!change_running) {
setTimeout(function () {
change_running = true;
form.submit();
change_running = false;
}, 300);
}
});
});
</script>
</script>
@endsection
@endsection
\ No newline at end of file
resources/views/Layout/Employeesmaster.blade.php
View file @
ca2dd9e0
...
@@ -263,6 +263,6 @@
...
@@ -263,6 +263,6 @@
<script
src=
"{{asset('js/bootstrap.js')}}"
></script>
<script
src=
"{{asset('js/bootstrap.js')}}"
></script>
<script
src=
"{{ asset('js/app.js') }}"
></script>
<script
src=
"{{ asset('js/app.js') }}"
></script>
<!-- App -->
<!-- App -->
{{--
<script
src=
"{{asset('js/app.kinetic.js')}}"
></script>
--}}
<script
src=
"{{asset('js/app.kinetic.js')}}"
></script>
</body>
</body>
</html>
</html>
\ 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