Skip to content
Snippets Groups Projects
Commit c8c7e199 authored by mc16's avatar mc16
Browse files

Janelinha com jQuery

parent e5d112dd
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
<style> <style>
td{outline-style:solid; outline-width : 2px; td{outline-style:solid; outline-width : 2px;
} }
center{padding:2px;} center{padding:2px;}
</style> </style>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script language="JavaScript"> <script language="JavaScript">
...@@ -48,14 +50,18 @@ class MediaRef{ ...@@ -48,14 +50,18 @@ class MediaRef{
getJanta(){ return this._janta} getJanta(){ return this._janta}
setJanta(_janta) {this._janta = _janta;} setJanta(_janta) {this._janta = _janta;}
constructor(cafe,almoco,janta){
this.setCafe(cafe);
this.setAlmoco(almoco);
this.setJanta(janta);
}
} }
class NecessidadesNutr{ class NecessidadesNutr{
getPat(){ return this._pat} getPat(){ return this._pat}
setPat(_pat) {this._pat = _pat;} setPat(_pat) {this._pat = _pat;}
...@@ -71,6 +77,14 @@ class NecessidadesNutr{ ...@@ -71,6 +77,14 @@ class NecessidadesNutr{
getIdades(){ return this._idades} getIdades(){ return this._idades}
setIdades(_idades) {this._idades = _idades;} setIdades(_idades) {this._idades = _idades;}
constructor(pat,pnae,dris,outros,idades){
this.setPat(pat);
this.setPnae(pnae);
this.setDris(dris);
this.setOutros(outros);
this.setIdades(idades);
}
} }
...@@ -119,34 +133,65 @@ function cadastraEmpresa(){ ...@@ -119,34 +133,65 @@ function cadastraEmpresa(){
atualizaEmpresas(); atualizaEmpresas();
} }
function alertDadosEmpresa(e){ function alertDadosEmpresa(e){
dados = ListaEmpresas[e].getDados(); dados = ListaEmpresas[e].getDados();
alert(dados.getNome()+"\n"+dados.getCNPJ()+"\n"+dados.getResponsavel()+"\n"+dados.getTelefone()) //alert(dados.getNome()+"\n"+dados.getCNPJ()+"\n"+dados.getResponsavel()+"\n"+dados.getTelefone())
$(function (dados) {
$("#dadosEmpresa").dialog();
});
}
function alertMediaRef(e){
dados = ListaEmpresas[e].getMediaRef();
$(function (dados) {
$("#dadosMediaRef").dialog();
});
} }
function atualizaEmpresas(){ function atualizaEmpresas(){
document.getElementById("tbody").innerHTML = ""; document.getElementById("tbody").innerHTML = "";
var str; var str;
for(var empresa in ListaEmpresas){ for(var empresa in ListaEmpresas){
str = "<tr>" str = "<tr>";
str += "<td>"+ListaEmpresas[empresa].getDados().getNome()+"</td>"; str += "<td>"+ListaEmpresas[empresa].getDados().getNome()+"</td>";
str += "<td></td>"; str += "<td></td>";
str += "<td></td>"; str += "<td></td>";
// str += "<td></td>"; // str += "<td></td>";
str += "<td><button onClick=alertDadosEmpresa("+empresa+");> Ver mais dados </button></td>"; str += "<td><button onClick=alertDadosEmpresa("+empresa+");> Ver mais dados </button></td>";
str += "<td><button onClick=alertMediaRef("+empresa+");> Media Refeições </button></td>";
document.getElementById("tbody").innerHTML+=str+"</tr>"; document.getElementById("tbody").innerHTML+=str+"</tr>";
} }
} }
throw 1
</script> </script>
</head> </head>
</body> </body>
<div id="dadosEmpresa" title="Dados da empresa" style="display:none">
<table>
<tr>
<td><input type=text id="nomeEmpresaDialog"></td>
</tr>
</table>
</div>
<div id="dadosMediaRef" title="Média de refeições" style="display:none">
<table>
<tr>
<td></td>
</tr>
</table>
</div>
<table><tr> <table><tr>
<td><input type=text id="nomeEmpresa" placeholder="Nome"></td> <td><input type=text id="nomeEmpresa" placeholder="Nome"></td>
<td><input type=text id="cnpj" placeholder="CNPJ"></td> <td><input type=text id="cnpj" placeholder="CNPJ"></td>
...@@ -162,6 +207,7 @@ throw 1 ...@@ -162,6 +207,7 @@ throw 1
<td> Publico alvo/clientes</td> <td> Publico alvo/clientes</td>
<td> Características do cardápio</td> <td> Características do cardápio</td>
<td>Ações</td> <td>Ações</td>
<td>Média</td>
</tr> </tr>
</thead> </thead>
<tbody id ="tbody"> <tbody id ="tbody">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment