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
c9189a10
Commit
c9189a10
authored
Mar 26, 2017
by
mc16
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Varias faixas etarias + BUG
parent
38fa1969
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
27 deletions
+55
-27
main.js
main.js
+42
-26
prototipo.html
prototipo.html
+13
-1
No files found.
main.js
View file @
c9189a10
...
...
@@ -37,15 +37,6 @@ function atualizaEmpresas(){
}
//
$
(
"
.cancelaEditaEmpresa
"
).
click
(
function
(){
$
(
"
.ui-button
"
).
click
();
});
...
...
@@ -54,7 +45,6 @@ $(".cancelaEditaEmpresa").click( function(){
function
alertDadosEmpresa
(
e
){
dados
=
ListaEmpresas
[
e
].
getDados
();
//alert(dados.getNome()+"\n"+dados.getCNPJ()+"\n"+dados.getResponsavel()+"\n"+dados.getTelefone())
$
(
"
#dadosEmpresa
"
).
dialog
();
$
(
"
#dadosEmpresa_id
"
).
val
(
e
);
$
(
"
#dadosEmpresa_nome
"
).
val
(
dados
.
getNome
());
...
...
@@ -65,7 +55,7 @@ function alertDadosEmpresa(e){
}
function
alertPublicoEmpresa
(
e
){
dados
=
ListaEmpresas
[
e
];
dados
=
ListaEmpresas
[
e
];
$
(
"
#publicoEmpresa
"
).
dialog
();
$
(
"
#publicoEmpresa_id
"
).
val
(
e
);
...
...
@@ -76,10 +66,6 @@ function alertPublicoEmpresa(e){
$
(
"
#publicoEmpresa_janta
"
).
val
(
dados
.
getMediaRef
().
getJanta
()
);
}
if
(
dados
.
getNecessidadesNutr
()){
$
(
"
#publicoEmpresa_idades
"
).
val
(
dados
.
getNecessidadesNutr
().
getIdades
()
);
}
htmlCheckBoxes
=
"
<ul>
"
;
igual
=
0
;
if
(
dados
.
getNecessidadesNutr
())
...
...
@@ -87,15 +73,15 @@ function alertPublicoEmpresa(e){
tabs
=
dados
.
getNecessidadesNutr
().
getTabelas
()
for
(
var
element
in
tabelas
)
{
for
(
var
e
in
tabs
)
{
{
for
(
var
e
in
tabs
)
{
if
(
tabs
[
e
]
==
tabelas
[
element
])
{
igual
=
1
;
}
}
}
if
(
igual
)
{
htmlCheckBoxes
+=
"
<li> <input checked id =
"
+
tabelas
[
element
]
+
"
type=checkbox>
"
+
tabelas
[
element
]
+
"
</li><br>
"
...
...
@@ -105,16 +91,29 @@ function alertPublicoEmpresa(e){
htmlCheckBoxes
+=
"
<li> <input id =
"
+
tabelas
[
element
]
+
"
type=checkbox>
"
+
tabelas
[
element
]
+
"
</li><br>
"
}
igual
=
0
;
}
}
}
else
{
for
(
var
element
in
tabelas
)
{
htmlCheckBoxes
+=
"
<li> <input id=
"
+
tabelas
[
element
]
+
"
type=checkbox>
"
+
tabelas
[
element
]
+
"
</li><br>
"
}
}
for
(
var
element
in
tabelas
)
{
htmlCheckBoxes
+=
"
<li> <input id=
"
+
tabelas
[
element
]
+
"
type=checkbox>
"
+
tabelas
[
element
]
+
"
</li><br>
"
}
}
$
(
"
#checkBoxes
"
).
html
(
htmlCheckBoxes
+
"
</ul>
"
);
if
(
dados
.
getNecessidadesNutr
()){
colunas
=
""
;
vetor
=
[]
vetor
=
dados
.
getNecessidadesNutr
().
getIdades
()
console
.
log
(
vetor
)
for
(
var
object
in
vetor
)
{
console
.
log
(
object
)
colunas
+=
"
<tr><td><input type = text></input></td></tr>
"
}
document
.
getElementById
(
"
tidades
"
).
innerHTML
+=
colunas
;
}
}
function
alertCardapioEmpresa
(
e
){
...
...
@@ -197,6 +196,13 @@ $("#adicionaCardapioEmpresa").click(function(){
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
+=
colunas
;
});
$
(
"
#adicionaIdadesEmpresa
"
).
click
(
function
(){
var
colunas
=
"
<tr><td> <input type=text id = idadeCardapio></td><td style=
\"
width:auto;
\"
>
"
;
colunas
+=
"
</td></tr>
"
document
.
getElementById
(
"
tidades
"
).
innerHTML
+=
colunas
;
});
$
(
"
#editaDadosEmpresa
"
).
click
(
function
(){
dados
=
ListaEmpresas
[
$
(
"
#dadosEmpresa_id
"
).
val
()
].
getDados
();
dados
.
setNome
(
$
(
"
#dadosEmpresa_nome
"
).
val
());
...
...
@@ -244,7 +250,17 @@ $("#editaPublicoEmpresa").click( function(){
tabelasDados
.
push
(
tabelas
[
element
]);
}
}
dados
.
setNecessidadesNutr
(
new
NecessidadesNutr
(
tabelasDados
,
$
(
"
#publicoEmpresa_idades
"
).
val
())
);
idades
=
[]
if
(
dados
.
getNecessidadesNutr
())
{
idades
=
dados
.
getNecessidadesNutr
().
getIdades
()
}
idades
.
push
(
$
(
"
#idadeCardapio
"
).
val
());
console
.
log
(
$
(
"
#idadeCardapio
"
).
val
())
console
.
log
(
idades
);
dados
.
setNecessidadesNutr
(
new
NecessidadesNutr
(
tabelasDados
,
idades
)
);
atualizaEmpresas
();
$
(
"
.ui-button
"
).
click
();
});
...
...
prototipo.html
View file @
c9189a10
...
...
@@ -53,8 +53,20 @@
<tr><td>
Café da manhã(média)
</td>
<td><input
type=
text
id=
"publicoEmpresa_cafe"
></td></tr>
<tr><td>
Café da almoço(média)
</td>
<td><input
type=
text
id=
"publicoEmpresa_almoco"
></td></tr>
<tr><td>
Café da janta(média)
</td>
<td><input
type=
text
id=
"publicoEmpresa_janta"
></td></tr>
<tr><td>
Faixas de idades
</td>
<td><input
type=
text
id=
"publicoEmpresa_idades"
></td></tr>
<tr><td
id=
"checkBoxes"
></td></tr>
<tr><td
colspan=
2
><center><button
id=
"adicionaIdadesEmpresa"
>
Adicionar Faixa Etária
</button>
</center></td>
</tr>
<table>
<thead>
<tr>
<td>
Faixa de idade
</td>
<td>
Ações
</td>
</tr>
</thead>
<tbody
id =
"tidades"
>
</tbody>
</table>
<tr><td
colspan=
2
><center><button
id=
"editaPublicoEmpresa"
>
Salvar
</button>
<button
class=
"cancelaEditaEmpresa"
>
Cancelar
</button></center></td>
</tr>
</table>
</div>
...
...
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