Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
nutricao
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PET Computação
nutricao
Commits
d348dc75
Commit
d348dc75
authored
Apr 20, 2017
by
mc16
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Seleção da refeição na contrução do cardápio + bug ao adicionar dois ao mesmo tempo
parent
a887426e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
main.js
main.js
+8
-11
prototipo.html
prototipo.html
+1
-0
No files found.
main.js
View file @
d348dc75
...
...
@@ -192,13 +192,10 @@ function alertCardapioEmpresa(e){
}
}
refeicoesEscolhidas
=
dados
.
getNecessidadesNutr
().
getRefeicoes
()
console
.
log
(
"
Dados
"
+
dados
)
console
.
log
(
"
Refeicoes
"
+
refeicoesEscolhidas
);
downs
+=
"
<form> <select id=
"
+
refeicoesEscolhidas
+
"
>
"
;
downs
+=
"
<form> <select id=refeicoesEscolhidas>
"
;
for
(
var
element
in
refeicoesEscolhidas
)
{
downs
+=
"
<option value=
"
+
replaceAll
(
refeicoesEscolhidas
[
element
],
"
"
,
""
)
+
"
>
"
+
refeicoesEscolhidas
[
element
]
+
"
</option>
"
console
.
log
(
refeicoesEscolhidas
[
element
]);
}
downs
+=
"
</select> </form>
"
;
...
...
@@ -293,6 +290,7 @@ $("#adicionaCardapioEmpresa").click(function(){
for
(
var
i
=
0
;
i
<
numFaixas
;
i
++
)
{
valor
=
[];
valor
.
push
(
document
.
getElementById
(
"
refeicao
"
+
i
).
value
);
valor
.
push
(
document
.
getElementById
(
"
nomeCardapio
"
+
i
).
value
);
valor
.
push
(
document
.
getElementById
(
"
quantidadeMedia
"
+
i
).
value
);
for
(
var
element
in
tiposDePreparo
)
...
...
@@ -311,7 +309,8 @@ $("#adicionaCardapioEmpresa").click(function(){
backupValues
.
push
(
valor
);
}
var
colunas
=
"
<tr><td> <input type=text id = nomeCardapio
"
+
numFaixas
+
"
></td>
"
;
var
colunas
=
"
<tr><td> <input type=text id = refeicao
"
+
numFaixas
+
"
></td>
"
;
colunas
+=
"
<td> <input type=text id = nomeCardapio
"
+
numFaixas
+
"
></td>
"
;
colunas
+=
"
<td> <input type=text id = quantidadeMedia
"
+
numFaixas
+
"
></td><td style=
\"
width:auto;
\"
>
"
;
for
(
var
element
in
tiposDePreparo
)
{
...
...
@@ -319,26 +318,24 @@ $("#adicionaCardapioEmpresa").click(function(){
}
colunas
+=
"
</td></tr>
"
document
.
getElementById
(
"
tnovo
"
).
innerHTML
+=
colunas
;
for
(
var
i
=
0
;
i
<
numFaixas
;
i
++
){
for
(
var
i
=
0
;
i
<
numFaixas
;
i
++
)
{
numero
=
0
;
cardapio
=
backupValues
[
i
];
document
.
getElementById
(
"
refeicao
"
+
i
).
value
=
cardapio
[
numero
];
document
.
getElementById
(
"
nomeCardapio
"
+
i
).
value
=
cardapio
[
numero
];
numero
++
;
document
.
getElementById
(
"
quantidadeMedia
"
+
i
).
value
=
cardapio
[
numero
];
console
.
log
(
"
Nome:
"
+
cardapio
[
numero
]
+
"
Valor:
"
+
document
.
getElementById
(
"
nomeCardapio
"
+
i
).
value
);
for
(
var
element
in
tiposDePreparo
)
{
numero
++
;
if
(
cardapio
[
numero
])
{
document
.
getElementById
((
tiposDePreparo
[
element
].
replace
(
"
"
,
""
))
+
i
).
checked
=
cardapio
[
numero
];
console
.
log
(
"
Nome:
"
+
cardapio
[
numero
]
+
"
Valor:
"
+
document
.
getElementById
((
tiposDePreparo
[
element
].
replace
(
"
"
,
""
))
+
i
).
value
);
}
}
console
.
log
(
"
dentro do for Valor:
"
+
document
.
getElementById
(
"
nomeCardapio
"
+
i
).
value
);
}
console
.
log
(
"
Valor:
"
+
document
.
getElementById
(
"
nomeCardapio
"
+
i
).
value
);
document
.
getElementById
(
"
refeicao
"
+
numFaixas
).
value
=
strUser
;
});
...
...
prototipo.html
View file @
d348dc75
...
...
@@ -91,6 +91,7 @@
</tr>
<tr><td
colspan=
2
><center><button
id=
"adicionaCardapioEmpresa"
>
Adicionar Cardápio
</button>
</center></td>
</tr>
<tr>
<td>
Refeio
</td>
<td>
Nome
</td>
<td>
Media
</td>
<td>
Ingredientes
</td>
...
...
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