Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
7b0dfdf1
Commit
7b0dfdf1
authored
Jul 21, 2022
by
Antonio Durval
Browse files
Adição de um campo de busca na tela de lsitagens dos usuarios
parent
cb72f007
Changes
1
Hide whitespace changes
Inline
Side-by-side
resources/views/administrador/usersAdmin.blade.php
View file @
7b0dfdf1
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<
div
class
=
"container"
style
=
"margin-top: 30px;"
>
<
div
class
=
"container"
style
=
"margin-top: 30px;"
>
<
div
class
=
"container"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"row"
>
@
if
(
session
(
'mensagem'
))
@
if
(
session
(
'mensagem'
))
<
div
class
=
"col-md-12"
style
=
"margin-top: 30px;"
>
<
div
class
=
"col-md-12"
style
=
"margin-top: 30px;"
>
...
@@ -29,6 +29,9 @@
...
@@ -29,6 +29,9 @@
</
div
>
</
div
>
</
div
>
</
div
>
<
hr
>
<
hr
>
<
div
class
=
"col-sm-4 mb-3"
style
=
"display:flex; margin:auto;"
>
<
input
type
=
"text"
class
=
"form-control form-control-edit"
placeholder
=
"Digite o nome do usuário..."
onkeyup
=
"buscar(this)"
>
<
img
src
=
"
{
{asset('img/icons/logo_lupa.png')}
}
"
alt
=
""
>
</
div
>
<
table
class
=
"table table-bordered"
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
thead
>
<
tr
>
<
tr
>
...
@@ -38,11 +41,11 @@
...
@@ -38,11 +41,11 @@
<
th
scope
=
"col"
>
Opções
</
th
>
<
th
scope
=
"col"
>
Opções
</
th
>
</
tr
>
</
tr
>
</
thead
>
</
thead
>
<
tbody
>
<
tbody
id
=
"usuarios"
>
@
foreach
(
$users
as
$user
)
@
foreach
(
$users
as
$user
)
@
if
(
auth
()
->
user
()
->
id
!=
$user
->
id
)
@
if
(
auth
()
->
user
()
->
id
!=
$user
->
id
)
@
if
(
auth
()
->
user
()
->
id
!=
"administrador"
)
@
if
(
auth
()
->
user
()
->
id
!=
"administrador"
)
<
tr
>
<
tr
class
=
"apareceu"
>
<
td
>
<
td
>
{{
$user
->
name
}}
{{
$user
->
name
}}
</
td
>
</
td
>
...
@@ -117,6 +120,32 @@
...
@@ -117,6 +120,32 @@
@
section
(
'javascript'
)
@
section
(
'javascript'
)
<
script
>
<
script
>
function
buscar
(
input
)
{
let
nome_usuarios
=
document
.
getElementById
(
"usuarios"
)
.
children
;
if
(
input
.
value
.
length
>
2
)
{
for
(
let
i
=
0
;
i
<
nome_usuarios
.
length
;
i
++
){
if
(
nome_usuarios
[
i
]
.
classList
.
contains
(
"apareceu"
)){
let
nameUser
=
nome_usuarios
[
i
]
.
children
[
0
]
.
textContent
;
console
.
log
(
nameUser
);
if
(
nameUser
.
toLowerCase
()
.
substr
(
0
)
.
indexOf
(
input
.
value
.
toLowerCase
())
>=
0
)
{
nome_usuarios
[
i
]
.
style
.
display
=
""
;
}
else
{
nome_usuarios
[
i
]
.
style
.
display
=
"none"
;
}
}
}
}
else
{
for
(
let
i
=
0
;
i
<
nome_usuarios
.
length
;
i
++
)
{
if
(
nome_usuarios
[
i
]
.
classList
.
contains
(
"apareceu"
)){
nome_usuarios
[
i
]
.
style
.
display
=
""
;
}
}
}
}
</
script
>
</
script
>
@
endsection
@
endsection
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