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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PET Computação
nutricao
Commits
9b34cd7b
Commit
9b34cd7b
authored
Mar 24, 2017
by
mc16
Browse files
Options
Downloads
Patches
Plain Diff
Quase editando
parent
27302ee2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
prototipo.html
+88
-3
88 additions, 3 deletions
prototipo.html
with
88 additions
and
3 deletions
prototipo.html
+
88
−
3
View file @
9b34cd7b
...
@@ -197,6 +197,16 @@ function atualizaEmpresas(){
...
@@ -197,6 +197,16 @@ function atualizaEmpresas(){
</table>
</table>
</div>
</div>
<div
id=
"conjuntoEmpresa"
title=
"Cardápio empresa"
style=
"display:none"
>
<table>
<input
type=
hidden
id=
"dadosEmpresa_id"
>
<input
type=
hidden
id=
"conjuntoEmpresa_id"
>
<tr><td>
Nome:
</td>
<td><input
type=
text
id=
"conjuntoEmpresa_nome"
></td></tr>
<tr><td
id=
"checkBoxesConjunto"
></td></tr>
<tr><td
colspan=
2
><center><button
id=
"editaConjuntoEmpresa"
>
Salvar
</button>
<button
class=
"cancelaEditaEmpresa"
>
Cancelar
</button></center></td>
</tr>
</table>
</div>
<div
id=
"cardapioEmpresa"
title=
"Cardapio da empresa"
style=
"display:none"
>
<div
id=
"cardapioEmpresa"
title=
"Cardapio da empresa"
style=
"display:none"
>
<table>
<table>
<input
type=
hidden
id=
"cardapioEmpresa_id"
>
<input
type=
hidden
id=
"cardapioEmpresa_id"
>
...
@@ -331,14 +341,17 @@ function alertCardapioEmpresa(e){
...
@@ -331,14 +341,17 @@ function alertCardapioEmpresa(e){
$
(
"
#cardapioEmpresa_precoTotal
"
).
val
(
dados
.
getTiposCardapios
().
getPrecoTotal
());
$
(
"
#cardapioEmpresa_precoTotal
"
).
val
(
dados
.
getTiposCardapios
().
getPrecoTotal
());
tabs
=
dados
.
getConjunto
()
tabs
=
dados
.
getConjunto
()
colunas
=
""
;
colunas
=
""
;
for
(
var
e
in
tabs
)
for
(
var
object
in
tabs
)
{
{
colunas
+=
"
<tr><td>
"
+
tabs
[
e
].
getNome
()
+
"
</td><td>
"
colunas
+=
"
<tr><td>
"
+
tabs
[
object
].
getNome
()
+
"
</td><td>
"
aux
=
tabs
[
e
].
getCombinacao
();
aux
=
tabs
[
object
].
getCombinacao
();
for
(
var
element
in
aux
)
for
(
var
element
in
aux
)
{
{
colunas
+=
aux
[
element
]
+
"
"
colunas
+=
aux
[
element
]
+
"
"
}
}
conjuntos
=
[];
colunas
+=
"
</td><td><button onClick=alertConjuntoEmpresa(
"
+
object
+
"
);>Editar</button></td>
"
colunas
+=
"
</td></tr>
"
colunas
+=
"
</td></tr>
"
}
}
...
@@ -347,6 +360,51 @@ function alertCardapioEmpresa(e){
...
@@ -347,6 +360,51 @@ function alertCardapioEmpresa(e){
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
+=
colunas
;
document
.
getElementById
(
"
tcardapio
"
).
innerHTML
+=
colunas
;
}
}
function
alertConjuntoEmpresa
(
object
){
/*console.log(object);
dados = ListaEmpresas[object[0]];
conjuntos = dados.getConjunto()
e = object[1];
for(var element in conjuntos)
{
if(element == e)
{
conjunto = conjuntos[element];
}
}
$("#conjuntoEmpresa").dialog();
$("#dadosEmpresa_id").val(e);
$("#conjuntoEmpresa_id").val(object);
$("#conjuntoEmpresa_nome").val( conjunto.getNome() );
htmlCheckBoxes = "<ul>";
igual =0;
tabs = conjunto.getCombinacao();
for(var element in tiposDePreparo)
{
for (var e in tabs)
{
if(tabs[e] == tiposDePreparo[element])
{
igual = 1;
}
}
if(igual)
{
htmlCheckBoxes+="<li> <input checked id = "+tiposDePreparo[element]+ " type=checkbox>"+tiposDePreparo[element]+" </li><br>"
}
else
{
htmlCheckBoxes+="<li> <input id = "+tiposDePreparo[element]+ " type=checkbox>"+tiposDePreparo[element]+" </li><br>"
}
igual =0;
}
$("#checkBoxesConjunto").html(htmlCheckBoxes+"</ul>");*/
}
$
(
"
#adicionaCardapioEmpresa
"
).
click
(
function
(){
$
(
"
#adicionaCardapioEmpresa
"
).
click
(
function
(){
var
colunas
=
"
<tr><td> <input type=text id = nomeCardapio></td><td>
"
;
var
colunas
=
"
<tr><td> <input type=text id = nomeCardapio></td><td>
"
;
for
(
var
element
in
tiposDePreparo
)
for
(
var
element
in
tiposDePreparo
)
...
@@ -367,6 +425,33 @@ $("#editaDadosEmpresa").click( function(){
...
@@ -367,6 +425,33 @@ $("#editaDadosEmpresa").click( function(){
$
(
"
.ui-button
"
).
click
();
$
(
"
.ui-button
"
).
click
();
});
});
$
(
"
#editaConjuntoEmpresa
"
).
click
(
function
(){
dados
=
ListaEmpresas
[
$
(
"
#dadosEmpresa_id
"
).
val
()
].
getDados
();
conjuntos
=
dados
.
getConjunto
()
for
(
var
element
in
conjuntos
)
{
if
(
element
==
e
)
{
conjunto
=
conjuntos
[
element
];
}
}
conjunto
.
setNome
(
$
(
"
#conjuntoEmpresa_nome
"
).
val
());
tabelaPreparacao
=
[]
for
(
var
element
in
tiposDePreparo
)
{
checkBox
=
document
.
getElementById
(
tiposDePreparo
[
element
]);
if
(
checkBox
.
checked
)
{
tabelaPreparacao
.
push
(
tiposDePreparo
[
element
]);
}
}
conjunto
.
setCombinacao
(
tabelaPreparacao
);
atualizaEmpresas
();
$
(
"
.ui-button
"
).
click
();
});
$
(
"
#editaPublicoEmpresa
"
).
click
(
function
(){
$
(
"
#editaPublicoEmpresa
"
).
click
(
function
(){
dados
=
ListaEmpresas
[
$
(
"
#publicoEmpresa_id
"
).
val
()
];
dados
=
ListaEmpresas
[
$
(
"
#publicoEmpresa_id
"
).
val
()
];
dados
.
setMediaRef
(
new
MediaRef
(
dados
.
setMediaRef
(
new
MediaRef
(
...
...
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