Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nutricao
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PET Computação
nutricao
Commits
e5d112dd
Commit
e5d112dd
authored
8 years ago
by
mmc16
Browse files
Options
Downloads
Patches
Plain Diff
Prototipo com insercoes de dados da empresa
parents
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
prototipo.html
+173
-0
173 additions, 0 deletions
prototipo.html
with
173 additions
and
0 deletions
prototipo.html
0 → 100644
+
173
−
0
View file @
e5d112dd
<html>
<head>
<meta
charset=
"utf-8"
>
<style>
td
{
outline-style
:
solid
;
outline-width
:
2px
;
}
center
{
padding
:
2px
;}
</style>
<script
language=
"JavaScript"
>
tiposDePreparo
=
[
"
Salada1
"
,
"
Salada2
"
,
"
Prato principal
"
,
"
Acompanhamento
"
,
"
Bebida
"
,
"
Sobremesa
"
];
class
DadosEmpresa
{
getCNPJ
(){
return
this
.
_cnpj
}
setCNPJ
(
_cnpj
)
{
this
.
_cnpj
=
_cnpj
;}
getNome
(){
return
this
.
_nome
}
setNome
(
_nome
)
{
this
.
_nome
=
_nome
;}
getTelefone
(){
return
this
.
_telefone
}
setTelefone
(
_telefone
)
{
this
.
_telefone
=
_telefone
;}
getResponsavel
(){
return
this
.
_responsavel
}
setResponsavel
(
_responsavel
)
{
this
.
_responsavel
=
_responsavel
;}
constructor
(
nome
,
cnpj
,
telefone
,
responsavel
){
this
.
setCNPJ
(
cnpj
);
this
.
setNome
(
nome
);
this
.
setTelefone
(
telefone
);
this
.
setResponsavel
(
responsavel
);
}
}
class
MediaRef
{
getCafe
(){
return
this
.
_cafe
}
setCafe
(
_responsavel
)
{
this
.
_cafe
=
_cafe
;}
getAlmoco
(){
return
this
.
_almoco
}
setAlmoco
(
_almoco
)
{
this
.
_almoco
=
_almoco
;}
getJanta
(){
return
this
.
_janta
}
setJanta
(
_janta
)
{
this
.
_janta
=
_janta
;}
}
class
NecessidadesNutr
{
getPat
(){
return
this
.
_pat
}
setPat
(
_pat
)
{
this
.
_pat
=
_pat
;}
getPnae
(){
return
this
.
_pnae
}
setPnae
(
_pnae
)
{
this
.
_pnae
=
_pnae
;}
getDris
(){
return
this
.
_dris
}
setDris
(
_dris
)
{
this
.
_dris
=
_dris
;}
getOutros
(){
return
this
.
_outros
}
setOutros
(
_outros
)
{
this
.
_outros
=
_outros
;}
getIdades
(){
return
this
.
_idades
}
setIdades
(
_idades
)
{
this
.
_idades
=
_idades
;}
}
class
TipoCardapio
{
getConjunto
(){
return
this
.
_conjunto
;}
setConjunto
(
_conjunto
){
this
.
_conjunto
=
_conjunto
;}
getPrecoRef
(){
return
this
.
_precoRef
}
setPrecoRef
(
_precoRef
){
this
.
_precoRef
=
this
.
_precoRef
}
getPrecoTotal
(){
return
this
.
_precoTotal
}
setPrecoTotal
(
_precoTotal
){
this
.
_precoTotal
=
this
.
_precoTotal
}
}
class
Empresa
{
getDados
(){
return
this
.
_dados
}
setDados
(
_cnpj
)
{
this
.
_dados
=
_cnpj
;}
getMediaRef
(){
return
this
.
_mediaRef
}
setMediaRef
(
_mediaRef
)
{
this
.
_mediaRef
=
_mediaRef
;}
getNecessidadesNutr
(){
return
this
.
_necessidadesNutr
}
setNecessidadesNutr
(
_necessidadesNutr
)
{
this
.
_necessidadesNutr
=
_necessidadesNutr
;}
getTiposCardapios
(){
return
this
.
_tiposCardapios
;}
setTiposCardapios
(
_tiposCardapios
){
this
.
_tiposCardapios
=
_tiposCardapios
;}
constructor
(
nome
,
cnpj
,
telefone
,
responsavel
){
this
.
setDados
(
new
DadosEmpresa
(
nome
,
cnpj
,
telefone
,
responsavel
))
}
}
ListaEmpresas
=
[]
function
cadastraEmpresa
(){
ListaEmpresas
.
push
(
new
Empresa
(
document
.
getElementById
(
"
nomeEmpresa
"
).
value
,
document
.
getElementById
(
"
cnpj
"
).
value
,
document
.
getElementById
(
"
telefone
"
).
value
,
document
.
getElementById
(
"
responsavel
"
).
value
)
);
atualizaEmpresas
();
}
function
alertDadosEmpresa
(
e
){
dados
=
ListaEmpresas
[
e
].
getDados
();
alert
(
dados
.
getNome
()
+
"
\n
"
+
dados
.
getCNPJ
()
+
"
\n
"
+
dados
.
getResponsavel
()
+
"
\n
"
+
dados
.
getTelefone
())
}
function
atualizaEmpresas
(){
document
.
getElementById
(
"
tbody
"
).
innerHTML
=
""
;
var
str
;
for
(
var
empresa
in
ListaEmpresas
){
str
=
"
<tr>
"
str
+=
"
<td>
"
+
ListaEmpresas
[
empresa
].
getDados
().
getNome
()
+
"
</td>
"
;
str
+=
"
<td></td>
"
;
str
+=
"
<td></td>
"
;
// str += "
<
td
><
/td>"
;
str
+=
"
<td><button onClick=alertDadosEmpresa(
"
+
empresa
+
"
);> Ver mais dados </button></td>
"
;
document
.
getElementById
(
"
tbody
"
).
innerHTML
+=
str
+
"
</tr>
"
;
}
}
throw
1
</script>
</head>
</body>
<table><tr>
<td><input
type=
text
id=
"nomeEmpresa"
placeholder=
"Nome"
></td>
<td><input
type=
text
id=
"cnpj"
placeholder=
"CNPJ"
></td>
<td><input
type=
text
id=
"telefone"
placeholder=
"Telefone"
></td>
<td><input
type=
text
id=
"responsavel"
placeholder=
"Responsável"
></td>
<td><button
onClick=
cadastraEmpresa();
>
Cadastrar Empresa
</button></td>
</tr></table>
<table>
<thead>
<tr>
<td>
Dados da empresa
</td>
<td>
Publico alvo/clientes
</td>
<td>
Características do cardápio
</td>
<td>
Ações
</td>
</tr>
</thead>
<tbody
id =
"tbody"
>
</tbody>
</table>
</body>
</html>
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