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
208950aa
Commit
208950aa
authored
8 years ago
by
mc16
Browse files
Options
Downloads
Patches
Plain Diff
Tentativa de melhorar interface
parent
e2c3e153
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.js
+30
-7
30 additions, 7 deletions
main.js
prototipo.html
+31
-21
31 additions, 21 deletions
prototipo.html
with
61 additions
and
28 deletions
main.js
+
30
−
7
View file @
208950aa
...
@@ -18,10 +18,10 @@ function replaceAll(str, de, para){
...
@@ -18,10 +18,10 @@ function replaceAll(str, de, para){
function
cadastraEmpresa
(){
function
cadastraEmpresa
(){
ListaEmpresas
.
push
(
ListaEmpresas
.
push
(
new
Empresa
(
new
Empresa
(
document
.
getElementById
(
"
nome
Empresa
"
).
value
,
document
.
getElementById
(
"
dados
Empresa
_nome
"
).
value
,
document
.
getElementById
(
"
cnpj
"
).
value
,
document
.
getElementById
(
"
dadosEmpresa_
cnpj
"
).
value
,
document
.
getElementById
(
"
telefone
"
).
value
,
document
.
getElementById
(
"
dadosEmpresa_
telefone
"
).
value
,
document
.
getElementById
(
"
responsavel
"
).
value
document
.
getElementById
(
"
dadosEmpresa_
responsavel
"
).
value
)
)
);
);
atualizaEmpresas
();
atualizaEmpresas
();
...
@@ -144,6 +144,8 @@ function alertCardapioEmpresa(e){
...
@@ -144,6 +144,8 @@ function alertCardapioEmpresa(e){
$
(
"
#cardapioEmpresa_id
"
).
val
(
e
);
$
(
"
#cardapioEmpresa_id
"
).
val
(
e
);
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
=
""
;
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
=
""
;
colunas
=
""
;
colunas
=
""
;
downs
=
""
;
console
.
log
(
"
Dados
"
+
dados
)
if
(
dados
.
getTiposCardapios
())
if
(
dados
.
getTiposCardapios
())
{
{
$
(
"
#cardapioEmpresa_precoInd
"
).
val
(
dados
.
getTiposCardapios
().
getPrecoRef
());
$
(
"
#cardapioEmpresa_precoInd
"
).
val
(
dados
.
getTiposCardapios
().
getPrecoRef
());
...
@@ -166,9 +168,20 @@ function alertCardapioEmpresa(e){
...
@@ -166,9 +168,20 @@ function alertCardapioEmpresa(e){
}
}
}
}
refeicoesEscolhidas
=
dados
.
getNecessidadesNutr
().
getRefeicoes
()
console
.
log
(
"
Dados
"
+
dados
)
console
.
log
(
"
Refeicoes
"
+
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>
"
;
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
+=
colunas
;
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
+=
colunas
;
document
.
getElementById
(
"
tnovo
"
).
innerHTML
=
""
;
document
.
getElementById
(
"
tnovo
"
).
innerHTML
=
""
;
document
.
getElementById
(
"
dropDown
"
).
innerHTML
+=
downs
;
}
}
function
alertConjuntoEmpresa
(
empresa
,
cardapio
){
function
alertConjuntoEmpresa
(
empresa
,
cardapio
){
...
@@ -209,14 +222,18 @@ function alertConjuntoEmpresa(empresa, cardapio){
...
@@ -209,14 +222,18 @@ function alertConjuntoEmpresa(empresa, cardapio){
}
}
$
(
"
#adicionaEmpresa
"
).
click
(
function
(){
$
(
"
#adicionaEmpresa
"
).
click
(
function
(){
$
(
"
#cadastraEmpresa
"
).
dialog
();
}
}
);
$
(
"
#adicionaCardapioEmpresa
"
).
click
(
function
(){
$
(
"
#adicionaCardapioEmpresa
"
).
click
(
function
(){
backupValues
=
[];
backupValues
=
[];
numFaixas
=
$
(
"
#tnovo
"
).
children
().
length
;
numFaixas
=
$
(
"
#tnovo
"
).
children
().
length
;
var
e
=
document
.
getElementById
(
"
refeicoesEscolhidas
"
);
var
strUser
=
e
.
options
[
e
.
selectedIndex
].
value
;
console
.
log
(
strUser
)
for
(
var
i
=
0
;
i
<
numFaixas
;
i
++
)
for
(
var
i
=
0
;
i
<
numFaixas
;
i
++
)
{
{
valor
=
[];
valor
=
[];
...
@@ -304,6 +321,12 @@ $("#editaDadosEmpresa").click( function(){
...
@@ -304,6 +321,12 @@ $("#editaDadosEmpresa").click( function(){
$
(
"
.ui-button
"
).
click
();
$
(
"
.ui-button
"
).
click
();
});
});
$
(
"
#cadastraDadosEmpresa
"
).
click
(
function
(){
cadastraEmpresa
();
atualizaEmpresas
();
$
(
"
.ui-button
"
).
click
();
});
$
(
"
#editaConjuntoEmpresa
"
).
click
(
function
(){
$
(
"
#editaConjuntoEmpresa
"
).
click
(
function
(){
dados
=
ListaEmpresas
[
$
(
"
#dadosEmpresa_id
"
).
val
()
];
dados
=
ListaEmpresas
[
$
(
"
#dadosEmpresa_id
"
).
val
()
];
...
...
This diff is collapsed.
Click to expand it.
prototipo.html
+
31
−
21
View file @
208950aa
...
@@ -48,7 +48,17 @@
...
@@ -48,7 +48,17 @@
</table>
</table>
</div>
</div>
<div
id=
"publicoEmpresa"
title=
"Público Alvo"
style=
"display:none"
>
<div
id=
"cadastraEmpresa"
title=
"Dados da empresa"
style=
"display:none"
>
<table>
<tr><td><input
type=
text
id=
"dadosEmpresa_nome"
></td></tr>
<tr><td><input
type=
text
id=
"dadosEmpresa_cnpj"
></td></tr>
<tr><td><input
type=
text
id=
"dadosEmpresa_telefone"
></td></tr>
<tr><td><input
type=
text
id=
"dadosEmpresa_responsavel"
></td></tr>
<tr><td><button
id=
"cadastraDadosEmpresa"
>
Salvar
</button>
<button
class=
"cancelaEditaEmpresa"
>
Cancelar
</button></td>
</tr>
</table>
</div>
<div
id=
"publicoEmpresa"
title=
"Publico Alvo"
style=
"display:none"
>
<table>
<table>
<input
type=
hidden
id=
"publicoEmpresa_id"
>
<input
type=
hidden
id=
"publicoEmpresa_id"
>
<tr><td
id=
"checkBoxesTabelas"
></td></tr>
<tr><td
id=
"checkBoxesTabelas"
></td></tr>
...
@@ -57,7 +67,7 @@
...
@@ -57,7 +67,7 @@
</table>
</table>
</div>
</div>
<div
id=
"conjuntoEmpresa"
title=
"Card
á
pio empresa"
style=
"display:none"
>
<div
id=
"conjuntoEmpresa"
title=
"Card
a
pio empresa"
style=
"display:none"
>
<table>
<table>
<input
type=
hidden
id=
"dadosEmpresa_id"
>
<input
type=
hidden
id=
"dadosEmpresa_id"
>
<input
type=
hidden
id=
"conjuntoEmpresa_id"
>
<input
type=
hidden
id=
"conjuntoEmpresa_id"
>
...
@@ -73,25 +83,19 @@
...
@@ -73,25 +83,19 @@
<input
type=
hidden
id=
"cardapioEmpresa_id"
>
<input
type=
hidden
id=
"cardapioEmpresa_id"
>
<tr><td>
Preço refeição:
</td><td><input
type=
text
id=
"cardapioEmpresa_precoInd"
></td></tr>
<tr><td>
Preço refeição:
</td><td><input
type=
text
id=
"cardapioEmpresa_precoInd"
></td></tr>
<tr><td>
Preço total:
</td><td><input
type=
text
id=
"cardapioEmpresa_precoTotal"
></td></tr>
<tr><td>
Preço total:
</td><td><input
type=
text
id=
"cardapioEmpresa_precoTotal"
></td></tr>
<div
class=
"dropdown"
>
<tr>
<button
onclick=
"myFunction()"
class=
"dropbtn"
>
Dropdown
</button>
<td>
<div
id=
"myDropdown"
class=
"dropdown-content"
>
<tbody
id =
"dropDown"
>
<a
href=
"#home"
>
Home
</a>
</tbody>
<a
href=
"#about"
>
About
</a>
</td>
<a
href=
"#contact"
>
Contact
</a>
</tr>
</div>
</div>
<tr><td
colspan=
2
><center><button
id=
"adicionaCardapioEmpresa"
>
Adicionar Cardápio
</button>
</center></td>
</tr>
<tr><td
colspan=
2
><center><button
id=
"adicionaCardapioEmpresa"
>
Adicionar Cardápio
</button>
</center></td>
</tr>
<table>
<thead>
<tr>
<tr>
<td>
Nome
</td>
<td>
Nome
</td>
<td>
M
é
dia
</td>
<td>
M
e
dia
</td>
<td>
Ingredientes
</td>
<td>
Ingredientes
</td>
<td>
A
çõ
es
</td>
<td>
A
co
es
</td>
</tr>
</tr>
</thead>
<tbody
id =
"tcardapio"
>
<tbody
id =
"tcardapio"
>
</tbody>
</tbody>
...
@@ -103,14 +107,20 @@
...
@@ -103,14 +107,20 @@
</table>
</table>
</div>
</div>
<tr><td><button
id=
"adicionaEmpresa"
>
Adicionar Empresa
</button></td></tr>
<thead>
<thead>
<table>
<tr>
<td>
<button
id=
"adicionaEmpresa"
>
Adicionar Empresa
</button>
</td>
</tr>
</table>
<table>
<tr>
<tr>
<td>
Dados da empresa
</td>
<td>
Dados da empresa
</td>
<td>
Publico alvo/clientes
</td>
<td>
Publico alvo/clientes
</td>
<td>
Características do card
á
pio
</td>
<td>
Características do cardpio
</td>
<td>
A
çõ
es
</td>
<td>
A
co
es
</td>
</tr>
</tr>
</thead>
</thead>
<tbody
id =
"tbody"
>
<tbody
id =
"tbody"
>
...
...
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