Skip to content

Commit

Permalink
Adicionado: Validações, mascaras, login e etc (IFET)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateus committed Mar 1, 2013
1 parent 44c1511 commit ccf25c2
Show file tree
Hide file tree
Showing 59 changed files with 3,403 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;

@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-27T22:52:21")
@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-28T16:52:16")
@StaticMetamodel(AgendaPK.class)
public class AgendaPK_ {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;

@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-27T22:52:21")
@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-28T16:52:16")
@StaticMetamodel(Agenda.class)
public class Agenda_ {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;

@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-27T22:52:21")
@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-28T16:52:16")
@StaticMetamodel(Exame.class)
public class Exame_ {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;

@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-27T22:52:21")
@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-28T16:52:16")
@StaticMetamodel(Medico.class)
public class Medico_ {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;

@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-27T22:52:21")
@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-28T16:52:16")
@StaticMetamodel(Paciente.class)
public class Paciente_ {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;

@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-27T22:52:21")
@Generated(value="EclipseLink-2.3.2.v20111125-r10461", date="2013-02-28T16:52:16")
@StaticMetamodel(Usuario.class)
public class Usuario_ {

Expand Down
51 changes: 51 additions & 0 deletions build/web/404.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
<f:event type="preRenderView" listener="#{Usuario.verificaLogin()}"/>
</f:metadata>
<h:head>
<meta charset="utf-8" />
<title>SAEC</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="Mateus Ferreira Silva" />

<h:outputStylesheet name="bootstrap.css" library="css" />
<h:outputStylesheet name="bootstrap-responsive.css" library="css" />
<h:outputStylesheet name="my-style.css" library="css" />
<link href="resources/img/favicon.gif" type="image/png" rel="icon" />
</h:head>
<body>
<ui:include src="navbar.xhtml" />

<div class="container">
<div class="row-fluid">
<div class="span8 offset2">
<div class="hero-unit">
<h2>Página não encontrada</h2>
</div>
<div style="text-align: center;"><h3>Erro 404</h3></div>
</div>
</div>
</div>

<ui:include src="footer.xhtml" />

<script src="resources/js/jquery.js"></script>
<script src="resources/js/bootstrap-transition.js"></script>
<script src="resources/js/bootstrap-alert.js"></script>
<script src="resources/js/bootstrap-modal.js"></script>
<script src="resources/js/bootstrap-dropdown.js"></script>
<script src="resources/js/bootstrap-scrollspy.js"></script>
<script src="resources/js/bootstrap-tab.js"></script>
<script src="resources/js/bootstrap-tooltip.js"></script>
<script src="resources/js/bootstrap-popover.js"></script>
<script src="resources/js/bootstrap-button.js"></script>
<script src="resources/js/bootstrap-collapse.js"></script>
<script src="resources/js/bootstrap-carousel.js"></script>
<script src="resources/js/bootstrap-typeahead.js"></script>

</body>
</html>
2 changes: 1 addition & 1 deletion build/web/WEB-INF/classes/resouces.res
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
META-INF/orm.xml
META-INF/eclipselink-orm.xml
META-INF/orm.xml
17 changes: 16 additions & 1 deletion build/web/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,20 @@
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>


<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

<error-page>
<error-code>404</error-code>
<location>/faces/404.xhtml</location>
</error-page>

<error-page>
<error-code>500</error-code>
<location>/faces/404.xhtml</location>
</error-page>

</web-app>
15 changes: 13 additions & 2 deletions build/web/agendar.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
<f:event type="preRenderView" listener="#{Usuario.verificaLogin()}"/>
</f:metadata>
<h:head>
<meta charset="utf-8" />
<title>SAEC</title>
Expand All @@ -15,12 +18,18 @@
<link href="resources/img/favicon.gif" type="image/png" rel="icon" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript">
function add_mascara_form(formulario, elemento, mascara){
var campo = $("#" + formulario + "\\:" + elemento);
campo.mask(mascara);
}
function add_atributo_form(formulario, elemento, atributo, valor){
var campo = $("#" + formulario + "\\:" + elemento);
campo.attr(atributo, valor);
}
$(document).ready(function() {
add_atributo_form("agendar-form", "dataHora", "placeholder", "dd/mm/aaaa hh:mm");
add_atributo_form("agendar-form", "dataHora", "placeholder", "dd/mm/aaaa hh:mm");
add_mascara_form("agendar-form", "dataHora", "99/99/9999 99:99");

});
</script>
</h:head>
Expand All @@ -39,9 +48,10 @@
<legend>Consulta</legend>

<label for="agendar-form:dataHora"><span style="color: red;">*</span> Data e Hora</label>
<h:inputText value="#{Agenda.agendaPK.dataHora}" id="dataHora" style="width:150px" >
<h:inputText value="#{Agenda.agendaPK.dataHora}" id="dataHora" style="width:150px" required="true" requiredMessage="Campo obrigatório" >
<f:convertDateTime pattern="dd/MM/yyyy HH:mm" />
</h:inputText>
<h:message for="dataHora" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 105px; padding: 4px 10px 4px 10px;" />

<label for="agendar-form:medico"><span style="color: red;">*</span> Médico</label>
<h:selectOneMenu value="#{Agenda.agendaPK.idMedico}" id="medico">
Expand Down Expand Up @@ -79,6 +89,7 @@
<ui:include src="footer.xhtml" />

<script src="resources/js/jquery.js"></script>
<script src="resources/js/jquery.maskedinput.min.js"></script>
<script src="resources/js/bootstrap-transition.js"></script>
<script src="resources/js/bootstrap-alert.js"></script>
<script src="resources/js/bootstrap-modal.js"></script>
Expand Down
12 changes: 9 additions & 3 deletions build/web/altera_exa.xhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
<f:event type="preRenderView" listener="#{Usuario.verificaLogin()}"/>
</f:metadata>
<h:head>
<meta charset="utf-8" />
<title>SAEC</title>
Expand All @@ -28,12 +32,14 @@
<legend>Exame</legend>
<h:inputHidden value="#{Exame.exame.idExame}" id="id" />
<label for="cad-exa-form:nome"><span style="color: red;">*</span> Nome</label>
<h:inputText value="#{Exame.exame.nome}" id="nome" style="width:400px" />
<h:inputText value="#{Exame.exame.nome}" id="nome" style="width:200px" maxlength="50" required="true" requiredMessage="Campo obrigatório" />
<h:message for="nome" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 15px; padding: 4px 10px 4px 10px;" />
<label for="cad-exa-form:valor"><span style="color: red;">*</span> Valor</label>
<div class="input-prepend">
<span class="add-on">R$</span>
<h:inputText value="#{Exame.exame.valor}" id="valor" style="width:100px" />
<h:inputText value="#{Exame.exame.valor}" id="valor" style="width:80px" required="true" requiredMessage="Campo obrigatório" />
</div>
<h:message for="valor" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 105px; padding: 4px 10px 4px 10px;" />
</fieldset>
<label><span style="color: red;">*</span> Campos obrigatórios</label>
<center>
Expand Down
12 changes: 9 additions & 3 deletions build/web/altera_med.xhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
<f:event type="preRenderView" listener="#{Usuario.verificaLogin()}"/>
</f:metadata>
<h:head>
<meta charset="utf-8" />
<title>SAEC</title>
Expand All @@ -28,9 +32,11 @@
<legend>Médico</legend>
<h:inputHidden value="#{Medico.medico.idMedico}" id="id" />
<label for="cad-med-form:nome"><span style="color: red;">*</span> Nome</label>
<h:inputText value="#{Medico.medico.nome}" id="nome" style="width:400px" />
<h:inputText value="#{Medico.medico.nome}" id="nome" style="width:200px" maxlength="50" required="true" requiredMessage="Campo obrigatório" />
<h:message for="nome" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 15px; padding: 4px 10px 4px 10px;" />
<label for="cad-med-form:crm"><span style="color: red;">*</span> CRM</label>
<h:inputText value="#{Medico.medico.crm}" id="crm" style="width:150px" />
<h:inputText value="#{Medico.medico.crm}" id="crm" style="width:150px" maxlength="20" required="true" requiredMessage="Campo obrigatório" />
<h:message for="crm" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 65px; padding: 4px 10px 4px 10px;" />
</fieldset>
<label><span style="color: red;">*</span> Campos obrigatórios</label>
<center>
Expand Down
17 changes: 14 additions & 3 deletions build/web/altera_pac.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
<f:event type="preRenderView" listener="#{Usuario.verificaLogin()}"/>
</f:metadata>
<h:head>
<meta charset="utf-8" />
<title>SAEC</title>
Expand All @@ -19,8 +22,14 @@
var campo = $("#" + formulario + "\\:" + elemento);
campo.attr(atributo, valor);
}
function add_mascara_form(formulario, elemento, mascara, placeholder){
var campo = $("#" + formulario + "\\:" + elemento);
campo.mask(mascara, {placeholder : placeholder});
}
$(document).ready(function() {
add_atributo_form("cad-pac-form", "dataNasc", "placeholder", "dd/mm/aaaa");
add_mascara_form("cad-pac-form", "dataNasc", "99/99/9999" , "_");
add_mascara_form("cad-pac-form", "numero", "999999", " ");
});
</script>
</h:head>
Expand All @@ -38,12 +47,13 @@
<fieldset>
<legend>Paciente</legend>
<h:inputHidden value="#{Paciente.paciente.idPaciente}" id="id" />
<label for="cad-pac-form:nome"><span style="color: red;">*</span> Nome</label>
<h:inputText value="#{Paciente.paciente.nome}" id="nome" style="width:400px" />
<h:inputText value="#{Paciente.paciente.nome}" id="nome" style="width:200px" maxlength="50" required="true" requiredMessage="Campo obrigatório" />
<h:message for="nome" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 55px; padding: 4px 10px 4px 10px;" />
<label for="cad-pac-form:dataNasc"><span style="color: red;">*</span> Data de Nascimento</label>
<h:inputText value="#{Paciente.paciente.dataNasc}" id="dataNasc" style="width:100px" >
<h:inputText value="#{Paciente.paciente.dataNasc}" id="dataNasc" style="width:100px" required="true" requiredMessage="Campo obrigatório" >
<f:convertDateTime pattern="dd/MM/yyyy" />
</h:inputText>
<h:message for="dataNasc" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 155px; padding: 4px 10px 4px 10px;" />
<label for="cad-pac-form:logradouro">Logradouro</label>
<h:inputTextarea value="#{Paciente.paciente.logradouro}" id="logradouro" rows="3" style="width:400px" />
<label for="cad-pac-form:numero">Número</label>
Expand Down Expand Up @@ -97,6 +107,7 @@
<ui:include src="footer.xhtml" />

<script src="resources/js/jquery.js"></script>
<script src="resources/js/jquery.maskedinput.min.js"></script>
<script src="resources/js/bootstrap-transition.js"></script>
<script src="resources/js/bootstrap-alert.js"></script>
<script src="resources/js/bootstrap-modal.js"></script>
Expand Down
14 changes: 10 additions & 4 deletions build/web/cad_exa.xhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
<f:event type="preRenderView" listener="#{Usuario.verificaLogin()}"/>
</f:metadata>
<h:head>
<meta charset="utf-8" />
<title>SAEC</title>
Expand All @@ -11,7 +15,7 @@
<h:outputStylesheet name="bootstrap.css" library="css" />
<h:outputStylesheet name="bootstrap-responsive.css" library="css" />
<h:outputStylesheet name="my-style.css" library="css" />
<link href="resources/img/favicon.gif" type="image/png" rel="icon" />
<link href="resources/img/favicon.gif" type="image/png" rel="icon" />
</h:head>
<body>
<ui:include src="navbar.xhtml" />
Expand All @@ -27,12 +31,14 @@
<fieldset>
<legend>Exame</legend>
<label for="cad-exa-form:nome"><span style="color: red;">*</span> Nome</label>
<h:inputText value="#{Exame.exame.nome}" id="nome" style="width:400px" />
<h:inputText value="#{Exame.exame.nome}" id="nome" style="width:200px" maxlength="50" required="true" requiredMessage="Campo obrigatório" />
<h:message for="nome" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 15px; padding: 4px 10px 4px 10px;" />
<label for="cad-exa-form:valor"><span style="color: red;">*</span> Valor</label>
<div class="input-prepend">
<span class="add-on">R$</span>
<h:inputText value="#{Exame.exame.valor}" id="valor" style="width:100px" />
<h:inputText value="#{Exame.exame.valor}" id="valor" style="width:80px" required="true" requiredMessage="Campo obrigatório" />
</div>
<h:message for="valor" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 105px; padding: 4px 10px 4px 10px;" />
</fieldset>
<label><span style="color: red;">*</span> Campos obrigatórios</label>
<center>
Expand Down
12 changes: 9 additions & 3 deletions build/web/cad_med.xhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
<f:event type="preRenderView" listener="#{Usuario.verificaLogin()}"/>
</f:metadata>
<h:head>
<meta charset="utf-8" />
<title>SAEC</title>
Expand All @@ -27,9 +31,11 @@
<fieldset>
<legend>Médico</legend>
<label for="cad-med-form:nome"><span style="color: red;">*</span> Nome</label>
<h:inputText value="#{Medico.medico.nome}" id="nome" style="width:400px" />
<h:inputText value="#{Medico.medico.nome}" id="nome" style="width:200px" maxlength="50" required="true" requiredMessage="Campo obrigatório" />
<h:message for="nome" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 15px; padding: 4px 10px 4px 10px;" />
<label for="cad-med-form:crm"><span style="color: red;">*</span> CRM</label>
<h:inputText value="#{Medico.medico.crm}" id="crm" style="width:150px" />
<h:inputText value="#{Medico.medico.crm}" id="crm" style="width:150px" maxlength="20" required="true" requiredMessage="Campo obrigatório" />
<h:message for="crm" styleClass="alert alert-danger pull-right" style="margin-top: 0px; list-style: none; margin-right: 65px; padding: 4px 10px 4px 10px;" />
</fieldset>
<label><span style="color: red;">*</span> Campos obrigatórios</label>
<center>
Expand Down
Loading

0 comments on commit ccf25c2

Please sign in to comment.