forked from Coded/SIPRP
git-svn-id: https://svn.coded.pt/svn/SIPRP@547 bb69d46d-e84e-40c8-a05a-06db0d633741
parent
c269f0c78d
commit
f6498eb187
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Context path="/siprp_pagina"/>
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* GlobalConstant.java
|
||||||
|
*
|
||||||
|
* Created on 27 de Abril de 2005, 18:20
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public interface GlobalConstants
|
||||||
|
{
|
||||||
|
// BD
|
||||||
|
public static final String bdHost = "127.0.0.1";
|
||||||
|
public static final String bdPort = "5436";
|
||||||
|
public static final String bdUsername = "siprp";
|
||||||
|
public static final String bdPassword = "";
|
||||||
|
public static final String bdDriver = "org.postgresql.Driver";
|
||||||
|
public static final String bdUrl = "jdbc:postgresql://" + bdHost + ":" + bdPort + "/siprp";
|
||||||
|
|
||||||
|
public static final String bdLocalHost = "127.0.0.1";
|
||||||
|
public static final String bdLocalPort = "5436";
|
||||||
|
public static final String bdLocalUsername = "siprp";
|
||||||
|
public static final String bdLocalPassword = "";
|
||||||
|
public static final String bdLocalDriver = "org.postgresql.Driver";
|
||||||
|
public static final String bdLocalUrl = "jdbc:postgresql://" + bdHost + ":" + bdPort + "/siprp_local_3";
|
||||||
|
|
||||||
|
public static final String DEFAULT_EMAIL = "geral@siprp.pt";
|
||||||
|
|
||||||
|
public static final int TIPO_MARCACAO_EXAMES = 0;
|
||||||
|
public static final int TIPO_MARCACAO_CONSULTA = 1;
|
||||||
|
|
||||||
|
public static final Integer ESTADO_POR_REALIZAR = new Integer( 0 );
|
||||||
|
public static final Integer ESTADO_PARCIALMENTE_REALIZADO = new Integer( 1 );
|
||||||
|
public static final Integer ESTADO_REALIZADO = new Integer( 2 );
|
||||||
|
}
|
||||||
@ -0,0 +1,240 @@
|
|||||||
|
/*
|
||||||
|
* ServletAux.java
|
||||||
|
*
|
||||||
|
* Created on 10 de Março de 2005, 12:24
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import javax.activation.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.mail.*;
|
||||||
|
import javax.mail.internet.*;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.sql.*;
|
||||||
|
|
||||||
|
import org.apache.commons.mail.*;
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author psantos
|
||||||
|
*/
|
||||||
|
public class MailerServlet extends HttpServlet
|
||||||
|
implements GlobalConstants
|
||||||
|
{
|
||||||
|
public static final String EMAIL = "email";
|
||||||
|
public static final String EMAIL_MARCACAO = "email_marcacao";
|
||||||
|
public static final String EMAIL_RECRUTAMENTO = "email_recrutamento";
|
||||||
|
|
||||||
|
protected static Hashtable PROPERTIES;
|
||||||
|
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String TEMPLATE_DIR = this.getServletContext().getRealPath( "/" ) + "html/";
|
||||||
|
|
||||||
|
Properties props = new Properties();
|
||||||
|
props.setProperty( "file.resource.loader.path", TEMPLATE_DIR );
|
||||||
|
Velocity.init( props );
|
||||||
|
if( PROPERTIES == null )
|
||||||
|
{
|
||||||
|
Class.forName(bdDriver);
|
||||||
|
Connection con = DriverManager.getConnection( bdUrl, bdUsername, bdPassword );
|
||||||
|
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
ResultSet2DArray array = new ResultSet2DArray(
|
||||||
|
stmt.executeQuery( "Select name, value FROM properties;" ) );
|
||||||
|
PROPERTIES = new Hashtable();
|
||||||
|
for( int n = 0; n < array.columnLength(); n++ )
|
||||||
|
{
|
||||||
|
PROPERTIES.put( array.get( n, 0 ), array.get( n, 1 ) );
|
||||||
|
}
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String createContent( Hashtable parameters, String[] form_fields, String template )
|
||||||
|
{
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for( int i = 0; i < form_fields.length; i++ )
|
||||||
|
{
|
||||||
|
context.put( form_fields[ i ], parameters.get( form_fields[ i ] ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
Velocity.mergeTemplate( template, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String showResultPage( boolean success, String success_template, String fail_template )
|
||||||
|
{
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
String template;
|
||||||
|
if( success )
|
||||||
|
{
|
||||||
|
template = success_template;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
template = fail_template;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Velocity.mergeTemplate( template, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean sendMail( String from, String destination, String subject, String content, boolean html )
|
||||||
|
{
|
||||||
|
String smtp_server = "localhost";
|
||||||
|
String mailer = "Evolute Mailer";
|
||||||
|
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
props.put( "mail.smtp.host", smtp_server );
|
||||||
|
|
||||||
|
String content_type = ( html ) ? "text/html" : "text/plain";
|
||||||
|
|
||||||
|
Session session = Session.getInstance( props, null );
|
||||||
|
Message msg = new MimeMessage( session );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if( from != null )
|
||||||
|
{
|
||||||
|
msg.setFrom( new InternetAddress( from ) );
|
||||||
|
}
|
||||||
|
msg.setRecipients( Message.RecipientType.TO, InternetAddress.parse( destination, true ) );
|
||||||
|
msg.setSubject( subject );
|
||||||
|
|
||||||
|
msg.setContent( content.toString(), content_type );
|
||||||
|
|
||||||
|
msg.setHeader( "X-Mailer", mailer );
|
||||||
|
msg.setSentDate( new java.util.Date() );
|
||||||
|
Transport.send( msg );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean sendMail( String from, String destination, String subject, String content, boolean html,
|
||||||
|
String filename, byte attachment[], String type )
|
||||||
|
{
|
||||||
|
String smtp_server = "localhost";
|
||||||
|
String mailer = "Evolute Mailer";
|
||||||
|
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
props.put( "mail.smtp.host", smtp_server );
|
||||||
|
|
||||||
|
String content_type = ( html ) ? "text/html" : "text/plain";
|
||||||
|
|
||||||
|
Session session = Session.getInstance( props, null );
|
||||||
|
Message msg = new MimeMessage( session );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if( from != null )
|
||||||
|
{
|
||||||
|
msg.setFrom( new InternetAddress( from ) );
|
||||||
|
}
|
||||||
|
msg.setRecipients( Message.RecipientType.TO, InternetAddress.parse( destination, true ) );
|
||||||
|
msg.setSubject( subject );
|
||||||
|
msg.setHeader( "X-Mailer", mailer );
|
||||||
|
msg.setSentDate( new java.util.Date() );
|
||||||
|
|
||||||
|
Multipart multipart = new MimeMultipart();
|
||||||
|
BodyPart messageBodyPart = new MimeBodyPart();
|
||||||
|
messageBodyPart.setContent( content.toString(), content_type );
|
||||||
|
multipart.addBodyPart(messageBodyPart);
|
||||||
|
|
||||||
|
messageBodyPart = new MimeBodyPart();
|
||||||
|
// messageBodyPart.setDataHandler(
|
||||||
|
// new DataHandler( new ByteArrayDataSource( attachment, "/siprpWeb/test.txt" )));
|
||||||
|
messageBodyPart.setContent( attachment, content_type );
|
||||||
|
DataSource source = new ByteArrayDataSource(attachment, type);
|
||||||
|
messageBodyPart.setDataHandler(
|
||||||
|
new DataHandler(source));
|
||||||
|
messageBodyPart.setFileName(filename);
|
||||||
|
|
||||||
|
multipart.addBodyPart(messageBodyPart);
|
||||||
|
msg.setContent(multipart);
|
||||||
|
|
||||||
|
Transport.send( msg );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String checkParameter( String parameter )
|
||||||
|
{
|
||||||
|
if( parameter != null && parameter.trim().length() > 0 )
|
||||||
|
{
|
||||||
|
return parameter.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Hashtable parseParameters( Hashtable parameters )
|
||||||
|
{
|
||||||
|
Hashtable tmp = new Hashtable();
|
||||||
|
String[] element;
|
||||||
|
String key;
|
||||||
|
String new_element;
|
||||||
|
for( Enumeration e = parameters.keys(); e.hasMoreElements(); )
|
||||||
|
{
|
||||||
|
key = ( String ) e.nextElement();
|
||||||
|
element = ( String[] ) parameters.get( key );
|
||||||
|
if( element != null )
|
||||||
|
{
|
||||||
|
new_element = checkParameter( element[ 0 ] );
|
||||||
|
if( new_element != null )
|
||||||
|
{
|
||||||
|
tmp.put( key, new_element );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,168 @@
|
|||||||
|
/*
|
||||||
|
* NewsServlet.java
|
||||||
|
*
|
||||||
|
* Created on 20 de Maio de 2005, 17:48
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
import com.evolute.utils.*;
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.db.*;
|
||||||
|
import com.evolute.utils.sql.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author lflores
|
||||||
|
*/
|
||||||
|
public class NewsServlet extends HttpServlet
|
||||||
|
implements GlobalConstants
|
||||||
|
{
|
||||||
|
private static DBManager DBM = null;
|
||||||
|
|
||||||
|
private static final Select SELECT = new Select( new String[]{ "not_noticias" },
|
||||||
|
new String[]{"data", "noticia"}, new Field( "id" ).in(
|
||||||
|
new Field( "( SELECT MAX( id ) FROM not_noticias )" ) ) );
|
||||||
|
|
||||||
|
private SQLExecuter executer = null;
|
||||||
|
|
||||||
|
private static boolean velocityInit = false;
|
||||||
|
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
if( !velocityInit )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String TEMPLATE_DIR = this.getServletContext().getRealPath( "/" ) + "html/";
|
||||||
|
|
||||||
|
Properties props = new Properties();
|
||||||
|
props.setProperty( "file.resource.loader.path", TEMPLATE_DIR );
|
||||||
|
Velocity.init( props );
|
||||||
|
}
|
||||||
|
catch( Exception ex )
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
velocityInit = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( DBM != null )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DBM = new JDBCManager( bdUrl + "?prepareThreshold=1",
|
||||||
|
bdUsername, bdPassword , 8, 8, 0, new SQLQuery[] {} );
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void close()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DBM.close();
|
||||||
|
DBM = null;
|
||||||
|
}
|
||||||
|
catch( Exception ex )
|
||||||
|
{
|
||||||
|
// we come here after an error
|
||||||
|
// so we discard this exception
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getNews()
|
||||||
|
{
|
||||||
|
//System.err.println( "NEWS: BEGIN" );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if( executer == null )
|
||||||
|
{
|
||||||
|
executer = ( SQLExecuter )DBM.getSharedExecuter();
|
||||||
|
}
|
||||||
|
Virtual2DArray array = executer.executeQuery( SELECT );
|
||||||
|
Object o[][] = array.getObjects();
|
||||||
|
if( o != null && o.length > 0 )
|
||||||
|
{
|
||||||
|
//System.err.println( "NEWS: " + o[ 0 ][ 0 ].toString() );
|
||||||
|
return
|
||||||
|
//o[ 0 ][ 0 ].toString() +
|
||||||
|
StringConverter.unicodeToHTML( o[ 0 ][ 1 ].toString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch( Exception ex )
|
||||||
|
{
|
||||||
|
//System.err.println( "NEWS: EX" );
|
||||||
|
ex.printStackTrace();
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
//System.err.println( "NEWS: END" );
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doGet( HttpServletRequest req, HttpServletResponse res )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
//System.err.println( "NEWS: GET BEGIN" );
|
||||||
|
init();
|
||||||
|
//System.err.println( "NEWS: AF INIT" );
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
// String queryString = req.getQueryString();
|
||||||
|
res.setContentType( "text/html" );
|
||||||
|
String news = getNews();
|
||||||
|
Hashtable parameters = new Hashtable();
|
||||||
|
if( news == null )
|
||||||
|
{
|
||||||
|
parameters.put( "noticias", "" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parameters.put( "noticias", news );
|
||||||
|
}
|
||||||
|
//System.err.println( "NEWS: BF SHOW" );
|
||||||
|
out.println( showPage( "noticias/mostrar_noticias.html", parameters ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
private String showPage( String page, Hashtable parameters )
|
||||||
|
{
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if( parameters != null )
|
||||||
|
{
|
||||||
|
String key;
|
||||||
|
for( Enumeration e = parameters.keys(); e.hasMoreElements(); )
|
||||||
|
{
|
||||||
|
key = ( String ) e.nextElement();
|
||||||
|
context.put( key, parameters.get( key ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Velocity.mergeTemplate( page, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
* RequestServlet.java
|
||||||
|
*
|
||||||
|
* Created on 4 de Março de 2005, 18:19
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
|
||||||
|
import org.apache.commons.fileupload.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author psantos
|
||||||
|
*/
|
||||||
|
public class RecruitServlet extends MailerServlet
|
||||||
|
{
|
||||||
|
private final static String REC_FUNCAO = "rec_funcao";
|
||||||
|
private final static String REC_NOME = "rec_nome";
|
||||||
|
private final static String REC_MORADA = "rec_morada";
|
||||||
|
private final static String REC_TELEFONE = "rec_telefone";
|
||||||
|
private final static String REC_EMAIL = "rec_email";
|
||||||
|
private final static String REC_CV = "rec_cv";
|
||||||
|
|
||||||
|
private final static String[] FORM_FIELDS = new String[]{
|
||||||
|
REC_FUNCAO, REC_NOME, REC_MORADA,
|
||||||
|
REC_TELEFONE, REC_EMAIL, REC_CV
|
||||||
|
};
|
||||||
|
|
||||||
|
public void doPost( HttpServletRequest req, HttpServletResponse res )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
Hashtable parameters;
|
||||||
|
String fileName = "";
|
||||||
|
String type = "";
|
||||||
|
byte file[] = new byte[0];
|
||||||
|
boolean isMultipart = FileUpload.isMultipartContent( req );
|
||||||
|
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
res.setContentType( "text/html" );
|
||||||
|
|
||||||
|
if( isMultipart )
|
||||||
|
{
|
||||||
|
parameters = new Hashtable();
|
||||||
|
DiskFileUpload upload = new DiskFileUpload();
|
||||||
|
upload.setSizeThreshold(1000000);
|
||||||
|
upload.setSizeMax(1000000);
|
||||||
|
List items;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
items = upload.parseRequest(req);
|
||||||
|
}
|
||||||
|
catch( FileUploadException ex )
|
||||||
|
{
|
||||||
|
out.println( showResultPage( false, "mail/pedido_enviado.html", "mail/pedido_nao_enviado.html" ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Iterator iter = items.iterator();
|
||||||
|
while( iter.hasNext() )
|
||||||
|
{
|
||||||
|
FileItem item = (FileItem) iter.next();
|
||||||
|
|
||||||
|
if (item.isFormField())
|
||||||
|
{
|
||||||
|
String name = item.getFieldName();
|
||||||
|
String value = item.getString();
|
||||||
|
parameters.put( name, value );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
String fieldName = item.getFieldName();
|
||||||
|
fileName = item.getName();
|
||||||
|
file = item.get();
|
||||||
|
if( file == null || file.length == 0 )
|
||||||
|
{
|
||||||
|
isMultipart = false;
|
||||||
|
}
|
||||||
|
type = item.getContentType();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parameters = parseParameters( new Hashtable( req.getParameterMap() ) );
|
||||||
|
}
|
||||||
|
String content = createContent( parameters, FORM_FIELDS, "mail/envio_cv.txt" );
|
||||||
|
|
||||||
|
String email = DEFAULT_EMAIL;
|
||||||
|
if( PROPERTIES != null && PROPERTIES.containsKey( EMAIL_RECRUTAMENTO ) )
|
||||||
|
{
|
||||||
|
email = ( String ) PROPERTIES.get( EMAIL_RECRUTAMENTO );
|
||||||
|
}
|
||||||
|
String from = email;
|
||||||
|
String destination = email;
|
||||||
|
String subject = "Envio de CV através do site www.siprp.pt";
|
||||||
|
// manda mail
|
||||||
|
boolean success;
|
||||||
|
String nome = ( String ) parameters.get( REC_NOME );
|
||||||
|
String telefone = ( String ) parameters.get( REC_TELEFONE );
|
||||||
|
String mail = ( String ) parameters.get( REC_EMAIL );
|
||||||
|
if( nome == null || nome.trim().length() == 0 || telefone == null || telefone.trim().length() == 0 ||
|
||||||
|
mail == null || mail.trim().length() == 0 || mail.indexOf( '@' ) == -1 )
|
||||||
|
{
|
||||||
|
System.out.println( "nome: " + nome + " teefone: " + telefone + " email : " + email );
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
else if( isMultipart )
|
||||||
|
{
|
||||||
|
System.out.println( "Multipart" );
|
||||||
|
success = sendMail( from, destination, subject, content, false, fileName, file, type );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
System.out.println( "Normal" );
|
||||||
|
success = sendMail( from, destination, subject, content, false );
|
||||||
|
}
|
||||||
|
|
||||||
|
// mostra pagina correspondente
|
||||||
|
|
||||||
|
out.println( showResultPage( success, "mail/cv_enviado.html", "mail/cv_nao_enviado.html" ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,121 @@
|
|||||||
|
/*
|
||||||
|
* RelatorioServlet.java
|
||||||
|
*
|
||||||
|
* Created on 27 de Abril de 2005, 16:16
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class RelatorioServlet extends MailerServlet
|
||||||
|
{
|
||||||
|
private final static String EMPRESA = "empresa";
|
||||||
|
private final static String EMAIL_EMPRESA = "email_empresa";
|
||||||
|
private final static String ANO = "ano";
|
||||||
|
|
||||||
|
private final static String[] FORM_FIELDS = new String[]{
|
||||||
|
EMPRESA, ANO, EMAIL_EMPRESA };
|
||||||
|
|
||||||
|
public void doGet( HttpServletRequest req, HttpServletResponse res )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
String queryString = req.getQueryString();
|
||||||
|
res.setContentType( "text/html" );
|
||||||
|
|
||||||
|
Hashtable parameters = new Hashtable();
|
||||||
|
|
||||||
|
// Ir buscar os parametros à sessão
|
||||||
|
HttpSession session = req.getSession( false );
|
||||||
|
if( session == null )
|
||||||
|
{
|
||||||
|
// timeout
|
||||||
|
out.println( showPage( "relatorio/pedido_sessao_expirou.html", null ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
out.println( showPage( "relatorio/pedido_relatorio.html", parameters ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doPost( HttpServletRequest req, HttpServletResponse res )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
String queryString = req.getQueryString();
|
||||||
|
res.setContentType( "text/html" );
|
||||||
|
|
||||||
|
// Info de marcacao
|
||||||
|
// Dados que vem no pedido: marcacao_tipo, data, hora
|
||||||
|
Hashtable parameters = parseParameters( new Hashtable( req.getParameterMap() ) );
|
||||||
|
|
||||||
|
// Ir buscar o resto dos parametros à sessão
|
||||||
|
HttpSession session = req.getSession( false );
|
||||||
|
if( session == null )
|
||||||
|
{
|
||||||
|
// timeout
|
||||||
|
out.println( showPage( "relatorio/pedido_sessao_expirou.html", null ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters.put( EMPRESA, session.getAttribute( siprpServlet.sessionCompanyName ) );
|
||||||
|
String from = ( String ) session.getAttribute( siprpServlet.sessionCompanyEmail );
|
||||||
|
|
||||||
|
String email = DEFAULT_EMAIL;
|
||||||
|
if( PROPERTIES != null && PROPERTIES.containsKey( EMAIL ) )
|
||||||
|
{
|
||||||
|
email = ( String ) PROPERTIES.get( EMAIL );
|
||||||
|
}
|
||||||
|
String destination = email;
|
||||||
|
String subject = "Pedido de envio de relatorio via web";
|
||||||
|
if( parameters.get( ANO ) == null )
|
||||||
|
{
|
||||||
|
parameters.put( ANO, "corrente" );
|
||||||
|
}
|
||||||
|
String content = createContent( parameters, FORM_FIELDS, "relatorio/pedido.html" );
|
||||||
|
// manda mail
|
||||||
|
boolean success = sendMail( from, destination, subject, content, true );
|
||||||
|
|
||||||
|
// mostra pagina correspondente
|
||||||
|
out.println( showResultPage( success, "relatorio/pedido_enviado.html", "relatorio/pedido_nao_enviado.html" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
private String showPage( String page, Hashtable parameters )
|
||||||
|
{
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if( parameters != null )
|
||||||
|
{
|
||||||
|
String key;
|
||||||
|
for( Enumeration e = parameters.keys(); e.hasMoreElements(); )
|
||||||
|
{
|
||||||
|
key = ( String ) e.nextElement();
|
||||||
|
context.put( key, parameters.get( key ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Velocity.mergeTemplate( page, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* RequestServlet.java
|
||||||
|
*
|
||||||
|
* Created on 4 de Março de 2005, 18:19
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author psantos
|
||||||
|
*/
|
||||||
|
public class RequestServlet extends MailerServlet
|
||||||
|
{
|
||||||
|
private final static String REQUEST_NAME = "request_name";
|
||||||
|
private final static String REQUEST_PHONE = "request_phone";
|
||||||
|
private final static String REQUEST_EMAIL = "request_email";
|
||||||
|
private final static String REQUEST_DETAILS = "request_details";
|
||||||
|
|
||||||
|
private final static String[] FORM_FIELDS = new String[]{
|
||||||
|
REQUEST_NAME, REQUEST_PHONE,
|
||||||
|
REQUEST_EMAIL, REQUEST_DETAILS
|
||||||
|
};
|
||||||
|
|
||||||
|
public void doPost( HttpServletRequest req, HttpServletResponse res )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
res.setContentType( "text/html" );
|
||||||
|
|
||||||
|
/*
|
||||||
|
parametros:
|
||||||
|
request_name
|
||||||
|
request_phone
|
||||||
|
request_email
|
||||||
|
request_details
|
||||||
|
*/
|
||||||
|
// recebe info de contacto
|
||||||
|
Hashtable parameters = parseParameters( new Hashtable( req.getParameterMap() ) );
|
||||||
|
|
||||||
|
String content = createContent( parameters, FORM_FIELDS, "mail/pedido_informacao.txt" );
|
||||||
|
|
||||||
|
String from = ( String ) parameters.get( REQUEST_EMAIL );
|
||||||
|
String email = DEFAULT_EMAIL;
|
||||||
|
if( PROPERTIES != null && PROPERTIES.containsKey( EMAIL ) )
|
||||||
|
{
|
||||||
|
email = ( String ) PROPERTIES.get( EMAIL );
|
||||||
|
}
|
||||||
|
String destination = email;
|
||||||
|
String subject = "Pedido de informação através do site www.siprp.pt";
|
||||||
|
// manda mail
|
||||||
|
boolean success = sendMail( from, destination, subject, content, false );
|
||||||
|
|
||||||
|
// mostra pagina correspondente
|
||||||
|
out.println( showResultPage( success, "mail/pedido_enviado.html", "mail/pedido_nao_enviado.html" ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,142 @@
|
|||||||
|
/*
|
||||||
|
* ScheduleServlet.java
|
||||||
|
*
|
||||||
|
* Created on 10 de Março de 2005, 12:22
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author psantos
|
||||||
|
*/
|
||||||
|
public class ScheduleServlet extends MailerServlet
|
||||||
|
{
|
||||||
|
private final static String EMPRESA = "empresa";
|
||||||
|
private final static String ESTABELECIMENTO = "estabelecimento";
|
||||||
|
private final static String FUNCIONARIO = "funcionario";
|
||||||
|
private final static String MARCACAO_TIPO = "marcacao_tipo";
|
||||||
|
private final static String DATA = "data";
|
||||||
|
private final static String HORA = "hora";
|
||||||
|
private final static String EMAIL_EMPRESA = "email_empresa";
|
||||||
|
|
||||||
|
private final static String[] FORM_FIELDS = new String[]{
|
||||||
|
EMPRESA, ESTABELECIMENTO, FUNCIONARIO,
|
||||||
|
MARCACAO_TIPO, DATA, HORA, EMAIL_EMPRESA
|
||||||
|
};
|
||||||
|
|
||||||
|
public void doGet( HttpServletRequest req, HttpServletResponse res )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
String queryString = req.getQueryString();
|
||||||
|
res.setContentType( "text/html" );
|
||||||
|
|
||||||
|
Hashtable parameters = new Hashtable();
|
||||||
|
|
||||||
|
// Ir buscar os parametros à sessão
|
||||||
|
HttpSession session = req.getSession( false );
|
||||||
|
if( session == null )
|
||||||
|
{
|
||||||
|
// timeout
|
||||||
|
out.println( showPage( "marcacao/marcacao_sessao_expirou.html", null ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters.put( EMPRESA, session.getAttribute( siprpServlet.sessionCompanyName ) );
|
||||||
|
parameters.put( ESTABELECIMENTO, session.getAttribute( "session_estabelecimento_nome" ) );
|
||||||
|
parameters.put( FUNCIONARIO, session.getAttribute( "session_funcionario_nome" ) );
|
||||||
|
|
||||||
|
String tokens[] = queryString.split( "[?]" );
|
||||||
|
if( tokens.length > 0 && tokens[ tokens.length - 1 ].equals( "consulta" ) )
|
||||||
|
{
|
||||||
|
out.println( showPage( "marcacao/marcacao_consulta.html", parameters ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( showPage( "marcacao/marcacao_exame.html", parameters ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doPost( HttpServletRequest req, HttpServletResponse res )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
String queryString = req.getQueryString();
|
||||||
|
res.setContentType( "text/html" );
|
||||||
|
|
||||||
|
// Info de marcacao
|
||||||
|
// Dados que vem no pedido: marcacao_tipo, data, hora
|
||||||
|
Hashtable parameters = parseParameters( new Hashtable( req.getParameterMap() ) );
|
||||||
|
|
||||||
|
// Ir buscar o resto dos parametros à sessão
|
||||||
|
HttpSession session = req.getSession( false );
|
||||||
|
if( session == null )
|
||||||
|
{
|
||||||
|
// timeout
|
||||||
|
out.println( showPage( "marcacao/marcacao_sessao_expirou.html", null ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters.put( EMPRESA, session.getAttribute( siprpServlet.sessionCompanyName ) );
|
||||||
|
parameters.put( ESTABELECIMENTO, session.getAttribute( "session_estabelecimento_nome" ) );
|
||||||
|
parameters.put( FUNCIONARIO, session.getAttribute( "session_funcionario_nome" ) );
|
||||||
|
//parameters.put( session.getAttribute( "session_funcionario_numero" ) );
|
||||||
|
|
||||||
|
String from = ( String ) session.getAttribute( siprpServlet.sessionCompanyEmail );
|
||||||
|
|
||||||
|
String marcacao_tipo = ( String )parameters.get( MARCACAO_TIPO );
|
||||||
|
|
||||||
|
String email = DEFAULT_EMAIL;
|
||||||
|
if( PROPERTIES != null && PROPERTIES.containsKey( EMAIL_MARCACAO ) )
|
||||||
|
{
|
||||||
|
email = ( String ) PROPERTIES.get( EMAIL_MARCACAO );
|
||||||
|
}
|
||||||
|
String destination = email;
|
||||||
|
String subject = "Pedido de marca\u00e7\u00e3o de " + marcacao_tipo + " via web";
|
||||||
|
String content = createContent( parameters, FORM_FIELDS, "marcacao/marcacao.html" );
|
||||||
|
// manda mail
|
||||||
|
boolean success = sendMail( from, destination, subject, content, true );
|
||||||
|
|
||||||
|
// mostra pagina correspondente
|
||||||
|
out.println( showResultPage( success, "marcacao/marcacao_enviada.html", "marcacao/marcacao_nao_enviada.html" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
private String showPage( String page, Hashtable parameters )
|
||||||
|
{
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if( parameters != null )
|
||||||
|
{
|
||||||
|
String key;
|
||||||
|
for( Enumeration e = parameters.keys(); e.hasMoreElements(); )
|
||||||
|
{
|
||||||
|
key = ( String ) e.nextElement();
|
||||||
|
context.put( key, parameters.get( key ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Velocity.mergeTemplate( page, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
public class doGetListaEmpresas extends siprpServlet{
|
||||||
|
|
||||||
|
/** Creates a new instance of doGetListaEmpresas */
|
||||||
|
public doGetListaEmpresas(HttpServletRequest req, HttpServletResponse res) throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
Connection con = null ;
|
||||||
|
Statement stmt = null ;
|
||||||
|
ResultSet2DArray rs;
|
||||||
|
StringBuffer dbQuery;
|
||||||
|
String userRole="", temp="";
|
||||||
|
HttpSession session = req.getSession(false);
|
||||||
|
Vector links = new Vector();
|
||||||
|
Vector desc = new Vector();
|
||||||
|
String empresa_nome;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userRole = (String)session.getAttribute(super.sessionUserRole);
|
||||||
|
empresa_nome = ( String ) session.getAttribute( sessionCompanyName );
|
||||||
|
|
||||||
|
if (userRole == null)
|
||||||
|
{
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( userRole.equals ( super.superUserRole ) )
|
||||||
|
{
|
||||||
|
empresa_nome = null;
|
||||||
|
Class.forName(super.bdDriver);
|
||||||
|
con = DriverManager.getConnection( bdLocalUrl, bdLocalUsername, bdLocalPassword );
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append( "SELECT id, designacao_social, designacao_social_plain FROM empresas WHERE inactivo <> 'y' ORDER BY designacao_social_plain" );
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
|
||||||
|
int index=0;
|
||||||
|
int max = rs.columnLength();
|
||||||
|
|
||||||
|
while ( index < max )
|
||||||
|
{
|
||||||
|
String str = (String)rs.get(index,1);
|
||||||
|
if( str != null && str.trim().length() > 0 )
|
||||||
|
{
|
||||||
|
temp=""+rs.get(index,0); // converter de int para String
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append("/"+super.servletName+"/?"+temp); // contruir url
|
||||||
|
links.add(dbQuery.toString());
|
||||||
|
desc.add((String)rs.get(index,1));
|
||||||
|
}
|
||||||
|
++index;
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
con.close();
|
||||||
|
|
||||||
|
|
||||||
|
session.setAttribute( sessionEstabelecimentoId, null );
|
||||||
|
|
||||||
|
HashMap hmValues = new HashMap();
|
||||||
|
//hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
||||||
|
hmValues.put( "empresa_nome", empresa_nome );
|
||||||
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
||||||
|
hmValues.put( "estabelecimento_id", session.getAttribute( sessionEstabelecimentoId ) );
|
||||||
|
hmValues.put( "userRole", userRole );
|
||||||
|
hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
||||||
|
hmValues.put( msgTemplate , super.msgListaEmpresas ) ;
|
||||||
|
hmValues.put( templateUserRole, userRole);
|
||||||
|
hmValues.put( templateQuery, super.queryStringEmpresas );
|
||||||
|
hmValues.put( templateVector1,links);
|
||||||
|
hmValues.put( templateVector2,desc);
|
||||||
|
hmValues.put( templateVector3,null);
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
||||||
|
|
||||||
|
|
||||||
|
//out.println( mergeTemplate( super.msgListaEmpresas, userRole, super.queryStringEmpresas, links, desc, null, super.authenticatedUserTemplate) );
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgAcessoNegado , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch ( IllegalStateException e ) // session timeout
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate(msgSessionTimeout, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( SQLException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgErroBd , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgGenericError , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
public class doGetListaEstabelecimentos extends siprpServlet{
|
||||||
|
|
||||||
|
/** Creates a new instance of doGetListaEstabelecimentos */
|
||||||
|
public doGetListaEstabelecimentos(HttpServletRequest req, HttpServletResponse res) throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
Connection con = null ;
|
||||||
|
Statement stmt = null ;
|
||||||
|
ResultSet2DArray rs;
|
||||||
|
StringBuffer dbQuery, sBuffer;
|
||||||
|
String userRole, empresaId, temp;
|
||||||
|
HttpSession session = req.getSession(false);
|
||||||
|
Vector links = new Vector();
|
||||||
|
Vector desc = new Vector();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userRole = (String)session.getAttribute(super.sessionUserRole);
|
||||||
|
empresaId = (String)session.getAttribute(super.sessionEmpresaId);
|
||||||
|
|
||||||
|
if ( userRole.equals ( super.superUserRole ) || userRole.equals ( empresaId ) )
|
||||||
|
{
|
||||||
|
Class.forName(super.bdDriver);
|
||||||
|
con = DriverManager.getConnection( bdLocalUrl, bdLocalUsername, bdLocalPassword );
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append( " SELECT id, nome, nome_plain FROM estabelecimentos WHERE inactivo <> 'y' AND empresa_id = '"+empresaId+"' order by nome_plain" );
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
|
||||||
|
int index=0;
|
||||||
|
int max = rs.columnLength();
|
||||||
|
|
||||||
|
while ( index < max )
|
||||||
|
{
|
||||||
|
temp=""+rs.get(index,0); // converter de int para String
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append("/"+super.servletName+"/?"+empresaId+"/"+temp); // contruir url
|
||||||
|
links.add(dbQuery.toString());
|
||||||
|
desc.add((String)rs.get(index,1));
|
||||||
|
++index;
|
||||||
|
}
|
||||||
|
sBuffer = new StringBuffer();
|
||||||
|
sBuffer.append("<b>"+super.nomeEmpresa(con,empresaId)+"</b>");
|
||||||
|
|
||||||
|
if( userRole.equals( "manager" ) )
|
||||||
|
{
|
||||||
|
session.setAttribute( sessionCompanyName, nomeEmpresa( con, ( String ) session.getAttribute( sessionEmpresaId ) ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
session.setAttribute( sessionCompanyName, nomeEmpresa( con, userRole ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setAttribute( sessionCompanyEmail, emailEmpresa( con, empresaId ) );
|
||||||
|
|
||||||
|
session.setAttribute( sessionEstabelecimentoId, null );
|
||||||
|
|
||||||
|
HashMap hmValues = new HashMap();
|
||||||
|
hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
||||||
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
||||||
|
hmValues.put( "estabelecimento_id", session.getAttribute( sessionEstabelecimentoId ) );
|
||||||
|
hmValues.put( "userRole", userRole );
|
||||||
|
hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
||||||
|
hmValues.put( msgTemplate , sBuffer.toString() ) ;
|
||||||
|
hmValues.put( templateUserRole, userRole);
|
||||||
|
hmValues.put( templateQuery, super.queryStringEstabelecimentos );
|
||||||
|
hmValues.put( templateVector1,links);
|
||||||
|
hmValues.put( templateVector2,desc);
|
||||||
|
hmValues.put( templateVector3,null);
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
||||||
|
|
||||||
|
// out.println( mergeTemplate( sBuffer.toString(), userRole, super.queryStringEstabelecimentos, links, desc, null, super.authenticatedUserTemplate) );
|
||||||
|
stmt.close();
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgAcessoNegado , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( SQLException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgErroBd , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgGenericError , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,299 @@
|
|||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
public class doGetListaTrabalhadores extends siprpServlet{
|
||||||
|
|
||||||
|
/** Creates a new instance of doGetListaTrabalhadores */
|
||||||
|
public doGetListaTrabalhadores(HttpServletRequest req, HttpServletResponse res, String query) throws IOException
|
||||||
|
{
|
||||||
|
boolean print = false;
|
||||||
|
if( query != null )
|
||||||
|
{
|
||||||
|
print = query.indexOf( "_print" ) != -1;
|
||||||
|
if( query.indexOf( "trabalhadores_tudo" ) == 0 )
|
||||||
|
{
|
||||||
|
new doGetListaTrabalhadoresTudo( req, res, print );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if( query.indexOf( "trabalhadores_pendentes" ) == 0 )
|
||||||
|
{
|
||||||
|
new doGetListaTrabalhadoresPendentes( req, res, print );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
Connection con = null ;
|
||||||
|
Statement stmt = null ;
|
||||||
|
ResultSet2DArray rs, rsTrab;
|
||||||
|
StringBuffer sBuffer;
|
||||||
|
String userRole, empresaId, estabelecimentoId, temp;
|
||||||
|
HttpSession session = req.getSession(false);
|
||||||
|
Vector links = new Vector();
|
||||||
|
Vector desc = new Vector();
|
||||||
|
Vector descAdicional = new Vector();
|
||||||
|
java.util.Date today = new java.util.Date();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userRole = (String)session.getAttribute(super.sessionUserRole);
|
||||||
|
empresaId = (String)session.getAttribute(super.sessionEmpresaId);
|
||||||
|
estabelecimentoId = (String)session.getAttribute(super.sessionEstabelecimentoId);
|
||||||
|
|
||||||
|
if ( userRole.equals ( super.superUserRole ) || userRole.equals ( empresaId ) )
|
||||||
|
{
|
||||||
|
Class.forName(super.bdDriver);
|
||||||
|
con = DriverManager.getConnection( bdLocalUrl, bdLocalUsername, bdLocalPassword );
|
||||||
|
if ( super.verificaEstabelecimento(con, empresaId, estabelecimentoId) ) // estabelecimento pertence à empresa ??
|
||||||
|
{
|
||||||
|
//Class.forName(super.bdDriver);
|
||||||
|
//con = DriverManager.getConnection( super.bdUrl, super.bdUsername, super.bdPassword );
|
||||||
|
String dbQuery = "SELECT id, nome, nome_plain FROM trabalhadores WHERE inactivo <> 'y' AND data_demissao IS NULL AND estabelecimento_id = '"+estabelecimentoId+"' ORDER BY nome_plain";
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rsTrab = new ResultSet2DArray( stmt.executeQuery( dbQuery ) );
|
||||||
|
rsTrab.getObjects();
|
||||||
|
stmt.close();
|
||||||
|
|
||||||
|
final int max = rsTrab.columnLength();
|
||||||
|
|
||||||
|
for ( int index = 0; index < max; index++ )
|
||||||
|
{
|
||||||
|
Integer id = (Integer)rsTrab.get(index,0);
|
||||||
|
String link = "/"+super.servletName+"/?"+empresaId+"/"+estabelecimentoId+"/"+id;
|
||||||
|
links.add(link);
|
||||||
|
HashMap trabalhador = new HashMap();
|
||||||
|
trabalhador.put( "Nome", (String)rsTrab.get(index,1) );
|
||||||
|
|
||||||
|
|
||||||
|
dbQuery = "SELECT id, data, estado FROM marcacoes_trabalhador "
|
||||||
|
+ "WHERE tipo = 1 and trabalhador_id = " + id
|
||||||
|
+ " ORDER BY data DESC";
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery ) );
|
||||||
|
rs.getObjects();
|
||||||
|
stmt.close();
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
java.util.Date dataConsulta2 = ( java.util.Date ) rs.get( 0, 1 );
|
||||||
|
Integer estado2 = ( Integer ) rs.get( 0, 2 );
|
||||||
|
java.util.Date dataConsulta1;
|
||||||
|
// java.util.Date dataRelatorio1;
|
||||||
|
// java.util.Date dataRelatorio2 = (java.util.Date) rs.get( 0, 3 );
|
||||||
|
Integer estado1;
|
||||||
|
String realizada1 = "";
|
||||||
|
String realizada2 = "";
|
||||||
|
if( rs.columnLength() >= 2 )
|
||||||
|
{
|
||||||
|
dataConsulta1 = ( java.util.Date ) rs.get( 1, 1 );
|
||||||
|
estado1 = ( Integer ) rs.get( 1, 2 );
|
||||||
|
// dataRelatorio1 = (java.util.Date) rs.get( 1, 3 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataConsulta1 = dataConsulta2;
|
||||||
|
estado1 = estado2;
|
||||||
|
// dataRelatorio1 = dataRelatorio2;
|
||||||
|
}
|
||||||
|
if( ESTADO_REALIZADO.equals( estado2 ) || today.after( dataConsulta2 ) )
|
||||||
|
{
|
||||||
|
trabalhador.put( "ultima_consulta", dataConsulta2 );
|
||||||
|
if( estado2.equals( ESTADO_POR_REALIZAR ) )
|
||||||
|
{
|
||||||
|
realizada2 = "não";
|
||||||
|
}
|
||||||
|
else if( estado2.equals( ESTADO_REALIZADO ) )
|
||||||
|
{
|
||||||
|
realizada2 = "sim";
|
||||||
|
}
|
||||||
|
trabalhador.put( "realizada", realizada2 );
|
||||||
|
trabalhador.put( "proxima_consulta", "" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for( int c = 1; c < rs.columnLength(); c++ )
|
||||||
|
{
|
||||||
|
java.util.Date dataTemp = ( java.util.Date ) rs.get( c, 1 );
|
||||||
|
dataConsulta1 = dataTemp;
|
||||||
|
estado1 = ( Integer ) rs.get( c, 2 );
|
||||||
|
if( dataTemp.after( today ) )
|
||||||
|
{
|
||||||
|
dataConsulta2 = dataTemp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch( Exception ex )
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
trabalhador.put( "proxima_consulta", dataConsulta2 );
|
||||||
|
|
||||||
|
if( !dataConsulta2.equals( dataConsulta1 ) )
|
||||||
|
{
|
||||||
|
if( estado1.equals( ESTADO_POR_REALIZAR ) )
|
||||||
|
{
|
||||||
|
realizada1 = "não";
|
||||||
|
}
|
||||||
|
else if( estado1.equals( ESTADO_REALIZADO ) )
|
||||||
|
{
|
||||||
|
realizada1 = "sim";
|
||||||
|
}
|
||||||
|
trabalhador.put( "realizada", realizada1 );
|
||||||
|
trabalhador.put( "ultima_consulta", dataConsulta1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trabalhador.put( "ultima_consulta", "" );
|
||||||
|
trabalhador.put( "realizada", null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trabalhador.put( "ultima_consulta", "" );
|
||||||
|
trabalhador.put( "realizada", null );
|
||||||
|
trabalhador.put( "proxima_consulta", "" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dbQuery = "SELECT id, data, estado FROM marcacoes_trabalhador "
|
||||||
|
+ "WHERE tipo = 0 and trabalhador_id = " + id
|
||||||
|
+ " ORDER BY data DESC";
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery ) );
|
||||||
|
rs.getObjects();
|
||||||
|
stmt.close();
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
java.util.Date dataConsulta2 = ( java.util.Date ) rs.get( 0, 1 );
|
||||||
|
Integer estado2 = ( Integer ) rs.get( 0, 2 );
|
||||||
|
Integer estado1;
|
||||||
|
java.util.Date dataConsulta1;
|
||||||
|
// java.util.Date dataRelatorio1;
|
||||||
|
// java.util.Date dataRelatorio2 = (java.util.Date) rs.get( 0, 3 );
|
||||||
|
String realizada1 = "";
|
||||||
|
String realizada2 = "";
|
||||||
|
if( rs.columnLength() >= 2 )
|
||||||
|
{
|
||||||
|
dataConsulta1 = ( java.util.Date ) rs.get( 1, 1 );
|
||||||
|
estado1 = ( Integer ) rs.get( 1, 2 );
|
||||||
|
// dataRelatorio1 = (java.util.Date) rs.get( 1, 3 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataConsulta1 = dataConsulta2;
|
||||||
|
estado1 = estado2;
|
||||||
|
// dataRelatorio1 = dataRelatorio2;
|
||||||
|
}
|
||||||
|
if( ESTADO_REALIZADO.equals( estado2 ) || today.after( dataConsulta2 ) )
|
||||||
|
{
|
||||||
|
trabalhador.put( "ultimo_exame", dataConsulta2 );
|
||||||
|
if( estado2.equals( ESTADO_POR_REALIZAR ) )
|
||||||
|
{
|
||||||
|
realizada2 = "não";
|
||||||
|
}
|
||||||
|
else if( estado2.equals( ESTADO_REALIZADO ) )
|
||||||
|
{
|
||||||
|
realizada2 = "sim";
|
||||||
|
}
|
||||||
|
trabalhador.put( "realizado", realizada2 );
|
||||||
|
trabalhador.put( "proximo_exame", "" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trabalhador.put( "proximo_exame", dataConsulta2 );
|
||||||
|
if( !dataConsulta2.equals( dataConsulta1 ) )
|
||||||
|
{
|
||||||
|
if( estado1.equals( ESTADO_POR_REALIZAR ) )
|
||||||
|
{
|
||||||
|
realizada1 = "não";
|
||||||
|
}
|
||||||
|
else if( estado1.equals( ESTADO_REALIZADO ) )
|
||||||
|
{
|
||||||
|
realizada1 = "sim";
|
||||||
|
}
|
||||||
|
trabalhador.put( "realizado", realizada1 );
|
||||||
|
trabalhador.put( "ultimo_exame", dataConsulta1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trabalhador.put( "ultimo_exame", "" );
|
||||||
|
trabalhador.put( "realizado", null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trabalhador.put( "ultimo_exame", "" );
|
||||||
|
trabalhador.put( "realizado", null );
|
||||||
|
trabalhador.put( "proximo_exame", "" );
|
||||||
|
}
|
||||||
|
|
||||||
|
desc.add( trabalhador );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sBuffer = new StringBuffer();
|
||||||
|
sBuffer.append("<b>"+super.nomeEmpresa(con,empresaId)+"</b><br><br><i>"
|
||||||
|
+super.nomeEstabelecimento(con, estabelecimentoId)+"</i>" );
|
||||||
|
|
||||||
|
HashMap hmValues = new HashMap();
|
||||||
|
hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
||||||
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
||||||
|
hmValues.put( "estabelecimento_nome", super.nomeEstabelecimento( con, estabelecimentoId ) );
|
||||||
|
hmValues.put( "estabelecimento_id", estabelecimentoId );
|
||||||
|
hmValues.put( "userRole", userRole );
|
||||||
|
hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
||||||
|
hmValues.put( msgTemplate , sBuffer.toString() ) ;
|
||||||
|
hmValues.put( templateUserRole, userRole);
|
||||||
|
hmValues.put( templateQuery, super.queryStringTrabalhadores );
|
||||||
|
hmValues.put( templateVector1,links);
|
||||||
|
hmValues.put( templateVector2,desc);
|
||||||
|
hmValues.put( templateVector3,null);
|
||||||
|
if( !print )
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserPrintTemplate));
|
||||||
|
}
|
||||||
|
// out.println( mergeTemplate( sBuffer.toString(), userRole, super.queryStringTrabalhadores, links, desc, null, super.authenticatedUserTemplate) );
|
||||||
|
}
|
||||||
|
else // est não pertence à empresa
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgLinkFormatError , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
else // Role não permite ver esta informação
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgAcessoNegado , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( SQLException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgErroBd , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgGenericError , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,879 @@
|
|||||||
|
/*
|
||||||
|
* doGetListaTrabalhadoresPendentes.java
|
||||||
|
*
|
||||||
|
* Created on 22 de Abril de 2005, 15:56
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.data.*;
|
||||||
|
import com.evolute.utils.db.*;
|
||||||
|
import com.evolute.utils.sql.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class doGetListaTrabalhadoresPendentes
|
||||||
|
extends siprpServlet
|
||||||
|
{
|
||||||
|
private static final long TRES_MESES = 3L * 30L * 24L * 60L * 60L * 1000L;
|
||||||
|
private static final long CATORZE_DIAS = 14L * 24L * 60L * 60L * 1000L;
|
||||||
|
|
||||||
|
protected static final int ESTADO_NAO_APLICAVEL = 0;
|
||||||
|
protected static final int ESTADO_PENDENTE = 1;
|
||||||
|
protected static final int ESTADO_MARCADO = 2;
|
||||||
|
protected static final int ESTADO_TRATADO = 3;
|
||||||
|
|
||||||
|
protected static int MOTIVO_ADMISSAO = 1;
|
||||||
|
protected static int MOTIVO_PERIODICA = 2;
|
||||||
|
protected static int MOTIVO_OCASIONAL = 3;
|
||||||
|
protected static int MOTIVO_PERIODICA_INICIAL = 5;
|
||||||
|
|
||||||
|
protected static final Hashtable CORES_ESTADOS = new Hashtable();
|
||||||
|
protected static final Hashtable TEXTOS_ESTADOS = new Hashtable();
|
||||||
|
static
|
||||||
|
{
|
||||||
|
CORES_ESTADOS.put( new Integer( ESTADO_NAO_APLICAVEL ), "white" );
|
||||||
|
CORES_ESTADOS.put( new Integer( ESTADO_PENDENTE ), "red" );
|
||||||
|
CORES_ESTADOS.put( new Integer( ESTADO_MARCADO ), "yellow" );
|
||||||
|
CORES_ESTADOS.put( new Integer( ESTADO_TRATADO ), "green" );
|
||||||
|
|
||||||
|
TEXTOS_ESTADOS.put( new Integer( ESTADO_NAO_APLICAVEL ), "n.a." );
|
||||||
|
TEXTOS_ESTADOS.put( new Integer( ESTADO_PENDENTE ), "pendente" );
|
||||||
|
TEXTOS_ESTADOS.put( new Integer( ESTADO_MARCADO ), "pendente" );
|
||||||
|
// TEXTOS_ESTADOS.put( new Integer( ESTADO_TRATADO ), "green" );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected java.sql.Date today;
|
||||||
|
protected long todayMillis;
|
||||||
|
|
||||||
|
/** Creates a new instance of doGetListaTrabalhadores */
|
||||||
|
// public doGetListaTrabalhadoresPendentes(HttpServletRequest req, HttpServletResponse res, boolean print)
|
||||||
|
// throws IOException
|
||||||
|
// {
|
||||||
|
// ServletOutputStream out = res.getOutputStream();
|
||||||
|
// Connection con = null ;
|
||||||
|
// Statement stmt = null ;
|
||||||
|
// ResultSet2DArray rs;
|
||||||
|
// StringBuffer dbQuery, sBuffer;
|
||||||
|
// String userRole, empresaId, estabelecimentoId, temp;
|
||||||
|
// HttpSession session = req.getSession(false);
|
||||||
|
// Vector links = new Vector();
|
||||||
|
// Vector desc = new Vector();
|
||||||
|
// Vector descAdicional = new Vector();
|
||||||
|
//// today = new java.util.Date();
|
||||||
|
//// todayMillis = today.getTime();
|
||||||
|
//
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
// rs = new ResultSet2DArray( stmt.executeQuery( "SELECT CURRENT_DATE" ) );
|
||||||
|
// today = ( java.sql.Date ) rs.get( 0, 0 );
|
||||||
|
// stmt.close();
|
||||||
|
// todayMillis = today.getTime();
|
||||||
|
//
|
||||||
|
// userRole = (String)session.getAttribute(super.sessionUserRole);
|
||||||
|
// empresaId = (String)session.getAttribute(super.sessionEmpresaId);
|
||||||
|
// estabelecimentoId = (String)session.getAttribute(super.sessionEstabelecimentoId);
|
||||||
|
//
|
||||||
|
// if ( userRole.equals ( super.superUserRole ) || userRole.equals ( empresaId ) )
|
||||||
|
// {
|
||||||
|
// Class.forName(super.bdDriver);
|
||||||
|
// con = DriverManager.getConnection( bdLocalUrl, bdLocalUsername, bdLocalPassword );
|
||||||
|
// if ( super.verificaEstabelecimento(con, empresaId, estabelecimentoId) ) // estabelecimento pertence à empresa ??
|
||||||
|
// {
|
||||||
|
// //Class.forName(super.bdDriver);
|
||||||
|
// //con = DriverManager.getConnection( super.bdUrl, super.bdUsername, super.bdPassword );
|
||||||
|
// dbQuery = new StringBuffer();
|
||||||
|
// dbQuery.append( "SELECT trabalhadores.id, trabalhadores.nome, "
|
||||||
|
// + "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, marcacoes_trabalhador.estado, "
|
||||||
|
// + " trabalhadores.nome_plain, marcacoes_trabalhador.motivo "
|
||||||
|
// + "FROM trabalhadores LEFT JOIN marcacoes_trabalhador ON ( marcacoes_trabalhador.trabalhador_id = trabalhadores.id )"
|
||||||
|
// + "WHERE estabelecimento_id = " + estabelecimentoId
|
||||||
|
// + " AND trabalhadores.inactivo <> 'y' AND data_demissao IS NULL "
|
||||||
|
// + " AND marcacoes_trabalhador.estado NOT IN ( 3, 4, 5) "
|
||||||
|
// + "ORDER BY 6, 3, 4 DESC " );
|
||||||
|
// // dbQuery.append( "SELECT id, nome, ( ultima_consulta IS NOT NULL AND realizada = 'y' ),"
|
||||||
|
// // + " ( ultimo_exame IS NOT NULL AND realizado = 'y' ),"
|
||||||
|
// // + " proxima_consulta IS NOT NULL, proximo_exame IS NOT NULL, "
|
||||||
|
// // + " ( proxima_consulta IS NOT NULL AND proxima_consulta - current_date <= 14 ), "
|
||||||
|
// // + " ( proximo_exame IS NOT NULL AND proximo_exame - current_date <= 14 )"
|
||||||
|
// // + " FROM trabalhadores "
|
||||||
|
// // + " WHERE estabelecimento_id = '"+estabelecimentoId+"'"
|
||||||
|
// // + " AND ( ultima_consulta IS NULL OR realizada = 'n' OR"
|
||||||
|
// // + " ( proxima_consulta IS NOT NULL AND proxima_consulta - current_date <= 14 )"
|
||||||
|
// // + " OR ( proximo_exame IS NOT NULL AND proximo_exame - current_date <= 14 ) )"
|
||||||
|
// // + " ORDER BY nome" );
|
||||||
|
// stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
// rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
//
|
||||||
|
// int index=0;
|
||||||
|
// int max = rs.columnLength();
|
||||||
|
//
|
||||||
|
// Integer trabalhadorID = new Integer( -1 );
|
||||||
|
// String nomeTrabalhador = "";
|
||||||
|
// Vector consultas = new Vector();
|
||||||
|
// Vector exames = new Vector();
|
||||||
|
//
|
||||||
|
// for ( index = 0; index <= max; index++ )
|
||||||
|
// {
|
||||||
|
// Integer id = index < max ? ( Integer ) rs.get( index, 0 ) : new Integer( -1 );
|
||||||
|
// if( !id.equals( trabalhadorID ) )
|
||||||
|
// {
|
||||||
|
// Object listaConsultas[][] = ( Object[][] ) consultas.toArray( new Object[consultas.size()][3] );
|
||||||
|
// Object listaExames[][] = ( Object[][] ) exames.toArray( new Object[exames.size()][3] );
|
||||||
|
// if( trabalhadorID.intValue() > -1 &&
|
||||||
|
// verificarTrabalhador( listaConsultas, listaExames ) )
|
||||||
|
// {
|
||||||
|
// temp=""+rs.get(index - 1,0); // converter de int para String
|
||||||
|
// dbQuery = new StringBuffer();
|
||||||
|
// dbQuery.append("/"+super.servletName+"/?"+empresaId+"/"+estabelecimentoId+"/"+temp); // contruir url
|
||||||
|
// links.add(dbQuery.toString());
|
||||||
|
// desc.add( criarDadosTrabalhador( con, trabalhadorID, nomeTrabalhador, listaConsultas, listaExames ) );
|
||||||
|
// }
|
||||||
|
// exames.clear();
|
||||||
|
// consultas.clear();
|
||||||
|
// }
|
||||||
|
// if( index == max )
|
||||||
|
// {
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// Integer tipo = ( Integer ) rs.get( index, 2 );
|
||||||
|
//
|
||||||
|
// String nome = ( String ) rs.get( index, 1 );
|
||||||
|
// java.util.Date data = ( java.util.Date ) rs.get( index, 3 );
|
||||||
|
// Integer estado = ( Integer ) rs.get( index, 4 );
|
||||||
|
// Integer motivo = ( Integer ) rs.get( index, 6 );
|
||||||
|
// trabalhadorID = id;
|
||||||
|
// nomeTrabalhador = nome;
|
||||||
|
// Object marcacao[] = new Object[]{ data, estado, motivo };
|
||||||
|
// if( tipo == null )
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// switch( tipo.intValue() )
|
||||||
|
// {
|
||||||
|
// case TIPO_MARCACAO_EXAMES:
|
||||||
|
// exames.add( marcacao );
|
||||||
|
// break;
|
||||||
|
//
|
||||||
|
// case TIPO_MARCACAO_CONSULTA:
|
||||||
|
// consultas.add( marcacao );
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// stmt.close();
|
||||||
|
//
|
||||||
|
// sBuffer = new StringBuffer();
|
||||||
|
// sBuffer.append("<b>"+super.nomeEmpresa(con,empresaId)+"</b><br><br><i>"
|
||||||
|
// +super.nomeEstabelecimento(con, estabelecimentoId)+"</i>" );
|
||||||
|
//
|
||||||
|
// HashMap hmValues = new HashMap();
|
||||||
|
// hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
||||||
|
// hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
||||||
|
// hmValues.put( "estabelecimento_nome", super.nomeEstabelecimento( con, estabelecimentoId ) );
|
||||||
|
// hmValues.put( "estabelecimento_id", estabelecimentoId );
|
||||||
|
// hmValues.put( "userRole", userRole );
|
||||||
|
// hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
||||||
|
// hmValues.put( msgTemplate , sBuffer.toString() ) ;
|
||||||
|
// hmValues.put( templateUserRole, userRole);
|
||||||
|
// hmValues.put( templateQuery, "trabalhadores_pendentes" );
|
||||||
|
// hmValues.put( templateVector1,links);
|
||||||
|
// hmValues.put( templateVector2,desc);
|
||||||
|
// hmValues.put( templateVector3,null);
|
||||||
|
// if( !print )
|
||||||
|
// {
|
||||||
|
// out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// out.println( mergeTemplate( hmValues, super.authenticatedUserPrintTemplate));
|
||||||
|
// }
|
||||||
|
//// out.println( mergeTemplate( sBuffer.toString(), userRole, super.queryStringTrabalhadores, links, desc, null, super.authenticatedUserTemplate) );
|
||||||
|
// }
|
||||||
|
// else // est não pertence à empresa
|
||||||
|
// {
|
||||||
|
// out.println( mergeTemplate( super.msgLinkFormatError , userRole, super.errorTemplate) );
|
||||||
|
// }
|
||||||
|
// con.close();
|
||||||
|
// }
|
||||||
|
// else // Role não permite ver esta informação
|
||||||
|
// {
|
||||||
|
// out.println( mergeTemplate( super.msgAcessoNegado , userRole, super.errorTemplate) );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch ( SQLException e )
|
||||||
|
// {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// out.println( mergeTemplate( super.msgErroBd , super.errorTemplate) );
|
||||||
|
// }
|
||||||
|
// catch ( Exception e )
|
||||||
|
// {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// out.println( mergeTemplate( super.msgGenericError , super.errorTemplate) );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
public doGetListaTrabalhadoresPendentes(HttpServletRequest req, HttpServletResponse res, boolean print )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
String userRole, empresaId, estabelecimentoId;
|
||||||
|
HttpSession session = req.getSession(false);
|
||||||
|
Vector links = new Vector();
|
||||||
|
Vector desc = new Vector();
|
||||||
|
Vector descAdicional = new Vector();
|
||||||
|
// today = new java.util.Date();
|
||||||
|
// todayMillis = today.getTime();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Executer executer = getExecuter();
|
||||||
|
Virtual2DArray array = executer.executeQuery( new Select( "SELECT CURRENT_DATE" ) );
|
||||||
|
today = ( java.sql.Date ) array.get( 0, 0 );
|
||||||
|
todayMillis = today.getTime();
|
||||||
|
|
||||||
|
userRole = (String)session.getAttribute(sessionUserRole);
|
||||||
|
empresaId = (String)session.getAttribute(sessionEmpresaId);
|
||||||
|
estabelecimentoId = (String)session.getAttribute(sessionEstabelecimentoId);
|
||||||
|
|
||||||
|
if ( userRole.equals ( superUserRole ) || userRole.equals ( empresaId ) )
|
||||||
|
{
|
||||||
|
if ( verificaEstabelecimento(null, empresaId, estabelecimentoId) ) // estabelecimento pertence à empresa ??
|
||||||
|
{
|
||||||
|
//Class.forName(super.bdDriver);
|
||||||
|
//con = DriverManager.getConnection( super.bdUrl, super.bdUsername, super.bdPassword );
|
||||||
|
String query = "( SELECT trabalhadores.id, trabalhadores.nome, "
|
||||||
|
+ "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, marcacoes_trabalhador.estado, "
|
||||||
|
+ " trabalhadores.nome_plain, marcacoes_trabalhador.motivo, marcacoes_trabalhador.data "
|
||||||
|
+ "FROM trabalhadores LEFT JOIN marcacoes_trabalhador ON ( marcacoes_trabalhador.trabalhador_id = trabalhadores.id ) "
|
||||||
|
+ "WHERE estabelecimento_id = " + estabelecimentoId
|
||||||
|
+ " AND trabalhadores.inactivo <> 'y' AND data_demissao IS NULL "
|
||||||
|
+ " AND marcacoes_trabalhador.estado NOT IN ( 3, 4, 5) "
|
||||||
|
+ " AND marcacoes_trabalhador.tipo = " + TIPO_MARCACAO_CONSULTA
|
||||||
|
+ " AND marcacoes_trabalhador.motivo <> " + MOTIVO_OCASIONAL + " )"
|
||||||
|
+ " UNION "
|
||||||
|
+ "( SELECT trabalhadores.id, trabalhadores.nome, "
|
||||||
|
+ "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, marcacoes_trabalhador.estado, "
|
||||||
|
+ " trabalhadores.nome_plain, marcacoes_trabalhador.motivo, marcacoes_trabalhador.data + 90 "
|
||||||
|
+ "FROM trabalhadores LEFT JOIN marcacoes_trabalhador ON ( marcacoes_trabalhador.trabalhador_id = trabalhadores.id ) "
|
||||||
|
+ "WHERE estabelecimento_id = " + estabelecimentoId
|
||||||
|
+ " AND trabalhadores.inactivo <> 'y' AND data_demissao IS NULL "
|
||||||
|
+ " AND marcacoes_trabalhador.estado NOT IN ( 3, 4, 5) "
|
||||||
|
+ " AND marcacoes_trabalhador.tipo = " + TIPO_MARCACAO_EXAMES + " )"
|
||||||
|
+ "ORDER BY 6, 8, 3 DESC ";
|
||||||
|
array = executer.executeQuery( new Select( query ) );
|
||||||
|
|
||||||
|
query = "SELECT trabalhadores.id, trabalhadores.nome, "
|
||||||
|
+ "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, marcacoes_trabalhador.estado, "
|
||||||
|
+ " trabalhadores.nome_plain, marcacoes_trabalhador.motivo, marcacoes_trabalhador.data "
|
||||||
|
+ "FROM trabalhadores LEFT JOIN marcacoes_trabalhador ON ( marcacoes_trabalhador.trabalhador_id = trabalhadores.id ) "
|
||||||
|
+ "WHERE estabelecimento_id = " + estabelecimentoId
|
||||||
|
+ " AND trabalhadores.inactivo <> 'y' AND data_demissao IS NULL "
|
||||||
|
+ " AND marcacoes_trabalhador.estado NOT IN ( 3, 4, 5) "
|
||||||
|
+ " AND marcacoes_trabalhador.tipo = " + TIPO_MARCACAO_CONSULTA
|
||||||
|
+ " AND marcacoes_trabalhador.motivo = " + MOTIVO_OCASIONAL
|
||||||
|
+ " ORDER BY 6, 8, 3 DESC";
|
||||||
|
Virtual2DArray ocasionaisArray = executer.executeQuery( new Select( query ) );
|
||||||
|
|
||||||
|
query = "SELECT trabalhadores.id, trabalhadores.nome "
|
||||||
|
+ "FROM trabalhadores "
|
||||||
|
+ "WHERE estabelecimento_id = " + estabelecimentoId
|
||||||
|
+ " AND trabalhadores.inactivo <> 'y' AND data_demissao IS NULL;";
|
||||||
|
Virtual2DArray trabalhadoresArray = executer.executeQuery( new Select( query ) );
|
||||||
|
|
||||||
|
Hashtable marcacoesPorID = new Hashtable();
|
||||||
|
Hashtable ocasionaisPorID = new Hashtable();
|
||||||
|
Hashtable nomesPorID = new Hashtable();
|
||||||
|
for( int n = 0; n < trabalhadoresArray.columnLength(); n++ )
|
||||||
|
{
|
||||||
|
nomesPorID.put( trabalhadoresArray.get( n, 0 ), trabalhadoresArray.get( n, 1 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
preencherMarcacoes( array, nomesPorID, marcacoesPorID );
|
||||||
|
preencherMarcacoes( ocasionaisArray, nomesPorID, ocasionaisPorID );
|
||||||
|
|
||||||
|
Integer ids[] = ( Integer[] ) nomesPorID.keySet().toArray( new Integer[0] );
|
||||||
|
IDObject trabalhadores[] = new IDObject[ ids.length ];
|
||||||
|
for( int n = 0; n < ids.length; n++ )
|
||||||
|
{
|
||||||
|
trabalhadores[ n ] = new MappableObject( ids[ n ], nomesPorID.get( ids[ n ] ) );
|
||||||
|
}
|
||||||
|
Arrays.sort( trabalhadores, new Comparator(){
|
||||||
|
public int compare( Object o1, Object o2 )
|
||||||
|
{
|
||||||
|
String nome1 = StringPlainer.convertString( o1.toString() );
|
||||||
|
String nome2 = StringPlainer.convertString( o2.toString() );
|
||||||
|
return nome1.compareTo( nome2 );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
for( int n = 0; n < trabalhadores.length; n++ )
|
||||||
|
{
|
||||||
|
Object marcacoes[][];
|
||||||
|
if( marcacoesPorID.containsKey( trabalhadores[ n ].getID() ) )
|
||||||
|
{
|
||||||
|
marcacoes = ( Object[][] ) ( ( Vector )marcacoesPorID.get( trabalhadores[ n ].getID() ) ).toArray( new Object[ 0 ][] );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
marcacoes = new Object[0][];
|
||||||
|
}
|
||||||
|
Object ocasionais[][];
|
||||||
|
if( ocasionaisPorID.containsKey( trabalhadores[ n ].getID() ) )
|
||||||
|
{
|
||||||
|
ocasionais = ( Object[][] ) ( ( Vector )ocasionaisPorID.get( trabalhadores[ n ].getID() ) ).toArray( new Object[ 0 ][] );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ocasionais = new Object[ 0 ][];
|
||||||
|
}
|
||||||
|
Object agrupadas[][] = agruparMarcacoes( marcacoes, ocasionais );
|
||||||
|
acrescentarTrabalhador( empresaId, estabelecimentoId,
|
||||||
|
trabalhadores[ n ], null,
|
||||||
|
agrupadas, links, desc,
|
||||||
|
perfilTemConsultas( trabalhadores[ n ].getID(), new Integer( empresaId ) ),
|
||||||
|
perfilTemExames( trabalhadores[ n ].getID(), new Integer( empresaId ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap hmValues = new HashMap();
|
||||||
|
hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
||||||
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
||||||
|
hmValues.put( "estabelecimento_nome", nomeEstabelecimento( null, estabelecimentoId ) );
|
||||||
|
hmValues.put( "estabelecimento_id", estabelecimentoId );
|
||||||
|
hmValues.put( "userRole", userRole );
|
||||||
|
hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
||||||
|
hmValues.put( msgTemplate , "<b>"+nomeEmpresa(null,empresaId)+"</b><br><br><i>"
|
||||||
|
+nomeEstabelecimento(null, estabelecimentoId)+"</i>" ) ;
|
||||||
|
hmValues.put( templateUserRole, userRole);
|
||||||
|
hmValues.put( templateQuery, "trabalhadores_pendentes" );
|
||||||
|
hmValues.put( templateVector1,links);
|
||||||
|
hmValues.put( templateVector2,desc);
|
||||||
|
hmValues.put( templateVector3,null);
|
||||||
|
if( !print )
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserPrintTemplate));
|
||||||
|
}
|
||||||
|
// out.println( mergeTemplate( sBuffer.toString(), userRole, super.queryStringTrabalhadores, links, desc, null, super.authenticatedUserTemplate) );
|
||||||
|
}
|
||||||
|
else // est não pertence à empresa
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgLinkFormatError , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Role não permite ver esta informação
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgAcessoNegado , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( SQLException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgErroBd , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgGenericError , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void preencherMarcacoes( Virtual2DArray array, Hashtable nomesPorID, Hashtable marcacoesPorID )
|
||||||
|
{
|
||||||
|
int max = array.columnLength();
|
||||||
|
for( int index = 0; index < max; index++ )
|
||||||
|
{
|
||||||
|
Integer id = index < max ? ( Integer ) array.get( index, 0 ) : new Integer( -1 );
|
||||||
|
Integer tipo = ( Integer ) array.get( index, 2 );
|
||||||
|
String nome = ( String ) array.get( index, 1 );
|
||||||
|
java.util.Date data = ( java.util.Date ) array.get( index, 3 );
|
||||||
|
Integer estado = ( Integer ) array.get( index, 4 );
|
||||||
|
Integer motivo = ( Integer ) array.get( index, 6 );
|
||||||
|
if( !marcacoesPorID.containsKey( id ) )
|
||||||
|
{
|
||||||
|
nomesPorID.put( id, nome );
|
||||||
|
marcacoesPorID.put( id, new Vector() );
|
||||||
|
}
|
||||||
|
if( data != null )
|
||||||
|
{
|
||||||
|
Object marcacao[] = new Object[]{ data, estado, motivo, tipo };
|
||||||
|
( ( Vector ) marcacoesPorID.get( id ) ).add( marcacao );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Object[][] agruparMarcacoes( Object marcacoes[][], Object ocasionais[][] )
|
||||||
|
{
|
||||||
|
long tresMeses = TRES_MESES;
|
||||||
|
java.util.Date dataExame = null;
|
||||||
|
Integer estadoExame = null;
|
||||||
|
java.util.Date dataConsulta = null;
|
||||||
|
Integer motivoConsulta = null;
|
||||||
|
Integer estadoConsulta = null;
|
||||||
|
Object grupo[] = null;
|
||||||
|
Vector grupos = new Vector();
|
||||||
|
|
||||||
|
if( marcacoes != null )
|
||||||
|
{
|
||||||
|
for( int n = 0; n < marcacoes.length; n++ )
|
||||||
|
{
|
||||||
|
if( grupo == null )
|
||||||
|
{
|
||||||
|
grupo = new Object[ 5 ];
|
||||||
|
dataExame = null;
|
||||||
|
estadoExame = null;
|
||||||
|
dataConsulta = null;
|
||||||
|
motivoConsulta = null;
|
||||||
|
estadoConsulta = null;
|
||||||
|
grupos.add( grupo );
|
||||||
|
}
|
||||||
|
|
||||||
|
java.util.Date data = ( java.util.Date ) marcacoes[ n ][ 0 ];
|
||||||
|
Integer estado = ( Integer ) marcacoes[ n ][ 1 ];
|
||||||
|
Integer motivo = ( Integer ) marcacoes[ n ][ 2 ];
|
||||||
|
Integer tipo = ( Integer ) marcacoes[ n ][ 3 ];
|
||||||
|
switch( tipo.intValue() )
|
||||||
|
{
|
||||||
|
case TIPO_MARCACAO_EXAMES:
|
||||||
|
if( dataConsulta == null &&
|
||||||
|
( dataExame == null || estadoExame.intValue() < 2 ) )
|
||||||
|
{
|
||||||
|
dataExame = data;
|
||||||
|
estadoExame = estado;
|
||||||
|
}
|
||||||
|
else if( dataConsulta != null && Math.abs( dataConsulta.getTime() - data.getTime() ) < tresMeses )
|
||||||
|
{
|
||||||
|
dataExame = data;
|
||||||
|
estadoExame = estado;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
grupo = null;
|
||||||
|
n--;
|
||||||
|
}
|
||||||
|
if( grupo != null )
|
||||||
|
{
|
||||||
|
grupo[ 3 ] = dataExame;
|
||||||
|
grupo[ 4 ] = estadoExame;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TIPO_MARCACAO_CONSULTA:
|
||||||
|
if( dataExame == null || Math.abs( dataExame.getTime() - data.getTime() ) < tresMeses )
|
||||||
|
{
|
||||||
|
dataConsulta = data;
|
||||||
|
estadoConsulta = estado;
|
||||||
|
motivoConsulta = motivo;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
grupo = null;
|
||||||
|
n--;
|
||||||
|
}
|
||||||
|
if( grupo != null )
|
||||||
|
{
|
||||||
|
grupo[ 0 ] = dataConsulta;
|
||||||
|
grupo[ 1 ] = estadoConsulta;
|
||||||
|
grupo[ 2 ] = motivoConsulta;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( ocasionais != null )
|
||||||
|
{
|
||||||
|
for( int n = 0; n < ocasionais.length; n++ )
|
||||||
|
{
|
||||||
|
grupo = new Object[ 5 ];
|
||||||
|
for( int i = 0; i < 3; i++ )
|
||||||
|
{
|
||||||
|
grupo[ i ] = ocasionais[ n ][ i ];
|
||||||
|
}
|
||||||
|
grupos.add( grupo );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Object agrupadas[][] = ( Object[][] ) grupos.toArray( new Object[ grupos.size() ][] );
|
||||||
|
Arrays.sort( agrupadas, new Comparator(){
|
||||||
|
public int compare( Object o1, Object o2 )
|
||||||
|
{
|
||||||
|
Object g1[] = ( Object[] ) o1;
|
||||||
|
Object g2[] = ( Object[] ) o2;
|
||||||
|
java.util.Date d1 = ( java.util.Date ) ( g1[ 0 ] != null ? g1[ 0 ] : g1[ 3 ] );
|
||||||
|
java.util.Date d2 = ( java.util.Date ) ( g2[ 0 ] != null ? g2[ 0 ] : g2[ 3 ] );
|
||||||
|
return d2.compareTo( d1 );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
return agrupadas;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void acrescentarTrabalhador( String empresaID, String estabelecimentoID,
|
||||||
|
IDObject trabalhador, java.util.Date dataFicha,
|
||||||
|
Object marcacoes[][], Vector links, Vector dados,
|
||||||
|
boolean perfilConsultas, boolean perfilExames )
|
||||||
|
{
|
||||||
|
int estado[] = new int[ 2 ];
|
||||||
|
int index = 0;
|
||||||
|
boolean pendente = false;
|
||||||
|
if( marcacoes.length == 0 )
|
||||||
|
{
|
||||||
|
estado[ 0 ] = perfilConsultas ? ESTADO_PENDENTE : ESTADO_NAO_APLICAVEL;
|
||||||
|
estado[ 1 ] = perfilExames ? ESTADO_PENDENTE : ESTADO_NAO_APLICAVEL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
java.util.Date dataConsulta;
|
||||||
|
java.util.Date dataExame;
|
||||||
|
index = -1;
|
||||||
|
for( ; index + 1 < marcacoes.length; index++ )
|
||||||
|
{
|
||||||
|
int n = index + 1;
|
||||||
|
dataConsulta = ( java.util.Date ) marcacoes[ n ][ 0 ];
|
||||||
|
dataExame = ( java.util.Date ) marcacoes[ n ][ 3 ];
|
||||||
|
boolean temConsulta = dataConsulta != null;
|
||||||
|
boolean consultaAntiga = temConsulta && dataConsulta.before( today );
|
||||||
|
boolean temExame = dataExame != null;
|
||||||
|
boolean exameAntigo = temExame && dataExame.before( today );
|
||||||
|
|
||||||
|
if( ( temConsulta && consultaAntiga && temExame && exameAntigo ) ||
|
||||||
|
( temConsulta && consultaAntiga && !temExame && !exameAntigo ) ||
|
||||||
|
( !temConsulta && !consultaAntiga && temExame && exameAntigo ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( index == -1 )
|
||||||
|
{
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
// else if( index < marcacoes.length - 1 )
|
||||||
|
// {
|
||||||
|
// index = 0;
|
||||||
|
// }
|
||||||
|
for( ; index < marcacoes.length; index++ )
|
||||||
|
{
|
||||||
|
dataConsulta = ( java.util.Date ) marcacoes[ index ][ 0 ];
|
||||||
|
dataExame = ( java.util.Date ) marcacoes[ index ][ 3 ];
|
||||||
|
boolean temConsulta = dataConsulta != null;
|
||||||
|
long diffConsulta = temConsulta ? dataConsulta.getTime() - today.getTime() : 0;
|
||||||
|
boolean temExame = dataExame != null;
|
||||||
|
long diffExame = temExame ? dataExame.getTime() - today.getTime() : 0;
|
||||||
|
if( ( temConsulta && diffConsulta < CATORZE_DIAS ) || ( temExame && diffExame < CATORZE_DIAS ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( index >= marcacoes.length )
|
||||||
|
{
|
||||||
|
index = marcacoes.length - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( marcacoes.length > 1 )
|
||||||
|
{
|
||||||
|
dataConsulta = ( java.util.Date ) marcacoes[ index ][ 0 ];
|
||||||
|
dataExame = ( java.util.Date ) marcacoes[ index ][ 3 ];
|
||||||
|
Calendar calToday = Calendar.getInstance();
|
||||||
|
calToday.setTime( today );
|
||||||
|
calToday.add( Calendar.YEAR, -2 );
|
||||||
|
if( ( dataConsulta != null && dataConsulta.before( calToday.getTime() ) )
|
||||||
|
|| ( dataConsulta == null && dataExame != null && dataExame.before( calToday.getTime() ) ) )
|
||||||
|
{
|
||||||
|
if( index > 0 )
|
||||||
|
{
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pendente = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataConsulta = ( java.util.Date ) marcacoes[ index ][ 0 ];
|
||||||
|
Integer estadoConsulta = ( Integer ) marcacoes[ index ][ 1 ];
|
||||||
|
Integer motivoConsulta = ( Integer ) marcacoes[ index ][ 2 ];
|
||||||
|
dataExame = ( java.util.Date ) marcacoes[ index ][ 3 ];
|
||||||
|
Integer estadoExame = ( Integer ) marcacoes[ index ][ 4 ];
|
||||||
|
if( perfilConsultas )
|
||||||
|
{
|
||||||
|
if( dataConsulta == null || pendente )
|
||||||
|
{
|
||||||
|
estado[ 0 ] = ESTADO_PENDENTE;
|
||||||
|
}
|
||||||
|
else if( estadoConsulta == null || estadoConsulta.intValue() != 2 )
|
||||||
|
{
|
||||||
|
estado[ 0 ] = ESTADO_MARCADO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
estado[ 0 ] = ESTADO_TRATADO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
estado[ 0 ] = ESTADO_NAO_APLICAVEL;
|
||||||
|
}
|
||||||
|
if( perfilExames )
|
||||||
|
{
|
||||||
|
if( dataExame == null || pendente )
|
||||||
|
{
|
||||||
|
if( motivoConsulta != null && motivoConsulta.intValue() != MOTIVO_OCASIONAL )
|
||||||
|
{
|
||||||
|
estado[ 1 ] = ESTADO_PENDENTE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
estado[ 1 ] = ESTADO_NAO_APLICAVEL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( estadoExame == null || estadoExame.intValue() != 2 )
|
||||||
|
{
|
||||||
|
estado[ 1 ] = ESTADO_MARCADO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
estado[ 1 ] = ESTADO_TRATADO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
estado[ 1 ] = ESTADO_NAO_APLICAVEL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( estado[ 0 ] == 1 || estado[ 0 ] == 2 ||
|
||||||
|
estado[ 1 ] == 1 || estado[ 1 ] == 2 )
|
||||||
|
{
|
||||||
|
links.add( "/"+servletName+"/?"+empresaID+"/"+estabelecimentoID+"/"+trabalhador.getID() );
|
||||||
|
HashMap dadosTrabalhador = new HashMap();
|
||||||
|
dadosTrabalhador.put( "Nome", trabalhador.toString() );
|
||||||
|
dadosTrabalhador.put( "Consulta", CORES_ESTADOS.get( new Integer( estado[ 0 ] ) ) );
|
||||||
|
Object text = TEXTOS_ESTADOS.get( new Integer( estado[ 0 ] ) );
|
||||||
|
dadosTrabalhador.put( "Consulta_estado", text != null ? text : marcacoes[ index ][ 0 ] );
|
||||||
|
dadosTrabalhador.put( "Exame", CORES_ESTADOS.get( new Integer( estado[ 1 ] ) ) );
|
||||||
|
text = TEXTOS_ESTADOS.get( new Integer( estado[ 1 ] ) );
|
||||||
|
dadosTrabalhador.put( "Exame_estado", text != null ? text : marcacoes[ index ][ 3 ] );
|
||||||
|
dados.add( dadosTrabalhador );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean perfilTemConsultas( Integer trabalhadorID, Integer empresaID )
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
Executer executer = getExecuter();
|
||||||
|
String query = "SELECT a_consultas, b_consultas FROM empresas WHERE id = " + empresaID;
|
||||||
|
Virtual2DArray array = executer.executeQuery( new Select( query ) );
|
||||||
|
boolean consultas[] = new boolean[]{ "y".equals( array.get( 0, 0 ) ), "n".equals( array.get( 0, 0 ) ) };
|
||||||
|
query = "SELECT perfil FROM trabalhadores WHERE id = " + trabalhadorID;
|
||||||
|
array = executer.executeQuery( new Select( query ) );
|
||||||
|
Integer perfil = ( Integer )array.get( 0, 0 );
|
||||||
|
if( perfil != null )
|
||||||
|
{
|
||||||
|
return consultas[ perfil.intValue() - 1 ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean perfilTemExames( Integer trabalhadorID, Integer empresaID )
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
Executer executer = getExecuter();
|
||||||
|
String query = "SELECT a_exames, b_exames FROM empresas WHERE id = " + empresaID;
|
||||||
|
Virtual2DArray array = executer.executeQuery( new Select( query ) );
|
||||||
|
boolean consultas[] = new boolean[]{ "y".equals( array.get( 0, 0 ) ), "n".equals( array.get( 0, 0 ) ) };
|
||||||
|
query = "SELECT perfil FROM trabalhadores WHERE id = " + trabalhadorID;
|
||||||
|
array = executer.executeQuery( new Select( query ) );
|
||||||
|
Integer perfil = ( Integer )array.get( 0, 0 );
|
||||||
|
if( perfil != null )
|
||||||
|
{
|
||||||
|
return consultas[ perfil.intValue() - 1 ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// protected boolean verificarTrabalhador( Object consultas[][], Object exames[][] )
|
||||||
|
// {
|
||||||
|
// boolean estadoConsultas = false;
|
||||||
|
// boolean estadoExames = ( exames.length == 0 ) || ( ( java.util.Date )exames[ 0 ][ 0 ] ).before(today) ||
|
||||||
|
// ( ( ( ( java.util.Date )exames[ 0 ][ 0 ] ).getTime() - todayMillis ) / 86400000 > 14 );
|
||||||
|
// if( consultas.length > 0 )
|
||||||
|
// {
|
||||||
|
// int anterior;
|
||||||
|
// int proxima;
|
||||||
|
// if( ( (java.util.Date) consultas[ 0 ][ 0 ] ).after( today ) )
|
||||||
|
// {
|
||||||
|
// proxima = 0;
|
||||||
|
// if( consultas.length >= 2 )
|
||||||
|
// {
|
||||||
|
// anterior = 1;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// anterior = -1;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// proxima = -1;
|
||||||
|
// anterior = 0;
|
||||||
|
// }
|
||||||
|
// estadoConsultas = anterior >= 0 && "y".equals( consultas[ anterior ][ 1 ] ) &&
|
||||||
|
// ( proxima == -1 || ( ( ( java.util.Date )consultas[ proxima ][ 0 ] ).getTime() - todayMillis ) / 86400000 > 14 );
|
||||||
|
// }
|
||||||
|
// return !(estadoConsultas && estadoExames);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// protected HashMap criarDadosTrabalhador( Integer id, String nome,
|
||||||
|
// Object consultas[][], Object exames[][] )
|
||||||
|
// throws Exception
|
||||||
|
// {
|
||||||
|
//// dbQuery.append( "SELECT id, nome, ( ultima_consulta IS NOT NULL AND realizada = 'y' ),"
|
||||||
|
//// + " ( ultimo_exame IS NOT NULL AND realizado = 'y' ),"
|
||||||
|
//// + " proxima_consulta IS NOT NULL, proximo_exame IS NOT NULL, "
|
||||||
|
//// + " ( proxima_consulta IS NOT NULL AND proxima_consulta - current_date <= 14 ), "
|
||||||
|
//// + " ( proximo_exame IS NOT NULL AND proximo_exame - current_date <= 14 )"
|
||||||
|
//// + " FROM trabalhadores "
|
||||||
|
//// + " WHERE estabelecimento_id = '"+estabelecimentoId+"'"
|
||||||
|
//// + " AND ( ultima_consulta IS NULL OR realizada = 'n' OR"
|
||||||
|
//// + " ( proxima_consulta IS NOT NULL AND proxima_consulta - current_date <= 14 )"
|
||||||
|
//// + " OR ( proximo_exame IS NOT NULL AND proximo_exame - current_date <= 14 ) )"
|
||||||
|
//// + " ORDER BY nome" );
|
||||||
|
// HashMap trabalhador = new HashMap();
|
||||||
|
// trabalhador.put( "Nome", nome );
|
||||||
|
// boolean uc = false;
|
||||||
|
// boolean ue = false;
|
||||||
|
// boolean pc = false;
|
||||||
|
// boolean pe = false;
|
||||||
|
// boolean quase_c = false;
|
||||||
|
// boolean quase_e = false;
|
||||||
|
// java.util.Date consultaAnterior = null;
|
||||||
|
// java.util.Date exameAnterior = null;
|
||||||
|
// if( consultas.length > 0 )
|
||||||
|
// {
|
||||||
|
// int anterior;
|
||||||
|
// int proxima;
|
||||||
|
// if( ( (java.util.Date) consultas[ 0 ][ 0 ] ).after( today ) )
|
||||||
|
// {
|
||||||
|
// proxima = 0;
|
||||||
|
// if( consultas.length >= 2 )
|
||||||
|
// {
|
||||||
|
// anterior = 1;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// anterior = -1;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// proxima = -1;
|
||||||
|
// anterior = 0;
|
||||||
|
// }
|
||||||
|
// long diff = proxima > -1 ? ( ( ( java.util.Date )consultas[ proxima ][ 0 ] ).getTime() - todayMillis ) / 86400000 : 15;
|
||||||
|
// uc = anterior > -1 && "y".equals( consultas[ anterior ][ 1 ] );
|
||||||
|
// if( uc )
|
||||||
|
// {
|
||||||
|
// consultaAnterior = ( java.util.Date ) consultas[ anterior ][ 0 ];
|
||||||
|
// }
|
||||||
|
// pc = proxima > -1;
|
||||||
|
// quase_c = pc && diff <= 14;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if( exames.length > 0 )
|
||||||
|
// {
|
||||||
|
// int anterior;
|
||||||
|
// int proximo;
|
||||||
|
// if( ( (java.util.Date) exames[ 0 ][ 0 ] ).after( today ) )
|
||||||
|
// {
|
||||||
|
// proximo = 0;
|
||||||
|
// if( exames.length >= 2 )
|
||||||
|
// {
|
||||||
|
// anterior = 1;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// anterior = -1;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// proximo = -1;
|
||||||
|
// anterior = 0;
|
||||||
|
// }
|
||||||
|
// long diff = proximo > -1 ? ( ( ( java.util.Date )exames[ proximo ][ 0 ] ).getTime() - todayMillis ) / 86400000 : 15;
|
||||||
|
// ue = anterior > -1 && "y".equals( exames[ anterior ][ 1 ] );
|
||||||
|
// if( ue )
|
||||||
|
// {
|
||||||
|
// exameAnterior = ( java.util.Date ) exames[ anterior ][ 0 ];
|
||||||
|
// }
|
||||||
|
// pe = proximo > -1;
|
||||||
|
// quase_e = pe && diff <= 14;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if( quase_c )
|
||||||
|
// {
|
||||||
|
// trabalhador.put( "Consulta", "yellow" );
|
||||||
|
// trabalhador.put( "Consulta_estado", "pendente" );
|
||||||
|
// }
|
||||||
|
// else if( uc )
|
||||||
|
// {
|
||||||
|
// trabalhador.put( "Consulta", "green" );
|
||||||
|
// trabalhador.put( "Consulta_estado", consultaAnterior );
|
||||||
|
// }
|
||||||
|
// else if( pc )
|
||||||
|
// {
|
||||||
|
// trabalhador.put( "Consulta", "yellow" );
|
||||||
|
// trabalhador.put( "Consulta_estado", "pendente" );
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// trabalhador.put( "Consulta", "red" );
|
||||||
|
// trabalhador.put( "Consulta_estado", "pendente" );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if( quase_e )
|
||||||
|
// {
|
||||||
|
// trabalhador.put( "Exame", "yellow" );
|
||||||
|
// trabalhador.put( "Exame_estado", "pendente" );
|
||||||
|
// }
|
||||||
|
// else if( ue )
|
||||||
|
// {
|
||||||
|
// trabalhador.put( "Exame", "green" );
|
||||||
|
// trabalhador.put( "Exame_estado", exameAnterior );
|
||||||
|
// }
|
||||||
|
// else if( pe )
|
||||||
|
// {
|
||||||
|
// trabalhador.put( "Exame", "yellow" );
|
||||||
|
// trabalhador.put( "Exame_estado", "pendente" );
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// trabalhador.put( "Exame", "red" );
|
||||||
|
// trabalhador.put( "Exame_estado", "pendente" );
|
||||||
|
// }
|
||||||
|
// return trabalhador;
|
||||||
|
// }
|
||||||
|
}
|
||||||
@ -0,0 +1,255 @@
|
|||||||
|
/*
|
||||||
|
* doGetListaTrabalhadoresTudo.java
|
||||||
|
*
|
||||||
|
* Created on 21 de Abril de 2005, 17:35
|
||||||
|
*/
|
||||||
|
|
||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.db.*;
|
||||||
|
import com.evolute.utils.sql.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fpalma
|
||||||
|
*/
|
||||||
|
public class doGetListaTrabalhadoresTudo
|
||||||
|
extends siprpServlet
|
||||||
|
implements GlobalConstants
|
||||||
|
{
|
||||||
|
protected java.util.Date today;
|
||||||
|
protected long todayMillis;
|
||||||
|
|
||||||
|
/** Creates a new instance of doGetListaTrabalhadores */
|
||||||
|
public doGetListaTrabalhadoresTudo(HttpServletRequest req, HttpServletResponse res, boolean print) throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
Connection con = null ;
|
||||||
|
Statement stmt = null ;
|
||||||
|
ResultSet2DArray rs;
|
||||||
|
StringBuffer dbQuery, sBuffer;
|
||||||
|
String userRole, empresaId, estabelecimentoId, temp;
|
||||||
|
HttpSession session = req.getSession(false);
|
||||||
|
Vector links = new Vector();
|
||||||
|
Vector desc = new Vector();
|
||||||
|
Vector descAdicional = new Vector();
|
||||||
|
today = new java.util.Date();
|
||||||
|
todayMillis = today.getTime();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userRole = (String)session.getAttribute(super.sessionUserRole);
|
||||||
|
empresaId = (String)session.getAttribute(super.sessionEmpresaId);
|
||||||
|
estabelecimentoId = (String)session.getAttribute(super.sessionEstabelecimentoId);
|
||||||
|
|
||||||
|
if ( userRole.equals ( super.superUserRole ) || userRole.equals ( empresaId ) )
|
||||||
|
{
|
||||||
|
Class.forName(super.bdDriver);
|
||||||
|
con = DriverManager.getConnection( bdLocalUrl, bdLocalUsername, bdLocalPassword );
|
||||||
|
if ( super.verificaEstabelecimento(con, empresaId, estabelecimentoId) ) // estabelecimento pertence à empresa ??
|
||||||
|
{
|
||||||
|
//Class.forName(super.bdDriver);
|
||||||
|
//con = DriverManager.getConnection( super.bdUrl, super.bdUsername, super.bdPassword );
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
// dbQuery.append( "SELECT id, nome, data_ficha FROM trabalhadores "
|
||||||
|
// + "WHERE estabelecimento_id = '"+estabelecimentoId+"'"
|
||||||
|
// + " AND ultima_consulta IS NOT NULL AND realizada = 'y' AND"
|
||||||
|
// + " ( proxima_consulta IS NULL OR proxima_consulta - current_date > 14 )"
|
||||||
|
// + " AND ( proximo_exame IS NULL OR proximo_exame - current_date > 14 )"
|
||||||
|
// + " ORDER BY nome" );
|
||||||
|
dbQuery.append( "SELECT trabalhadores.id, trabalhadores.nome, "
|
||||||
|
+ "marcacoes_trabalhador.tipo, marcacoes_trabalhador.data, marcacoes_trabalhador.estado, "
|
||||||
|
+ " trabalhadores.nome_plain "
|
||||||
|
+ "FROM trabalhadores, marcacoes_trabalhador "
|
||||||
|
+ "WHERE estabelecimento_id = " + estabelecimentoId
|
||||||
|
+ " AND marcacoes_trabalhador.trabalhador_id = trabalhadores.id "
|
||||||
|
+ " AND trabalhadores.inactivo <> 'y' AND data_demissao IS NULL "
|
||||||
|
+ "ORDER BY 6, 3, 4 DESC " );
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
|
||||||
|
int index=0;
|
||||||
|
int max = rs.columnLength();
|
||||||
|
|
||||||
|
Integer trabalhadorID = new Integer( -1 );
|
||||||
|
String nomeTrabalhador = "";
|
||||||
|
Vector consultas = new Vector();
|
||||||
|
Vector exames = new Vector();
|
||||||
|
|
||||||
|
for ( index = 0; index <= max; index++ )
|
||||||
|
{
|
||||||
|
Integer id = index < max ? ( Integer ) rs.get( index, 0 ) : new Integer( -1 );
|
||||||
|
if( !id.equals( trabalhadorID ) )
|
||||||
|
{
|
||||||
|
Object listaConsultas[][] = ( Object[][] ) consultas.toArray( new Object[consultas.size()][2] );
|
||||||
|
Object listaExames[][] = ( Object[][] ) exames.toArray( new Object[exames.size()][2] );
|
||||||
|
if( trabalhadorID.intValue() > -1 &&
|
||||||
|
verificarTrabalhador( listaConsultas, listaExames ) )
|
||||||
|
{
|
||||||
|
temp=""+rs.get(index - 1,0); // converter de int para String
|
||||||
|
java.util.Date dataUltimaConsulta = null;
|
||||||
|
for( int c = 0; c < listaConsultas.length; c++ )
|
||||||
|
{
|
||||||
|
if( new Integer( 2 ).equals( listaConsultas[ c ][ 1 ] ) )
|
||||||
|
{
|
||||||
|
dataUltimaConsulta = ( java.util.Date ) listaConsultas[ c ][ 0 ];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HashMap dadosTrabalhador = criarDadosTrabalhador( trabalhadorID, nomeTrabalhador, dataUltimaConsulta );
|
||||||
|
if( dadosTrabalhador != null )
|
||||||
|
{
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append("/"+super.servletName+"/?"+empresaId+"/"+estabelecimentoId+"/"+temp); // construir url
|
||||||
|
links.add(dbQuery.toString());
|
||||||
|
desc.add( dadosTrabalhador );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exames.clear();
|
||||||
|
consultas.clear();
|
||||||
|
}
|
||||||
|
if( index == max )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Integer tipo = ( Integer ) rs.get( index, 2 );
|
||||||
|
String nome = ( String ) rs.get( index, 1 );
|
||||||
|
java.util.Date data = ( java.util.Date ) rs.get( index, 3 );
|
||||||
|
Integer estado = ( Integer ) rs.get( index, 4 );
|
||||||
|
trabalhadorID = id;
|
||||||
|
nomeTrabalhador = nome;
|
||||||
|
Object marcacao[] = new Object[]{ data, estado };
|
||||||
|
switch( tipo.intValue() )
|
||||||
|
{
|
||||||
|
case TIPO_MARCACAO_EXAMES:
|
||||||
|
exames.add( marcacao );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TIPO_MARCACAO_CONSULTA:
|
||||||
|
consultas.add( marcacao );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
|
||||||
|
sBuffer = new StringBuffer();
|
||||||
|
sBuffer.append("<b>"+super.nomeEmpresa(con,empresaId)+"</b><br><br><i>"
|
||||||
|
+super.nomeEstabelecimento(con, estabelecimentoId)+"</i>" );
|
||||||
|
|
||||||
|
HashMap hmValues = new HashMap();
|
||||||
|
hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
||||||
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
||||||
|
hmValues.put( "estabelecimento_nome", super.nomeEstabelecimento( con, estabelecimentoId ) );
|
||||||
|
hmValues.put( "estabelecimento_id", estabelecimentoId );
|
||||||
|
hmValues.put( "userRole", userRole );
|
||||||
|
hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
||||||
|
hmValues.put( msgTemplate , sBuffer.toString() ) ;
|
||||||
|
hmValues.put( templateUserRole, userRole);
|
||||||
|
hmValues.put( templateQuery, "trabalhadores_tudo" );
|
||||||
|
hmValues.put( templateVector1,links);
|
||||||
|
hmValues.put( templateVector2,desc);
|
||||||
|
hmValues.put( templateVector3,null);
|
||||||
|
if( !print )
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserPrintTemplate));
|
||||||
|
}
|
||||||
|
// out.println( mergeTemplate( sBuffer.toString(), userRole, super.queryStringTrabalhadores, links, desc, null, super.authenticatedUserTemplate) );
|
||||||
|
}
|
||||||
|
else // est não pertence à empresa
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgLinkFormatError , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
else // Role não permite ver esta informação
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgAcessoNegado , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( SQLException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgErroBd , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgGenericError , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean verificarTrabalhador( Object consultas[][], Object exames[][] )
|
||||||
|
{
|
||||||
|
boolean estadoConsultas = false;
|
||||||
|
boolean estadoExames = ( exames.length == 0 ) || ( ( java.util.Date )exames[ 0 ][ 0 ] ).before(today) ||
|
||||||
|
( ( ( ( java.util.Date )exames[ 0 ][ 0 ] ).getTime() - todayMillis ) / 86400000 > 14 );
|
||||||
|
if( consultas.length > 0 )
|
||||||
|
{
|
||||||
|
int anterior;
|
||||||
|
int proxima;
|
||||||
|
if( ( (java.util.Date) consultas[ 0 ][ 0 ] ).after( today ) )
|
||||||
|
{
|
||||||
|
proxima = 0;
|
||||||
|
if( consultas.length >= 2 )
|
||||||
|
{
|
||||||
|
anterior = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
anterior = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
proxima = -1;
|
||||||
|
anterior = 0;
|
||||||
|
}
|
||||||
|
estadoConsultas = anterior >= 0 && new Integer( 2 ).equals( consultas[ anterior ][ 1 ] ) &&
|
||||||
|
( proxima == -1 || ( ( ( java.util.Date )consultas[ proxima ][ 0 ] ).getTime() - todayMillis ) / 86400000 > 14 );
|
||||||
|
}
|
||||||
|
return estadoConsultas && estadoExames;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected HashMap criarDadosTrabalhador( Integer id, String nome, java.util.Date ultimaConsulta )
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
Executer executer = getExecuter();
|
||||||
|
HashMap trabalhador = new HashMap();
|
||||||
|
trabalhador.put( "Nome", nome );
|
||||||
|
Select select =
|
||||||
|
new Select( new String[]{ "exames" }, new String[]{ "data" },
|
||||||
|
new Field( "trabalhador_id" ).isEqual( id ).and(
|
||||||
|
new Field( "data" ).isGreaterOrEqual( ultimaConsulta ) ),
|
||||||
|
new String[]{ "data" }, null );
|
||||||
|
|
||||||
|
// Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
// ResultSet2DArray rs = new ResultSet2DArray( stmt.executeQuery( select.toString() ) );
|
||||||
|
Virtual2DArray rs = executer.executeQuery( select );
|
||||||
|
Object data_ficha = rs.columnLength() > 0 ? rs.get( 0, 0 ) : null;
|
||||||
|
// stmt.close();
|
||||||
|
if( data_ficha == null )
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
// data_ficha = "";
|
||||||
|
}
|
||||||
|
trabalhador.put( "Data", data_ficha );
|
||||||
|
return trabalhador;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,324 @@
|
|||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
public class doGetTrabalhador extends siprpServlet
|
||||||
|
{
|
||||||
|
|
||||||
|
/** Creates a new instance of doGetTrabalhador */
|
||||||
|
public doGetTrabalhador(HttpServletRequest req, HttpServletResponse res) throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
Connection con = null ;
|
||||||
|
Statement stmt = null ;
|
||||||
|
ResultSet2DArray rs;
|
||||||
|
StringBuffer dbQuery, sBuffer;
|
||||||
|
String userRole, empresaId, estabelecimentoId, trabalhadorId, temp;
|
||||||
|
HttpSession session = req.getSession(false);
|
||||||
|
Vector names = new Vector();
|
||||||
|
Vector values = new Vector();
|
||||||
|
java.util.Date today = new java.util.Date();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
userRole = (String)session.getAttribute(super.sessionUserRole);
|
||||||
|
empresaId = (String)session.getAttribute(super.sessionEmpresaId);
|
||||||
|
estabelecimentoId = (String)session.getAttribute(super.sessionEstabelecimentoId);
|
||||||
|
trabalhadorId = (String)session.getAttribute(super.sessionTrabalhadorId);
|
||||||
|
|
||||||
|
Class.forName(super.bdDriver);
|
||||||
|
con = DriverManager.getConnection( bdLocalUrl, bdLocalUsername, bdLocalPassword );
|
||||||
|
|
||||||
|
if ( ( userRole.equals ( super.superUserRole ) || userRole.equals ( empresaId ) )
|
||||||
|
&& super.verificaEstabelecimento(con, empresaId, estabelecimentoId)
|
||||||
|
&& super.verificaTrabalhador(con, estabelecimentoId, trabalhadorId) )
|
||||||
|
{
|
||||||
|
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append( " SELECT sexo, categoria, data_nascimento, nome, numero_mecanografico "
|
||||||
|
+ "FROM trabalhadores where id='"+trabalhadorId+"'");
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
|
||||||
|
// int index=0;
|
||||||
|
// int max = super.trabalhadorDescFields.length;
|
||||||
|
|
||||||
|
HashMap hmFuncionario = new HashMap();
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
String tmp;
|
||||||
|
hmFuncionario.put( "sexo", rs.get( 0, "sexo" ) );
|
||||||
|
hmFuncionario.put( "categoria", rs.get( 0, "categoria" ) );
|
||||||
|
hmFuncionario.put( "data_nascimento", rs.get( 0, "data_nascimento" ) );
|
||||||
|
hmFuncionario.put( "nome", rs.get( 0, "nome" ) );
|
||||||
|
hmFuncionario.put( "numero", rs.get( 0, "numero_mecanografico" ) );
|
||||||
|
stmt.close();
|
||||||
|
|
||||||
|
String query = "SELECT id, data, estado, data_relatorio FROM marcacoes_trabalhador "
|
||||||
|
+ "WHERE tipo = 0 and trabalhador_id = " + trabalhadorId
|
||||||
|
+ " ORDER BY data DESC";
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( query ) );
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
java.util.Date dataExame2 = ( java.util.Date ) rs.get( 0, 1 );
|
||||||
|
Integer estado1;
|
||||||
|
Integer estado2 = ( Integer ) rs.get( 0, 2 );
|
||||||
|
java.util.Date dataExame1;
|
||||||
|
String realizado1 = "";
|
||||||
|
String realizado2 = "";
|
||||||
|
if( rs.columnLength() > 1 )
|
||||||
|
{
|
||||||
|
dataExame1 = ( java.util.Date ) rs.get( 1, 1 );
|
||||||
|
estado1 = ( Integer ) rs.get( 1, 2 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataExame1 = dataExame2;
|
||||||
|
estado1 = estado2;
|
||||||
|
}
|
||||||
|
if( ESTADO_REALIZADO.equals( estado2 ) || ESTADO_PARCIALMENTE_REALIZADO.equals( estado2 )
|
||||||
|
|| today.after( dataExame2 ) )
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "ultimo_exame", dataExame2 );
|
||||||
|
if( estado2.equals( ESTADO_REALIZADO ) || estado2.equals( ESTADO_PARCIALMENTE_REALIZADO ) )
|
||||||
|
{
|
||||||
|
realizado2 = "sim";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
realizado2 = "não";
|
||||||
|
}
|
||||||
|
hmFuncionario.put( "realizado", realizado2 );
|
||||||
|
hmFuncionario.put( "proximo_exame", null );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "proximo_exame", dataExame2 );
|
||||||
|
if( !dataExame2.equals( dataExame1 ) )
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "ultimo_exame", dataExame1 );
|
||||||
|
if( estado1.equals( ESTADO_REALIZADO ) || estado1.equals( ESTADO_PARCIALMENTE_REALIZADO ) )
|
||||||
|
{
|
||||||
|
realizado1 = "sim";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
realizado1 = "não";
|
||||||
|
}
|
||||||
|
hmFuncionario.put( "realizado", realizado1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "ultimo_exame", null );
|
||||||
|
hmFuncionario.put( "realizado", null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "ultimo_exame", null );
|
||||||
|
hmFuncionario.put( "realizado", null );
|
||||||
|
hmFuncionario.put( "proximo_exame", null );
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
|
||||||
|
query = "SELECT MAX(id) FROM exames WHERE trabalhador_id = " + trabalhadorId + " AND inactivo <> 'y'";
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( query ) );
|
||||||
|
Integer fichaId = null;
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
fichaId = ( Integer ) rs.get( 0, 0 );
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
|
||||||
|
if( fichaId != null )
|
||||||
|
{
|
||||||
|
query = "SELECT data, resultado FROM exames WHERE id = " + fichaId;
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( query ) );
|
||||||
|
Integer resultadoFicha = (Integer) rs.get( 0, 1 );
|
||||||
|
stmt.close();
|
||||||
|
if( resultadoFicha != null )
|
||||||
|
{
|
||||||
|
switch( resultadoFicha.intValue() )
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
hmFuncionario.put( "resultado", "Apto" );
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
hmFuncionario.put( "resultado", "Apto Condicionalmente" );
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
hmFuncionario.put( "resultado", "Inapto Temporariamente" );
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
hmFuncionario.put( "resultado", "Inapto Definitivamente" );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
hmFuncionario.put( "resultado", null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "resultado", null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "resultado", null );
|
||||||
|
}
|
||||||
|
|
||||||
|
query = "SELECT id, data, estado FROM marcacoes_trabalhador "
|
||||||
|
+ "WHERE tipo = 1 and trabalhador_id = " + trabalhadorId
|
||||||
|
+ " ORDER BY data DESC";
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( query ) );
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
java.util.Date dataConsulta2 = ( java.util.Date ) rs.get( 0, 1 );
|
||||||
|
Integer estado1;
|
||||||
|
Integer estado2 = ( Integer ) rs.get( 0, 2 );
|
||||||
|
java.util.Date dataConsulta1;
|
||||||
|
// java.util.Date dataRelatorio1;
|
||||||
|
// java.util.Date dataRelatorio2 = (java.util.Date) rs.get( 0, 3 );
|
||||||
|
String realizada1 = "";
|
||||||
|
String realizada2 = "";
|
||||||
|
if( rs.columnLength() >= 2 )
|
||||||
|
{
|
||||||
|
dataConsulta1 = ( java.util.Date ) rs.get( 1, 1 );
|
||||||
|
estado1 = ( Integer ) rs.get( 1, 2 );
|
||||||
|
// dataRelatorio1 = (java.util.Date) rs.get( 1, 3 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataConsulta1 = dataConsulta2;
|
||||||
|
estado1 = estado2;
|
||||||
|
// dataRelatorio1 = dataRelatorio2;
|
||||||
|
}
|
||||||
|
if( ESTADO_REALIZADO.equals( estado2 ) || today.after( dataConsulta2 ) )
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "ultima_consulta", dataConsulta2 );
|
||||||
|
if( estado2.equals( ESTADO_REALIZADO ) )
|
||||||
|
{
|
||||||
|
realizada2 = "sim";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
realizada2 = "não";
|
||||||
|
}
|
||||||
|
hmFuncionario.put( "realizada", realizada2 );
|
||||||
|
hmFuncionario.put( "proxima_consulta", null );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for( int c = 1; c < rs.columnLength(); c++ )
|
||||||
|
{
|
||||||
|
java.util.Date dataTemp = ( java.util.Date ) rs.get( c, 1 );
|
||||||
|
dataConsulta1 = dataTemp;
|
||||||
|
estado1 = ( Integer ) rs.get( c, 2 );
|
||||||
|
if( dataTemp.after( today ) )
|
||||||
|
{
|
||||||
|
dataConsulta2 = dataTemp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch( Exception ex )
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
hmFuncionario.put( "proxima_consulta", dataConsulta2 );
|
||||||
|
if( !dataConsulta2.equals( dataConsulta1 ) )
|
||||||
|
{
|
||||||
|
if( estado1.equals( ESTADO_REALIZADO ) )
|
||||||
|
{
|
||||||
|
realizada1 = "sim";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
realizada1 = "não";
|
||||||
|
}
|
||||||
|
hmFuncionario.put( "realizada", realizada1 );
|
||||||
|
hmFuncionario.put( "ultima_consulta", dataConsulta1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "ultima_consulta", null );
|
||||||
|
hmFuncionario.put( "realizada", null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hmFuncionario.put( "ultima_consulta", null );
|
||||||
|
hmFuncionario.put( "realizada", null );
|
||||||
|
hmFuncionario.put( "proxima_consulta", null );
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
sBuffer = new StringBuffer();
|
||||||
|
sBuffer.append("<b>"+super.nomeEmpresa(con,empresaId)+"</b><br><br><i>"
|
||||||
|
+super.nomeEstabelecimento(con, estabelecimentoId)+"</i>" );
|
||||||
|
|
||||||
|
HashMap hmValues = new HashMap();
|
||||||
|
hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
||||||
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
||||||
|
hmValues.put( "estabelecimento_nome", super.nomeEstabelecimento( con, estabelecimentoId ) );
|
||||||
|
|
||||||
|
/*Dados para marcacao de consulta/exame*/
|
||||||
|
session.setAttribute( "session_estabelecimento_nome", hmValues.get( "estabelecimento_nome" ) );
|
||||||
|
session.setAttribute( "session_funcionario_nome", hmFuncionario.get( "nome" ) );
|
||||||
|
session.setAttribute( "session_funcionario_numero", hmFuncionario.get( "numero" ) );
|
||||||
|
|
||||||
|
hmValues.put( "estabelecimento_id", estabelecimentoId );
|
||||||
|
hmValues.put( "userRole", userRole );
|
||||||
|
hmValues.put( "userName", session.getAttribute( sessionUser ) );
|
||||||
|
hmValues.put( msgTemplate , sBuffer.toString() ) ;
|
||||||
|
hmValues.put( templateUserRole, userRole);
|
||||||
|
hmValues.put( templateQuery, super.queryStringTrabalhador );
|
||||||
|
hmValues.put( "funcionario", hmFuncionario );
|
||||||
|
//hmValues.put( templateVector1,names);
|
||||||
|
//hmValues.put( templateVector2,values);
|
||||||
|
//hmValues.put( templateVector3,null);
|
||||||
|
out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
||||||
|
|
||||||
|
// out.println( mergeTemplate( sBuffer.toString(), userRole, super.queryStringTrabalhador, names, values, null, super.authenticatedUserTemplate) );
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( super.msgLinkFormatError , userRole, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
catch ( SQLException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgErroBd , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( super.msgGenericError , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,122 @@
|
|||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
public class doPostLogin extends siprpServlet
|
||||||
|
{
|
||||||
|
|
||||||
|
/** Creates a new instance of doPostLogin */
|
||||||
|
public doPostLogin(HttpServletRequest req, HttpServletResponse res) throws IOException
|
||||||
|
{
|
||||||
|
System.out.println( "doPostLogin()" );
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
StringBuffer dbQuery;
|
||||||
|
ResultSet2DArray rs;
|
||||||
|
Connection con = null ;
|
||||||
|
Statement stmt = null ;
|
||||||
|
String user, userRole, password;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
user = req.getParameter("user");
|
||||||
|
password = req.getParameter("password");
|
||||||
|
|
||||||
|
if (user.equals(""))
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( msgErroNoUser, errorTemplate) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Class.forName(bdDriver);
|
||||||
|
con = DriverManager.getConnection( bdUrl, bdUsername, bdPassword );
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append( "SELECT password FROM users WHERE username = '"+user+"'");
|
||||||
|
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
|
||||||
|
|
||||||
|
if ( rs.columnLength() > 0 && password.equals((String)rs.get(0,0)))
|
||||||
|
{
|
||||||
|
// Obter Role
|
||||||
|
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append( "SELECT role FROM roles WHERE username = '"+user+"'");
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
userRole = (String)rs.get(0,0);
|
||||||
|
|
||||||
|
// UPDATE HTTP SESSION
|
||||||
|
HttpSession session = req.getSession(true);
|
||||||
|
session.setMaxInactiveInterval(sessionTimeout);
|
||||||
|
|
||||||
|
session.setAttribute(sessionUser, user);
|
||||||
|
session.setAttribute(sessionUserRole, userRole);
|
||||||
|
session.setAttribute(sessionPassword, password);
|
||||||
|
|
||||||
|
HashMap hmValues = new HashMap();
|
||||||
|
session.setAttribute( sessionEmpresaId, userRole );
|
||||||
|
if( userRole.equals( "manager" ) )
|
||||||
|
{
|
||||||
|
// session.setAttribute( sessionCompanyName, nomeEmpresa( con, "" + session.getAttribute( sessionEmpresaId ) ) );
|
||||||
|
session.setAttribute( sessionCompanyName, null );
|
||||||
|
session.setAttribute( sessionEstabelecimentoId, null );
|
||||||
|
//hmValues.put( templateQuery, super.queryStringEmpresas );
|
||||||
|
new doGetListaEmpresas( req, res );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
session.setAttribute( sessionCompanyName,
|
||||||
|
nomeEmpresa( DriverManager.getConnection( bdLocalUrl, bdLocalUsername, bdLocalPassword ),
|
||||||
|
userRole ) );
|
||||||
|
session.setAttribute( sessionEstabelecimentoId, "-1" );
|
||||||
|
//hmValues.put( templateQuery, super.queryStringEstabelecimentos );
|
||||||
|
new doGetListaEstabelecimentos( req, res );
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
con.close();
|
||||||
|
|
||||||
|
hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
|
||||||
|
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
|
||||||
|
hmValues.put( "estabelecimento_id", session.getAttribute( sessionEstabelecimentoId ) );
|
||||||
|
hmValues.put( "userRole", userRole );
|
||||||
|
hmValues.put( "userName", user );
|
||||||
|
//out.println( mergeTemplate( hmValues, super.authenticatedUserTemplate));
|
||||||
|
|
||||||
|
//out.println( mergeTemplate( user, userRole, super.authenticatedUserTemplate));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( msgErroAuthFail, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch ( SQLException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( msgErroBd , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( IllegalStateException e ) // session timeout
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate(msgSessionTimeout, super.errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( msgGenericError , super.errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,648 @@
|
|||||||
|
package siprp.pagina;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import org.apache.velocity.*;
|
||||||
|
import org.apache.velocity.app.*;
|
||||||
|
|
||||||
|
import com.evolute.utils.*;
|
||||||
|
import com.evolute.utils.arrays.*;
|
||||||
|
import com.evolute.utils.db.*;
|
||||||
|
import com.evolute.utils.sql.*;
|
||||||
|
import com.evolute.utils.strings.*;
|
||||||
|
|
||||||
|
public class siprpServlet extends HttpServlet
|
||||||
|
implements GlobalConstants
|
||||||
|
{
|
||||||
|
// MSG
|
||||||
|
public static final String msgErroNoUser = "Tem+de+especificar+um+utilizador.";
|
||||||
|
public static final String msgErroAuthFail = "Utilizador+inexistente+e/ou+Password+errada.";
|
||||||
|
public static final String msgErroBd = "Erro+na+ligaç&atiolde;o+à+base+de+dados.";
|
||||||
|
public static final String msgGenericError = "Erro";
|
||||||
|
public static final String msgListaEmpresas = "Empresas";
|
||||||
|
public static final String msgAcessoNegado = "Acesso+Negado.";
|
||||||
|
public static final String msgLinkFormatError ="URL+inválido.";
|
||||||
|
public static final String msgLogin = "Login";
|
||||||
|
public static final String msgNovaPasswordErrada="Erro+ao+criar+a+nova+password,+nova+password+inválida.";
|
||||||
|
public static final String msgButtonNotSuported = "funcionalidade+ainda+não+suportada.";
|
||||||
|
public static final String msgSessionTimeout = "Por+razões+de+segurança+o+tempo+da+sua+sessão+expirou<br>"
|
||||||
|
+ "Por+favor+efectue+novamente+o+seu+login.<br>";
|
||||||
|
|
||||||
|
// Templates - Nomes e valores
|
||||||
|
//public static final String loginTemplate = "login.html";
|
||||||
|
|
||||||
|
public static final String indexTemplate = "index.html";
|
||||||
|
public static final String authenticatedUserTemplate = "user.html";
|
||||||
|
public static final String authenticatedUserPrintTemplate = "user_print.html";
|
||||||
|
public static final String errorTemplate = "frame_erro.html";
|
||||||
|
public static final String innerErrorTemplate = "erro.html";
|
||||||
|
|
||||||
|
public static final String mainTemplate = "main.html";
|
||||||
|
//public static final String criticalErrorTemplate = "critical.html";
|
||||||
|
public static final String templateVector1 ="v1";
|
||||||
|
public static final String templateVector2 ="v2";
|
||||||
|
public static final String templateVector3 ="v3";
|
||||||
|
public static final String templateUserRole ="userRole";
|
||||||
|
public static final String msgTemplate ="msg";
|
||||||
|
public static final String templateQuery ="query";
|
||||||
|
public static final String buttonPressedTemplate ="buttonPressed";
|
||||||
|
|
||||||
|
// Query Strings , usadas para na template do velocity saber o que mostar
|
||||||
|
public static final String queryStringErro = "erro";
|
||||||
|
public static final String queryStringEmpresas = "empresas";
|
||||||
|
public static final String queryStringEstabelecimentos="estabelecimentos";
|
||||||
|
public static final String queryStringTrabalhadores ="trabalhadores";
|
||||||
|
public static final String queryStringTrabalhador ="trabalhador";
|
||||||
|
|
||||||
|
//Botoes, saber qual o botao escholido, campo value dos forms
|
||||||
|
public static final String botaoLogin = "Entrar";
|
||||||
|
public static final String botaoMarcarProximoExame = "Marcar Exame";
|
||||||
|
|
||||||
|
// Var da Session
|
||||||
|
public static final String sessionUser="user";
|
||||||
|
public static final String sessionUserRole="userRole";
|
||||||
|
public static final String sessionPassword="password";
|
||||||
|
public static final String sessionEmpresaId="empresaId";
|
||||||
|
public static final String sessionEstabelecimentoId="estabelecimentoId";
|
||||||
|
public static final String sessionTrabalhadorId="trabalhadorId";
|
||||||
|
public static final String sessionCompanyName = "sessionCompanyName";
|
||||||
|
public static final String sessionCompanyEmail = "sessionCompanyEmail";
|
||||||
|
public static final int sessionTimeout = 3600; // segundos
|
||||||
|
|
||||||
|
public static final String servletName="siprpWeb";
|
||||||
|
public static final String superUserRole="manager";
|
||||||
|
|
||||||
|
// // BD
|
||||||
|
// public static final String bdHost = "127.0.0.1";
|
||||||
|
// public static final String bdPort = "5436";
|
||||||
|
// public static final String bdUsername = "siprp";
|
||||||
|
// public static final String bdPassword = "";
|
||||||
|
// public static final String bdDriver = "org.postgresql.Driver";
|
||||||
|
// public static final String bdUrl = "jdbc:postgresql://" + bdHost + ":" + bdPort + "/siprp";
|
||||||
|
|
||||||
|
public static final String bdEmpresaIdRef = "id"; // campo que contem id da empresa
|
||||||
|
public static final String bdEmpresaNomeRef = "designacao_social"; // campo que contem nome da empresa
|
||||||
|
public static final String bdEstIdRef = "id"; // campo que contem nome do estabelecimento
|
||||||
|
public static final String bdEstNomeRef = "nome"; // campo que contem nome do estabelecimento
|
||||||
|
public static final String bdTrabIdRef = "id"; // campo que contem id do trabalhador
|
||||||
|
public static final String bdTrabNomeRef = "nome"; // campo que contem nome do trabalhador
|
||||||
|
public static final String bdNullString = ""; // String a mostrar quando o campo lido da BD é null
|
||||||
|
public static final String bdEmailEmpresa = "email"; // campo que contem email da empresa
|
||||||
|
|
||||||
|
protected static ServletContext CONTEXT;
|
||||||
|
|
||||||
|
// Arrays
|
||||||
|
public static final String[][] trabalhadorDescFields = new String [][]
|
||||||
|
{ // nome que o user ve, nome do campo na tabela
|
||||||
|
{"Nome", "nome"},
|
||||||
|
{"Nº", "numero_mecanografico",},
|
||||||
|
{"\u00DAltimo Exame", "ultimo_exame"},
|
||||||
|
{"Realizado", "realizado"},
|
||||||
|
{"Pr\u00F3ximo Exame", "proximo_exame"},
|
||||||
|
{"\u00DAltima Consulta", "ultima_consulta"},
|
||||||
|
{"Realizada", "realizada"},
|
||||||
|
{"Pr\u00F3xima Consulta", "proxima_consulta"}
|
||||||
|
};
|
||||||
|
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
|
||||||
|
try {
|
||||||
|
CONTEXT = this.getServletContext();
|
||||||
|
String TEMPLATE_DIR = this.getServletContext().getRealPath( "/" ) + "html/";
|
||||||
|
System.out.println( "DIR: " + TEMPLATE_DIR );
|
||||||
|
Properties props = new Properties();
|
||||||
|
props.setProperty( "file.resource.loader.path", TEMPLATE_DIR );
|
||||||
|
Velocity.init( props );
|
||||||
|
Class.forName(bdDriver);
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doGet( HttpServletRequest req, HttpServletResponse res )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
String queryString = req.getQueryString();
|
||||||
|
String backUri = req.getRequestURI();
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
res.setContentType( "text/html" );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
System.out.println( "query: " + queryString );
|
||||||
|
HttpSession session = req.getSession(true);
|
||||||
|
session.setMaxInactiveInterval(sessionTimeout);
|
||||||
|
|
||||||
|
if ( queryString == null ) // Reload, 1º vez, etc ...
|
||||||
|
{
|
||||||
|
session.invalidate();
|
||||||
|
out.println( mergeTemplate ( msgLogin, indexTemplate ) ) ;
|
||||||
|
}
|
||||||
|
else if ( session.isNew() && !( queryString.indexOf(queryStringErro) == 0 ) ) // session timeout
|
||||||
|
{
|
||||||
|
session.invalidate();
|
||||||
|
out.println( mergeTemplate( msgGenericError , errorTemplate ) );
|
||||||
|
// doErro(queryString, out);
|
||||||
|
}
|
||||||
|
else if ( queryString.equals(queryStringEmpresas) ) // Listar Empresas
|
||||||
|
{
|
||||||
|
new doGetListaEmpresas(req,res);
|
||||||
|
}
|
||||||
|
else if ( queryString.indexOf(queryStringErro) == 0 ) // Listar Empresas
|
||||||
|
{
|
||||||
|
// System.out.println( "entrou" );
|
||||||
|
doErro(queryString, out);
|
||||||
|
}
|
||||||
|
else // interpretar query string
|
||||||
|
{
|
||||||
|
String empresa = null, estabelecimento=null, trabalhador=null;
|
||||||
|
String query = null;
|
||||||
|
int checkInt;
|
||||||
|
|
||||||
|
StringTokenizer sToken = new StringTokenizer(queryString,"/") ;
|
||||||
|
empresa = sToken.nextToken(); // empresa ID
|
||||||
|
checkInt = Integer.parseInt(empresa); // check int, NumberFormatException
|
||||||
|
|
||||||
|
if (sToken.hasMoreElements())
|
||||||
|
{
|
||||||
|
estabelecimento = sToken.nextToken(); // estabelecimento ID
|
||||||
|
checkInt = Integer.parseInt(estabelecimento); // check int, NumberFormatException
|
||||||
|
if (sToken.hasMoreElements())
|
||||||
|
{
|
||||||
|
trabalhador = sToken.nextToken(); // trabalhador ID
|
||||||
|
try
|
||||||
|
{
|
||||||
|
checkInt = Integer.parseInt(trabalhador); // check int, NumberFormatException
|
||||||
|
}
|
||||||
|
catch( NumberFormatException nfex )
|
||||||
|
{
|
||||||
|
query = trabalhador;
|
||||||
|
if( query.indexOf( "trabalhadores_tudo" ) != 0 && query.indexOf( "trabalhadores_pendentes" ) != 0 &&
|
||||||
|
query.indexOf( "_print" ) == -1 )
|
||||||
|
{
|
||||||
|
throw nfex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( estabelecimento == null ) // empresa query
|
||||||
|
{
|
||||||
|
session.setAttribute(sessionEmpresaId, empresa); // update HTTP Session
|
||||||
|
|
||||||
|
new doGetListaEstabelecimentos(req,res);
|
||||||
|
|
||||||
|
//out.println( mergeTemplate ( empresa, loginTemplate ) ) ;
|
||||||
|
}
|
||||||
|
else if ( trabalhador == null || query != null ) // estabelecimento query
|
||||||
|
{
|
||||||
|
session.setAttribute(sessionEmpresaId, empresa); // update HTTP Session
|
||||||
|
session.setAttribute(sessionEstabelecimentoId, estabelecimento);
|
||||||
|
|
||||||
|
new doGetListaTrabalhadores(req,res, query);
|
||||||
|
|
||||||
|
//out.println( mergeTemplate ( " chama oGetListaTrabalhadores", loginTemplate ) ) ;
|
||||||
|
}
|
||||||
|
else // trabalhador query
|
||||||
|
{
|
||||||
|
session.setAttribute(sessionEmpresaId, empresa); // update HTTP Session
|
||||||
|
session.setAttribute(sessionEstabelecimentoId, estabelecimento);
|
||||||
|
session.setAttribute(sessionTrabalhadorId, trabalhador);
|
||||||
|
|
||||||
|
new doGetTrabalhador(req,res);
|
||||||
|
|
||||||
|
//out.println( mergeTemplate ( trabalhador, loginTemplate ) ) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( NumberFormatException e ) // argumentos invalidos
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( msgLinkFormatError, backUri, errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( IllegalStateException e ) // session timeout
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate(msgSessionTimeout, errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
// out.println( mergeTemplate( msgGenericError , backUri, errorTemplate ) );
|
||||||
|
out.println( mergeTemplate( msgGenericError , errorTemplate ) );
|
||||||
|
}
|
||||||
|
// System.out.println( "fim - " + queryString + " bu " + backUri );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doPost(HttpServletRequest req, HttpServletResponse res)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
//StringBuffer dbQuery;
|
||||||
|
//ResultSet2DArray rs;
|
||||||
|
//Connection con = null ;
|
||||||
|
//Statement stmt = null ;
|
||||||
|
//String user, userRole, password;
|
||||||
|
String buttonPressed = req.getParameter("form");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if ( buttonPressed.equals(botaoLogin))
|
||||||
|
{
|
||||||
|
new doPostLogin(req,res);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( msgButtonNotSuported, errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*catch ( SQLException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( msgErroBd , criticalErrorTemplate) );
|
||||||
|
}*/
|
||||||
|
catch ( IllegalStateException e ) // session timeout
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate(msgSessionTimeout, errorTemplate) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
out.println( mergeTemplate( msgGenericError , errorTemplate) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String mergeTemplate( HashMap values, String template )
|
||||||
|
{
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for( Iterator i = values.keySet().iterator(); i.hasNext(); )
|
||||||
|
{
|
||||||
|
String key = ( String ) i.next();
|
||||||
|
context.put ( key, values.get( key ) ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
Velocity.mergeTemplate(template, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String mergeTemplate (String msg, String template ) // #1
|
||||||
|
{
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
context.put ( msgTemplate , msg ) ;
|
||||||
|
Velocity.mergeTemplate(template, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String mergeTemplate (String msg, String userRole, String template ) // #1
|
||||||
|
{
|
||||||
|
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
context.put ( msgTemplate , msg ) ;
|
||||||
|
context.put ( templateUserRole, userRole);
|
||||||
|
Velocity.mergeTemplate(template, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String mergeTemplate ( String msg, String userRole, String querySelected, Vector vector1, Vector vector2, Vector vector3, String template ) // #2
|
||||||
|
{
|
||||||
|
|
||||||
|
VelocityContext context = new VelocityContext();
|
||||||
|
StringWriter output = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
context.put ( msgTemplate , msg ) ;
|
||||||
|
context.put ( templateUserRole, userRole);
|
||||||
|
context.put ( templateQuery, querySelected );
|
||||||
|
context.put ( templateVector1,vector1);
|
||||||
|
context.put ( templateVector2,vector2);
|
||||||
|
context.put ( templateVector3,vector3);
|
||||||
|
Velocity.mergeTemplate(template, Velocity.ENCODING_DEFAULT, context, output );
|
||||||
|
return output.toString();
|
||||||
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void destroy()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handleSessionTimeout(HttpServletResponse res, String template)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
ServletOutputStream out = res.getOutputStream();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
out.println( mergeTemplate( msgSessionTimeout, template) );
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean verificaEstabelecimento(Connection con, java.lang.String empresaId, java.lang.String estabelecimentoId)
|
||||||
|
// verifica se o establecimento pertence à empresa
|
||||||
|
{
|
||||||
|
//Connection con = null ;
|
||||||
|
Statement stmt = null ;
|
||||||
|
Virtual2DArray rs;
|
||||||
|
String query;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//con = DriverManager.getConnection( bdUrl, bdUsername, bdPassword );
|
||||||
|
query = "SELECT empresa_id FROM estabelecimentos where id='"+estabelecimentoId+"'";
|
||||||
|
if( con != null )
|
||||||
|
{
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( query ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rs = getExecuter().executeQuery( new Select( query ) );
|
||||||
|
}
|
||||||
|
String temp=""+rs.get(0,0); // converter de int para String
|
||||||
|
if( con != null )
|
||||||
|
{
|
||||||
|
stmt.close();
|
||||||
|
}
|
||||||
|
if ( empresaId.equals(temp) ) // estabelecimento pertence à empresa
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean verificaTrabalhador(Connection con, java.lang.String estabelecimentoId, java.lang.String trabalhadorId)
|
||||||
|
// verifica se o trabalhador pertence ao estabelecimento
|
||||||
|
{
|
||||||
|
//Connection con = null ;
|
||||||
|
Statement stmt = null ;
|
||||||
|
ResultSet2DArray rs;
|
||||||
|
StringBuffer dbQuery;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//con = DriverManager.getConnection( bdUrl, bdUsername, bdPassword );
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append( "SELECT estabelecimento_id FROM trabalhadores where id='"+trabalhadorId+"'");
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
String temp=""+rs.get(0,0); // converter de int para String
|
||||||
|
stmt.close();
|
||||||
|
if ( estabelecimentoId.equals(temp) ) // estabelecimento pertence à empresa
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void closeSqlCon(Connection con)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (con != null ) con.close();
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String emailEmpresa(Connection con, String empresaId)
|
||||||
|
{
|
||||||
|
Statement stmt = null ;
|
||||||
|
ResultSet2DArray rs;
|
||||||
|
StringBuffer dbQuery;
|
||||||
|
String returnString;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append( "SELECT email FROM empresas, contactos "
|
||||||
|
+ "WHERE empresas.id ='"+empresaId+"' AND empresas.contacto_1 = contactos.id");
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
returnString = (String)rs.get(0,0);
|
||||||
|
stmt.close();
|
||||||
|
return returnString;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String nomeEmpresa(Connection con, String empresaId)
|
||||||
|
{
|
||||||
|
Statement stmt = null ;
|
||||||
|
Virtual2DArray rs;
|
||||||
|
String returnString;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String query = "SELECT designacao_social FROM empresas WHERE id ='"+empresaId+"'";
|
||||||
|
if( con != null )
|
||||||
|
{
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( query ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rs = getExecuter().executeQuery( new Select( query ) );
|
||||||
|
}
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
returnString = (String)rs.get(0,0);
|
||||||
|
if( con != null )
|
||||||
|
{
|
||||||
|
stmt.close();
|
||||||
|
}
|
||||||
|
return returnString;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String nomeEstabelecimento(Connection con, java.lang.String estabelecimentoId)
|
||||||
|
{
|
||||||
|
Statement stmt = null ;
|
||||||
|
Virtual2DArray rs;
|
||||||
|
StringBuffer dbQuery;
|
||||||
|
String returnString;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String query = "SELECT nome FROM estabelecimentos WHERE id ='"+estabelecimentoId+"'";
|
||||||
|
if( con != null )
|
||||||
|
{
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( query ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rs = getExecuter().executeQuery( new Select( query ) );
|
||||||
|
}
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
returnString = (String)rs.get(0,0);
|
||||||
|
if( con != null )
|
||||||
|
{
|
||||||
|
stmt.close();
|
||||||
|
}
|
||||||
|
return returnString;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String nomeTrabalhador(Connection con, java.lang.String trabalhadorId)
|
||||||
|
{
|
||||||
|
Statement stmt = null ;
|
||||||
|
ResultSet2DArray rs;
|
||||||
|
StringBuffer dbQuery;
|
||||||
|
String returnString;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dbQuery = new StringBuffer();
|
||||||
|
dbQuery.append( "SELECT nome FROM trabalhadores where id='"+trabalhadorId+"'");
|
||||||
|
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||||
|
rs = new ResultSet2DArray( stmt.executeQuery( dbQuery.toString()) );
|
||||||
|
if( rs.columnLength() > 0 )
|
||||||
|
{
|
||||||
|
returnString = (String)rs.get(0,0);
|
||||||
|
stmt.close();
|
||||||
|
return returnString;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( Exception e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doErro( String queryString, ServletOutputStream out )
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
String split[] = queryString.split( "=" );
|
||||||
|
String err;
|
||||||
|
if( split.length > 1 )
|
||||||
|
{
|
||||||
|
err = split[ 1 ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
err = "Erro";
|
||||||
|
}
|
||||||
|
err = err.replace( '+', ' ' );
|
||||||
|
out.println( mergeTemplate( err, innerErrorTemplate) );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Executer getExecuter()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
ServletContext context = CONTEXT;
|
||||||
|
DBManager dbm = ( DBManager ) context.getAttribute( Singleton.DEFAULT_DBMANAGER );
|
||||||
|
if( dbm == null )
|
||||||
|
{
|
||||||
|
dbm = new JDBCManager( bdLocalUrl, bdLocalUsername, bdLocalPassword , 500, 499, 1, null );
|
||||||
|
context.setAttribute( Singleton.DEFAULT_DBMANAGER, dbm );
|
||||||
|
}
|
||||||
|
return dbm.getSharedExecuter();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
|
||||||
|
<!DOCTYPE web-app
|
||||||
|
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||||
|
"http://java.sun.com/dtd/web-app_2_3.dtd">
|
||||||
|
|
||||||
|
<web-app>
|
||||||
|
<display-name>SIPRP WEB</display-name>
|
||||||
|
<description>SIPRP WEB</description>
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>SIPRP WEB</servlet-name>
|
||||||
|
<servlet-class>siprp.pagina.siprpServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>SIPRP WEB</servlet-name>
|
||||||
|
<url-pattern>/index.html</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>Request</servlet-name>
|
||||||
|
<servlet-class>siprp.pagina.RequestServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>Request</servlet-name>
|
||||||
|
<url-pattern>/request</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>Schedule</servlet-name>
|
||||||
|
<servlet-class>siprp.pagina.ScheduleServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>Schedule</servlet-name>
|
||||||
|
<url-pattern>/schedule</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>Relatorio</servlet-name>
|
||||||
|
<servlet-class>siprp.pagina.RelatorioServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>Relatorio</servlet-name>
|
||||||
|
<url-pattern>/relatorio</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
</web-app>
|
||||||
|
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body style='background-color: transparent'>
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;"> os
|
||||||
|
nossos clientes</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;">em
|
||||||
|
desenvolvimento...<br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Colaboradores</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style='background-color: transparent'>
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;"> colaboradores</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;"><iframe
|
||||||
|
name="_ifrm" src="conteudos/colaboradores_text.html" marginwidth="0"
|
||||||
|
marginheight="0" allowtransparency="true" frameborder="0" height="277"
|
||||||
|
width="100%"></iframe><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Apresentação</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style="background-color: transparent;">
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;">
|
||||||
|
contactos<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;"><iframe
|
||||||
|
name="_ifrm" src="conteudos/contactos_text.html" marginwidth="0"
|
||||||
|
marginheight="0" allowtransparency="true" frameborder="0" height="277"
|
||||||
|
width="100%"></iframe><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<script language="javascript" src="../css/funcs.js"></script>
|
||||||
|
<title>SIPRP - Apresentação</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
Área reservada a colaboradores da SIPRP.<br>
|
||||||
|
Esta página dá acesso a funcionalidades exclusivas e confidenciais.<br>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
Acesso ao <a href="http://www.siprp.pt/webmail" target="_blank">webmail SIPRP</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<span id='span_recrut_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('recrut_id')">Junte-se a Nós</span><br>
|
||||||
|
<br>
|
||||||
|
<div id='recrut_id' style="display: none">
|
||||||
|
<form method='post' action='/siprpWeb/recruit' name='recrutamento' id='recrutamento' enctype='multipart/form-data'>
|
||||||
|
<table border='0' class='text'>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Função*:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select name='rec_funcao' id='rec_funcao'>
|
||||||
|
<option VALUE='Técnico de Higiene e Segurança'>Técnico de Higiene e Segurança</option>
|
||||||
|
<option VALUE='Técnico Superior de Higiene e Segurança'>Técnico Superior de Higiene e Segurança</option>
|
||||||
|
<option VALUE='Médico do Trabalho'>Médico do Trabalho</option>
|
||||||
|
<option VALUE='Médico Curativa'>Médico Curativa</option>
|
||||||
|
<option VALUE='Enfermeiro'>Enfermeiro</option>
|
||||||
|
<option VALUE='Outros' SELECTED>Outros</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Nome Completo*:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='text' id='rec_nome' name='rec_nome' size='50'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Morada:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='text' id='rec_morada' name='rec_morada' size='50'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Telefone*:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='text' id='rec_telefone' name='rec_telefone' size='10'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
E-Mail*:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='text' id='rec_email' name='rec_email' size='30'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
C.V.:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='file' id='rec_cv' name='rec_cv'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td align='right'>
|
||||||
|
<table border='0'>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type='reset' value='Limpar'>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='submit' value='Enviar' onclick='return validateForm()'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
* Campos de preenchimento obrigatório
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Apresentação</title>
|
||||||
|
</head>
|
||||||
|
<script language="javascript" src="../css/funcs.js"></script>
|
||||||
|
<script language="javascript">
|
||||||
|
function isValidEmail( email )
|
||||||
|
{
|
||||||
|
var pattern=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
|
||||||
|
return pattern.test( email );
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_info_request()
|
||||||
|
{
|
||||||
|
form_is_valid = true;
|
||||||
|
error_fields = "";
|
||||||
|
|
||||||
|
if( document.request_form.request_name.value.length == 0 )
|
||||||
|
{
|
||||||
|
error_fields += "- Nome\n";
|
||||||
|
form_is_valid = false;
|
||||||
|
}
|
||||||
|
if( document.request_form.request_phone.value.length == 0 )
|
||||||
|
{
|
||||||
|
error_fields += "- Telefone\n";
|
||||||
|
form_is_valid = false;
|
||||||
|
}
|
||||||
|
if( document.request_form.request_email.value.length == 0 )
|
||||||
|
{
|
||||||
|
error_fields += "- e-mail\n";
|
||||||
|
form_is_valid = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( ! isValidEmail( document.request_form.request_email.value ) )
|
||||||
|
{
|
||||||
|
alert( "e-mail inválido." );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( document.request_form.request_details.value.length == 0 )
|
||||||
|
{
|
||||||
|
error_fields += "- Assunto\n";
|
||||||
|
form_is_valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! form_is_valid )
|
||||||
|
{
|
||||||
|
alert( "É necessário preencher os campos seguintes:\n" + error_fields );
|
||||||
|
}
|
||||||
|
|
||||||
|
return form_is_valid;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
SIPRP – Sociedade Ibérica de Prevenção de Riscos
|
||||||
|
Profissionais<br>
|
||||||
|
<br>
|
||||||
|
Edifício Atrium Saldanha<br>
|
||||||
|
Praça Duque de Saldanha, 1 –
|
||||||
|
9º G<br>
|
||||||
|
1050 – 094 Lisboa<br>
|
||||||
|
<br>
|
||||||
|
Telefone: 21 350 45 40<br>
|
||||||
|
Fax: 21 350 45 49<br>
|
||||||
|
E-mail: <a href='mailto:geral@siprp.pt'>geral@siprp.pt</a><br>
|
||||||
|
<br>
|
||||||
|
<div style="text-align: left;">
|
||||||
|
<span id='span_info_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('info_id')">Pedir mais informações</span><br>
|
||||||
|
<br>
|
||||||
|
<div id='info_id' style="display: none">
|
||||||
|
<form method='post' action='/siprpWeb/request' name='request_form'>
|
||||||
|
<table border="0" cellspacing="2" cellpadding="2">
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="text" style='text-align: right'>Nome*:</td>
|
||||||
|
<td class="text"><input type="text" class="text" size="45" name="request_name"></td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="text" style='text-align: right'>Telefone*:</td>
|
||||||
|
<td class="text"><input type="text" class="text" size="45" name="request_phone"></td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="text" style='text-align: right'>E-mail*:</td>
|
||||||
|
<td class="text"><input type="text" class="text" size="45" name="request_email"></td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="text" style='text-align: right'>Assunto*:</td>
|
||||||
|
<td class="text"><textarea rows="5" cols="50" class="text" name="request_details"></textarea></td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="text" colspan='2' style='text-align: right'><input type='submit' value='Enviar' onclick="return check_info_request();"></td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td> </td>
|
||||||
|
<td class="text" style='font-size: 8pt'>* Campos de preenchimento obrigatório</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0" cellpadding="2"
|
||||||
|
cellspacing="2">
|
||||||
|
<tbody>
|
||||||
|
<tr align="center">
|
||||||
|
<td style="vertical-align: top;"><img alt=""
|
||||||
|
src="Images/bomba_amostr_ar.jpg" style="width: 189px; height: 141px;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr align="center">
|
||||||
|
<td style="vertical-align: top;">Bomba de Amostragem de ar<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr align="right">
|
||||||
|
<td style="vertical-align: top;"><a href="higiene_text_equip.html">voltar
|
||||||
|
»</a><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
Para a prestação deste serviço, a SIPRP
|
||||||
|
colocará à disposição um dos seus
|
||||||
|
Técnicos Superiores de Higiene e Segurança, que
|
||||||
|
garantirá o cumprimento das seguintes actividades nas
|
||||||
|
várias instalações da empresa espalhadas por todo
|
||||||
|
o país:<br>
|
||||||
|
<p style="text-align: left;">
|
||||||
|
- Identificação e avaliação dos
|
||||||
|
riscos;<br>
|
||||||
|
- Planeamento da prevenção, integrando-a a todos os
|
||||||
|
níveis da hierarquia;<br>
|
||||||
|
- Elaboração de um programa de
|
||||||
|
prevenção de riscos profissionais;<br>
|
||||||
|
- Informação sobre riscos e medidas de
|
||||||
|
protecção;<br>
|
||||||
|
- Organização de medidas a adoptar em caso de
|
||||||
|
perigo
|
||||||
|
grave;<br>
|
||||||
|
- Coordenação das auditorias internas para controlo
|
||||||
|
da aplicação das medidas a implementar;<br>
|
||||||
|
|
||||||
|
- Análise dos acidentes de trabalho e doenças
|
||||||
|
profissionais;<br>
|
||||||
|
|
||||||
|
- Recolha e organização de elementos
|
||||||
|
estatísticos.<br>
|
||||||
|
</p>
|
||||||
|
Estas actividades estão englobadas nas várias auditorias,
|
||||||
|
medições, avaliações e respectivos
|
||||||
|
relatórios efectuados pelo técnico.<br>
|
||||||
|
A SIPRP efectuará, no mínimo, DUAS auditorias por cada
|
||||||
|
estabelecimento e ano, que originarão os respectivos
|
||||||
|
relatórios técnicos com o levantamento das
|
||||||
|
condições verificadas e as recomendações
|
||||||
|
para a resolução das não conformidades encontradas.<br>
|
||||||
|
Com esse relatório será elaborado um Plano de
|
||||||
|
Actuação que será entregue ao coordenador do
|
||||||
|
serviço na empresa com as acções a desenvolver,
|
||||||
|
prazos de implementação e responsabilidades.<br>
|
||||||
|
Para além dos serviços incluídos e exigidos pela
|
||||||
|
legislação, a SIPRP possui capacidade (técnica e
|
||||||
|
humana) para efectuar avaliações específicas no
|
||||||
|
âmbito da Higiene e Segurança.<br>
|
||||||
|
Desde Estudos de Ruído, Iluminação, Conforto
|
||||||
|
Térmico, Qualidade do Ar, bem como outros factores relacionados
|
||||||
|
com outros riscos físicos, químicos ou biológicos.<br>
|
||||||
|
Para o cumprimento destes requisitos a SIPRP possui <a
|
||||||
|
href="higiene_text_equip.html">equipamento
|
||||||
|
técnico</a> próprio, de acordo com as normas nacionais e
|
||||||
|
internacionais.<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
<a href="Images/higiene_foto_equip_BA.html">Bombas de Amostragem</a><br>
|
||||||
|
- Para captação do volume de ar pretendido para a
|
||||||
|
amostra<br>
|
||||||
|
<a href="Images/higiene_foto_equip_RC.html">Reguladores de Caudal</a><br>
|
||||||
|
- Para regulação do caudal de ar pretendido para
|
||||||
|
amostra<br>
|
||||||
|
<a href="Images/higiene_foto_equip_MCT.html">Monitores de Conforto
|
||||||
|
Térmico</a><br>
|
||||||
|
- Para determinação dos parâmetros de
|
||||||
|
conforto térmico <br>
|
||||||
|
<a href="Images/higiene_foto_equip_T.html">Termoanemómetros</a><br>
|
||||||
|
- Para medição da temperatura, humidade relativa e
|
||||||
|
velocidade do ar <br>
|
||||||
|
<a href="Images/higiene_foto_equip_Ex.html">Explosivímetros</a><br>
|
||||||
|
- Para medir a concentração de oxigénio,
|
||||||
|
CO2, Metano, entre outros <br>
|
||||||
|
<a href="Images/higiene_foto_equip_Lux.html">Luxímetros</a><br>
|
||||||
|
- Para medição de luminância e
|
||||||
|
iluminância <br>
|
||||||
|
<a href="Images/higiene_foto_equip_Dos.html">Dosímetros</a><br>
|
||||||
|
- Para avaliação da exposição pessoal
|
||||||
|
diária de um trabalhador ao ruído <br>
|
||||||
|
<a href="Images/higiene_foto_equip_SI.html">Sonómetros
|
||||||
|
Integradores</a><br>
|
||||||
|
- Para avaliação dos níveis de ruído
|
||||||
|
ocupacional ou ambiental <br>
|
||||||
|
<a href="Images/higiene_foto_equip_Outr.html">Outros</a><br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,104 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Apresentação</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent; text-align: left;">
|
||||||
|
<p style="margin-bottom: 0cm;">Agência Europeia para a
|
||||||
|
Segurança
|
||||||
|
e Saúde do Trabalho – <a href="http://www.agency.osha.eu.int/"
|
||||||
|
target="_blank">www.agency.osha.eu.int</a><br>
|
||||||
|
American
|
||||||
|
Institute of Chemical Engineers – <a href="http://www.aiche.org/"
|
||||||
|
target="_blank">www.aiche.org</a><br>
|
||||||
|
American
|
||||||
|
Industrial Hygiene Association – <a href="http://www.aiha.org/"
|
||||||
|
target="_blank">www.aiha.org</a><br>
|
||||||
|
Associação
|
||||||
|
Portuguesa de Seguradores – <a href="http://www.apseguradores.pt/"
|
||||||
|
target="_blank">www.apseguradores.pt</a><br>
|
||||||
|
Bureau
|
||||||
|
of Labour Statistics – <a href="http://www.stats.bls.gov/"
|
||||||
|
target="_blank">www.stats.bls.gov</a><br>
|
||||||
|
Chemical
|
||||||
|
Abstracts Service – <a href="http://www.info.cas.org/" target="_blank">www.info.cas.org</a><br>
|
||||||
|
Cornell
|
||||||
|
University Ergonomics Web – <a
|
||||||
|
href="http://www.ergo.human.cornell.edu/" target="_blank">www.ergo.human.cornell.edu</a><br>
|
||||||
|
Direcção
|
||||||
|
Geral de Estudos Estatística e Planeamento –
|
||||||
|
<a href="http://www.deep.msst.gov.pt/" target="_blank">www.deep.msst.gov.pt</a><br>
|
||||||
|
Direcção
|
||||||
|
Geral de Saúde – <a href="http://www.dgsaude.pt/"
|
||||||
|
target="_blank">www.dgsaude.pt</a><br>
|
||||||
|
Factor
|
||||||
|
Segurança – <a href="http://www.factor-segur.pt/"
|
||||||
|
target="_blank">www.factor-segur.pt</a><br>
|
||||||
|
Grupo
|
||||||
|
PREMESER – <a href="http://www.premeser.com/" target="_blank">www.premeser.com</a><br>
|
||||||
|
IDICT
|
||||||
|
- <a href="http://www.idict.gov.pt/" target="_blank">www.idict.gov.pt</a><br>
|
||||||
|
Industrial
|
||||||
|
Safety and Health News – <a href="http://www.ishn.com/" target="_blank">www.ishn.com</a><br>
|
||||||
|
Institut
|
||||||
|
Nacional de Recherche et de Securité – <a
|
||||||
|
href="http://www.inrs.fr/" target="_blank">www.inrs.fr</a><br>
|
||||||
|
Institute
|
||||||
|
for Research in Construction –
|
||||||
|
<a href="http://www.irc.nrc-cnrc.gc.ca/irccontents.html" target="_blank">www.irc.nrc-cnrc.gc.ca/irccontents.html</a><br>
|
||||||
|
Institute
|
||||||
|
of Occupational Safety Engineering –
|
||||||
|
<a href="http://www.turva.me.tut.fi/english/indexeng.html" target="_blank">www.turva.me.tut.fi/english/indexeng.html</a><br>
|
||||||
|
Instituto
|
||||||
|
de Apoio às Pequenas e Médias Empresas e ao
|
||||||
|
Investimento – <a href="http://www.iapmei.pt/" target="_blank">www.iapmei.pt</a><br>
|
||||||
|
Instituto
|
||||||
|
Nacional de Estatística – <a href="http://www.ine.pt/"
|
||||||
|
target="_blank">www.ine.pt</a><br>
|
||||||
|
Instituto
|
||||||
|
para a Qualidade na Formação –
|
||||||
|
<a href="http://www.inofor.pt/" target="_blank">www.inofor.pt</a><br>
|
||||||
|
International
|
||||||
|
Labor Organization – <a href="http://www.ilo.org/" target="_blank">www.ilo.org</a><br>
|
||||||
|
International
|
||||||
|
Organization for Standardization – ISO –
|
||||||
|
<a href="http://www.iso.org/iso/en/isoonline.frontpage" target="_blank">www.iso.org/iso/en/isoonline.frontpage</a><br>
|
||||||
|
International
|
||||||
|
Society for Respiratory Protection – <a href="http://www.isrp.com.au/"
|
||||||
|
target="_blank">www.isrp.com.au</a><br>
|
||||||
|
International
|
||||||
|
Commision on Non-Ionozing Radiation Protection –
|
||||||
|
<a href="http://www.icirp.de/" target="_blank">www.icirp.de</a><br>
|
||||||
|
Ministério
|
||||||
|
da Segurança Social e do Trabalho – <a
|
||||||
|
href="http://www.msst.gov.pt/" target="_blank">www.msst.gov.pt</a><br>
|
||||||
|
Mutua
|
||||||
|
Universal – <a href="http://www.muniversal.net/" target="_blank">www.muniversal.net</a><br>
|
||||||
|
National
|
||||||
|
Electrical Safety Foundation – <a href="http://www.nesf.org/"
|
||||||
|
target="_blank">www.nesf.org</a><br>
|
||||||
|
National
|
||||||
|
Fire Protection Association – <a href="http://www.nfpa.org/"
|
||||||
|
target="_blank">www.nfpa.org</a><br>
|
||||||
|
Occupational
|
||||||
|
Safety and Health Administration – OSHA – <a
|
||||||
|
href="http://www.osha.gov/" target="_blank">www.osha.gov</a><br>
|
||||||
|
Ordem
|
||||||
|
dos Enfermeiros – <a href="http://www.ordemenfermeiros.pt/"
|
||||||
|
target="_blank">www.ordemenfermeiros.pt</a><br>
|
||||||
|
Ordem
|
||||||
|
dos Médicos – <a href="http://www.ordemdosmedicos.pt/"
|
||||||
|
target="_blank">www.ordemdosmedicos.pt</a><br>
|
||||||
|
PREVLER
|
||||||
|
Online – <a href="http://www.vol.com.br/prevler" target="_blank">www.vol.com.br/prevler</a><br>
|
||||||
|
Revista
|
||||||
|
Proteção – <a href="http://www.protecao.com.br/"
|
||||||
|
target="_blank">www.protecao.com.br</a><br>
|
||||||
|
Revista
|
||||||
|
Segurança – <a href="http://www.revistaseguranca.com/"
|
||||||
|
target="_blank">www.revistaseguranca.com</a><br>
|
||||||
|
World
|
||||||
|
Health Organization (OMS) – <a href="http://www.who.int/en" target="_blank">www.who.int/en</a></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style='background-color: transparent'>
|
||||||
|
A SIPRP possui um gabinete médico completamente equipado na sua
|
||||||
|
sede do Atrium Saldanha, em Lisboa, onde se encontra a sua Directora
|
||||||
|
Clínica, especialista em Medicina do Trabalho. <br>
|
||||||
|
Para além disso, e uma vez que tem a possibilidade de prestar o
|
||||||
|
serviço em todo o território nacional, possui uma rede de
|
||||||
|
clínicas, médicos, enfermeiros e laboratórios de
|
||||||
|
análises clínicas contratados com capacidade de poder
|
||||||
|
prestar o serviço dentro dos parâmetros de qualidade que
|
||||||
|
preconiza.<br>
|
||||||
|
Por último, tem, também, capacidade para fazer deslocar
|
||||||
|
Médicos do Trabalho às empresas, desde que estas possuam
|
||||||
|
gabinete médico próprio com as condições
|
||||||
|
mínimas exigidas pela legislação portuguesa.<br>
|
||||||
|
A Direcção Clínica da SIPRP desenha perfis
|
||||||
|
médicos adequados aos riscos a que estão expostos os
|
||||||
|
trabalhadores das suas empresas Clientes, não excluindo,
|
||||||
|
inclusivamente, a possibilidade de serem efectuados outros exames
|
||||||
|
complementares de diagnóstico conforme os riscos
|
||||||
|
específicos de cada actividade, como sejam os trabalhadores
|
||||||
|
expostos a factores físicos (como ruído, stress
|
||||||
|
térmico, iluminação, entre outros),
|
||||||
|
químicos (por exemplo, pessoal de limpeza) ou biológicos
|
||||||
|
(por exemplo, manipuladores de alimentos).<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
</head>
|
||||||
|
<script language="javascript" src="../css/funcs.js"></script>
|
||||||
|
<body class="text" style='background-color: transparent'>
|
||||||
|
Porque sabemos que a gestão administrativa do serviço de
|
||||||
|
SHST é difícil para a empresa, a SIPRP tomará a
|
||||||
|
seu cargo essas tarefas, simplificando todo o processo. <br>
|
||||||
|
<span id='span_not1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('not1_id')">Notificações ao ISHST</span>(ex-IDICT) (Mod. 1360)<br>
|
||||||
|
<div id='not1_id' style="display: none">
|
||||||
|
Elaboração e entrega da Notificação em cada
|
||||||
|
delegação ou subdelegação do ISHST
|
||||||
|
(ex-IDICT) onde a empresa tenha estabelecimento. Após a
|
||||||
|
confirmação da recepção desses documentos
|
||||||
|
por parte do ISHST, serão enviadas cópias autenticadas
|
||||||
|
para a empresa.<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_rel1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('rel1_id')">Relatório Anual de Actividade de SHST</span><br>
|
||||||
|
<div id='rel1_id' style="display: none">
|
||||||
|
Compilação da informação,
|
||||||
|
elaboração e entrega dos Relatórios (um por cada
|
||||||
|
estabelecimento) através de suporte informático pela
|
||||||
|
Internet. Após a confirmação da
|
||||||
|
recepção desses documentos por parte dos serviços
|
||||||
|
competentes, serão enviadas cópias para a empresa.<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_mar1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('mar1_id')">Marcações de Consultas</span><br>
|
||||||
|
<div id='mar1_id' style="display: none">
|
||||||
|
A SIPRP, através do seu avançado sistema
|
||||||
|
informático, será responsável pela
|
||||||
|
marcação dos exames de Medicina do Trabalho
|
||||||
|
(Admissão, Periódico ou Ocasional) conforme a
|
||||||
|
periodicidade indicada pela legislação (anualmente para
|
||||||
|
os trabalhadores com menos de 18 e mais de 50 anos e de dois em dois
|
||||||
|
anos para os restantes).<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_inf1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('inf1_id')">Informação on line</span><br>
|
||||||
|
<div id='inf1_id' style="display: none">
|
||||||
|
A SIPRP possibilita à empresa, através deste site, a
|
||||||
|
visualização do histórico do serviço
|
||||||
|
(consultas efectuadas, marcações, faltas, data da
|
||||||
|
próxima consulta, se tem Ficha de Aptidão emitida, entre
|
||||||
|
outros) durante as 24 horas do dia, todos os dias do ano. Essa
|
||||||
|
informação será, logicamente, confidencial,
|
||||||
|
não tendo qualquer dado médico (ao abrigo do sigilo
|
||||||
|
profissional) e exigirá a introdução de uma
|
||||||
|
palavra passe previamente remetida à empresa.<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_inf2_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('inf2_id')">Informação sobre legislação</span><br>
|
||||||
|
<div id='inf2_id' style="display: none">
|
||||||
|
A SIPRP será responsável pelo envio, com periodicidade
|
||||||
|
acordada, da actualização de toda a
|
||||||
|
legislação de SHST (portuguesa e europeia) sobre a
|
||||||
|
actividade específica da empresa Cliente, mantendo-a a par de
|
||||||
|
todas as obrigações legais inerentes. <br>
|
||||||
|
</div>
|
||||||
|
<span id='span_con1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('con1_id')">Controlos de Qualidade</span><br>
|
||||||
|
<div id='con1_id' style="display: none">
|
||||||
|
Serão efectuados questionários de controlo de qualidade,
|
||||||
|
por amostragem, tanto aos funcionários da empresas bem como aos
|
||||||
|
responsáveis directos pelo serviço, com o objectivo de se
|
||||||
|
poder aperfeiçoar, melhorar ou intervir rapidamente nalgum
|
||||||
|
aspecto que não corresponda às expectativas da empresa.<br>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style='background-color: transparent'>
|
||||||
|
Porque sabemos que a gestão administrativa do serviço de
|
||||||
|
SHST é difícil para a empresa, a SIPRP tomará a
|
||||||
|
seu cargo essas tarefas, simplificando todo o processo. <br>
|
||||||
|
<span style="font-weight: bold;">Notificações ao ISHST</span>
|
||||||
|
(ex-IDICT) (Mod. 1360)<br>
|
||||||
|
Elaboração e entrega da Notificação em cada
|
||||||
|
delegação ou subdelegação do ISHST
|
||||||
|
(ex-IDICT) onde a empresa tenha estabelecimento. Após a
|
||||||
|
confirmação da recepção desses documentos
|
||||||
|
por parte do ISHST, serão enviadas cópias autenticadas
|
||||||
|
para a empresa.<br>
|
||||||
|
<span style="font-weight: bold;">Relatório Anual de Actividade
|
||||||
|
de SHST</span><br>
|
||||||
|
Compilação da informação,
|
||||||
|
elaboração e entrega dos Relatórios (um por cada
|
||||||
|
estabelecimento) através de suporte informático pela
|
||||||
|
Internet. Após a confirmação da
|
||||||
|
recepção desses documentos por parte dos serviços
|
||||||
|
competentes, serão enviadas cópias para a empresa.<br>
|
||||||
|
<span style="font-weight: bold;">Marcações de Consultas</span><br>
|
||||||
|
A SIPRP, através do seu avançado sistema
|
||||||
|
informático, será responsável pela
|
||||||
|
marcação dos exames de Medicina do Trabalho
|
||||||
|
(Admissão, Periódico ou Ocasional) conforme a
|
||||||
|
periodicidade indicada pela legislação (anualmente para
|
||||||
|
os trabalhadores com menos de 18 e mais de 50 anos e de dois em dois
|
||||||
|
anos para os restantes).<br>
|
||||||
|
<span style="font-weight: bold;">Informação on line</span><br>
|
||||||
|
A SIPRP possibilita à empresa, através deste site, a
|
||||||
|
visualização do histórico do serviço
|
||||||
|
(consultas efectuadas, marcações, faltas, data da
|
||||||
|
próxima consulta, se tem Ficha de Aptidão emitida, entre
|
||||||
|
outros) durante as 24 horas do dia, todos os dias do ano. Essa
|
||||||
|
informação será, logicamente, confidencial,
|
||||||
|
não tendo qualquer dado médico (ao abrigo do sigilo
|
||||||
|
profissional) e exigirá a introdução de uma
|
||||||
|
palavra passe previamente remetida à empresa.<br>
|
||||||
|
<span style="font-weight: bold;">Informação sobre
|
||||||
|
legislação</span><br>
|
||||||
|
A SIPRP será responsável pelo envio, com periodicidade
|
||||||
|
acordada, da actualização de toda a
|
||||||
|
legislação de SHST (portuguesa e europeia) sobre a
|
||||||
|
actividade específica da empresa Cliente, mantendo-a a par de
|
||||||
|
todas as obrigações legais inerentes. <br>
|
||||||
|
<span style="font-weight: bold;">Controlos de Qualidade</span><br>
|
||||||
|
Serão efectuados questionários de controlo de qualidade,
|
||||||
|
por amostragem, tanto aos funcionários da empresas bem como aos
|
||||||
|
responsáveis directos pelo serviço, com o objectivo de se
|
||||||
|
poder aperfeiçoar, melhorar ou intervir rapidamente nalgum
|
||||||
|
aspecto que não corresponda às expectativas da empresa.<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
</head>
|
||||||
|
<script language="javascript" src="../css/funcs.js"></script>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
A SIPRP, devido à sua competência técnica e humana,
|
||||||
|
põe à disposição dos seus Clientes um leque
|
||||||
|
de serviços muito abrangente, tendo sempre em conta o respeito
|
||||||
|
pela legislação vigente e pelos princípios de
|
||||||
|
rigor, transparência e qualidade.<br>
|
||||||
|
<br>
|
||||||
|
Poderá consultar, seguidamente, alguns dos serviços que
|
||||||
|
poderemos oferecer:<br>
|
||||||
|
<br>
|
||||||
|
<div style="text-align: left;">
|
||||||
|
<span id='span_seg1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('seg1_id')">Segurança, Higiene e Saúde do Trabalho</span><br>
|
||||||
|
<div id='seg1_id' style="display: none">
|
||||||
|
- Serviços à Medida do Cliente ou sua actividade obedecendo à legislação portuguesa em vigor<br>
|
||||||
|
- Medicina do Trabalho<br>
|
||||||
|
- Levantamento e Avaliação de Riscos<br>
|
||||||
|
- Apoio Administrativo<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_for1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('for1_id')">Formação</span><br>
|
||||||
|
<div id='for1_id' style="display: none">
|
||||||
|
- Primeiros Socorros<br>
|
||||||
|
- Acções de Sensibilização em Higiene e Segurança e EPI’s<br>
|
||||||
|
- Meios de Combate a Incêndios<br>
|
||||||
|
- Movimentação Mecânica de Cargas (Empilhadores e outros)<br>
|
||||||
|
- Manipulação de Cargas<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_erg1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('erg1_id')">Ergonomia</span><br>
|
||||||
|
<div id='erg1_id' style="display: none">
|
||||||
|
- Avaliação da Carga Física<br>
|
||||||
|
- Movimentação Manual de Cargas<br>
|
||||||
|
- Prevenção de Lesões Músculo-Esqueléticas<br>
|
||||||
|
- Análise de Postos de Trabalho<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_est1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('est1_id')">Estudos e Análises Técnicas de Agentes Físicos (Iluminação, Ruído, Radiações, Ambiente Térmico e Vibrações)</span><br>
|
||||||
|
<div id='est1_id' style="display: none">
|
||||||
|
- Estudos de Luminância e Iluminância<br>
|
||||||
|
- Estudos de Ruído Ocupacional<br>
|
||||||
|
- Estudos de Radiações Ionizantes (i.e. RX) e Não Ionizantes (i.e. Campos Electromagnéticos dos Computadores)<br>
|
||||||
|
- Estudos de Conforto e Stress Térmico<br>
|
||||||
|
- Estudos de Vibrações<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_est2_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('est2_id')">Estudos e Análises Técnicas de Contaminantes Químicos (Poeiras, Gases e Vapores, Líquidos e Fumos)</span><br>
|
||||||
|
<div id='est2_id' style="display: none">
|
||||||
|
- Estudos de Poeiras (Totais e Respiráveis)<br>
|
||||||
|
- Compostos Orgânicos Voláteis, Formaldaído e Nicotina<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_est3_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('est3_id')">Estudos e Análises Técnicas de Contaminantes Biológicos (Vírus, Bactérias, Fungos e Parasitas)</span><br>
|
||||||
|
<div id='est3_id' style="display: none">
|
||||||
|
- Legionella Pneumóphila<br>
|
||||||
|
- Exames Microbiológicos (i.e. interior de condutas do sistema AVAC)<br>
|
||||||
|
- Estudos de Microrganismos em Suspensão no Ar<br>
|
||||||
|
</div>
|
||||||
|
<span id='span_out1_id' style="font-weight: bold; text-decoration: underline; cursor: pointer" onmousedown="return false;" onclick="showhide('out1_id')">Outros</span><br>
|
||||||
|
<div id='out1_id' style="display: none">
|
||||||
|
- Planos de Emergência / Evacuação<br>
|
||||||
|
- Medicina Curativa<br>
|
||||||
|
- Enfermagem<br>
|
||||||
|
- Análises Clínicas<br>
|
||||||
|
- Exames Complementares de Diagnóstico<br>
|
||||||
|
- Comercialização de Sinalética de Segurança<br>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
A SIPRP, devido à sua competência técnica e humana,
|
||||||
|
põe à disposição dos seus Clientes um leque
|
||||||
|
de serviços muito abrangente, tendo sempre em conta o respeito
|
||||||
|
pela legislação vigente e pelos princípios de
|
||||||
|
rigor, transparência e qualidade.<br>
|
||||||
|
<br>
|
||||||
|
Poderá consultar, seguidamente, alguns dos serviços que
|
||||||
|
poderemos oferecer:<br>
|
||||||
|
<br>
|
||||||
|
<p style="text-align: left;">
|
||||||
|
Segurança, Higiene e Saúde do Trabalho<br>
|
||||||
|
- Serviços à Medida do Cliente ou sua actividade
|
||||||
|
obedecendo à legislação portuguesa em vigor<br>
|
||||||
|
- Medicina do Trabalho<br>
|
||||||
|
- Levantamento e Avaliação de Riscos<br>
|
||||||
|
- Apoio Administrativo<br>
|
||||||
|
Formação<br>
|
||||||
|
- Primeiros Socorros<br>
|
||||||
|
- Acções de Sensibilização em Higiene
|
||||||
|
e
|
||||||
|
Segurança e EPI’s<br>
|
||||||
|
- Meios de Combate a Incêndios<br>
|
||||||
|
- Movimentação Mecânica de Cargas
|
||||||
|
(Empilhadores
|
||||||
|
e outros)<br>
|
||||||
|
- Manipulação de Cargas<br>
|
||||||
|
Ergonomia<br>
|
||||||
|
- Avaliação da Carga Física<br>
|
||||||
|
- Movimentação Manual de Cargas<br>
|
||||||
|
- Prevenção de Lesões
|
||||||
|
Músculo-Esqueléticas<br>
|
||||||
|
- Análise de Postos de Trabalho<br>
|
||||||
|
Estudos e Análises Técnicas de Agentes Físicos
|
||||||
|
(Iluminação, Ruído, Radiações,
|
||||||
|
Ambiente Térmico e Vibrações)<br>
|
||||||
|
- Estudos de Luminância e Iluminância<br>
|
||||||
|
- Estudos de Ruído Ocupacional<br>
|
||||||
|
- Estudos de Radiações Ionizantes (i.e. RX) e
|
||||||
|
Não Ionizantes (i.e. Campos Electromagnéticos dos
|
||||||
|
Computadores)<br>
|
||||||
|
- Estudos de Conforto e Stress Térmico<br>
|
||||||
|
- Estudos de Vibrações<br>
|
||||||
|
Estudos e Análises Técnicas de Contaminantes
|
||||||
|
Químicos (Poeiras, Gases e Vapores, Líquidos e Fumos)<br>
|
||||||
|
- Estudos de Poeiras (Totais e Respiráveis)<br>
|
||||||
|
- Compostos Orgânicos Voláteis, Formaldaído e
|
||||||
|
Nicotina<br>
|
||||||
|
Estudos e Análises Técnicas de Contaminantes
|
||||||
|
Biológicos (Vírus, Bactérias, Fungos e Parasitas)<br>
|
||||||
|
- Legionella Pneumóphila<br>
|
||||||
|
- Exames Microbiológicos (i.e. interior de condutas do
|
||||||
|
sistema AVAC)<br>
|
||||||
|
- Estudos de Microrganismos em Suspensão no Ar<br>
|
||||||
|
Outros<br>
|
||||||
|
- Planos de Emergência / Evacuação<br>
|
||||||
|
- Medicina Curativa<br>
|
||||||
|
- Enfermagem<br>
|
||||||
|
- Análises Clínicas<br>
|
||||||
|
- Exames Complementares de Diagnóstico<br>
|
||||||
|
- Comercialização de Sinalética de
|
||||||
|
Segurança<br>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Apresentação</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
A SIPRP - Sociedade Ibérica de Prevenção de Riscos
|
||||||
|
Profissionais é uma empresa de origem espanhola pertencente ao
|
||||||
|
Grupo Premeser (www.premeser.com). Este Grupo foi formado com a
|
||||||
|
finalidade de optimizar as sinergias entre empresas de sectores e
|
||||||
|
âmbitos geográficos diferentes, resultando num grupo
|
||||||
|
sólido e competitivo, capaz de oferecer as respostas adequadas
|
||||||
|
para uma gestão eficaz dos serviços de Segurança,
|
||||||
|
Higiene e Saúde do Trabalho (SHST) junto dos seus Clientes.<br>
|
||||||
|
<br>
|
||||||
|
A SIPRP aposta fortemente na <a href="siprp_text_inovacao.html">inovação</a>
|
||||||
|
e pretende ser uma
|
||||||
|
empresa de referência no sector, assentando a sua
|
||||||
|
actuação no rigor, seriedade e em compromissos
|
||||||
|
sólidos com os seus Clientes e suas necessidades.<br>
|
||||||
|
<br>
|
||||||
|
Porque a prevenção é a base de todo o trabalho
|
||||||
|
nesta área, na SIPRP temos em conta a especificidade da
|
||||||
|
actividade de cada empresa, as condições de trabalho dos
|
||||||
|
seus colaboradores e todos os factores que os rodeiam.<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Apresentação</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
Como factores de sucesso na inovação, salientamos:<br>
|
||||||
|
<br>
|
||||||
|
- Atendimento personalizado, baseado numa sólida plataforma
|
||||||
|
informática;<br>
|
||||||
|
- Informação actualizada on-line;<br>
|
||||||
|
- Equipamento técnico de última geração;<br>
|
||||||
|
- Instalações modernas e funcionais;<br>
|
||||||
|
- Técnicos Superiores qualificados;<br>
|
||||||
|
- Acompanhamento permanente das necessidades e exigências dos
|
||||||
|
Clientes;<br>
|
||||||
|
- Diversas opções para prestação dos
|
||||||
|
serviços (à medida de cada actividade)<br>
|
||||||
|
<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
function showhide( id )
|
||||||
|
{
|
||||||
|
if( document.getElementById )
|
||||||
|
{
|
||||||
|
obj = document.getElementById( id );
|
||||||
|
if ( obj.style.display == "none" )
|
||||||
|
{
|
||||||
|
obj.style.display = "";
|
||||||
|
document.getElementById( 'span_' + id ).style.color = "#C13F45";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj.style.display = "none";
|
||||||
|
document.getElementById( 'span_' + id ).style.color = "#497895";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValidDate( year, month, day )
|
||||||
|
{
|
||||||
|
return day > 0 && ( day <= [, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][ month ] ||
|
||||||
|
day == 29 && month == 2 && year % 4 == 0 && ( year % 100 > 0 || year % 400 == 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValid( element, type )
|
||||||
|
{
|
||||||
|
switch( type )
|
||||||
|
{
|
||||||
|
// date
|
||||||
|
case 0:
|
||||||
|
if( element.value.search( /^\d\d?\/\d\d?\/\d{1,4}$/ ) != 0 )
|
||||||
|
{
|
||||||
|
alert( "Formato da data incorrecto." );
|
||||||
|
window.setTimeout( "document.getElementById( '" + element.name + "').focus()", 1 );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
date_value = element.value.split( "/" );
|
||||||
|
if( ! isValidDate( date_value[ 2 ], date_value[ 1 ], date_value[ 0 ] ) )
|
||||||
|
{
|
||||||
|
alert( "Data inválida." );
|
||||||
|
window.setTimeout( "document.getElementById( '" + element.name + "').focus()", 1 );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// integer
|
||||||
|
case 1:
|
||||||
|
if( element.value.search( /^\d\d:\d\d$/ ) != 0 )
|
||||||
|
{
|
||||||
|
alert( "Formato da hora incorrecto." );
|
||||||
|
window.setTimeout( "document.getElementById( '" + element.name + "' ).focus()", 1 );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
time_value = element.value.split( ":" );
|
||||||
|
if( time_value[ 0 ] > 23 || time_value[ 1 ] > 59 )
|
||||||
|
{
|
||||||
|
alert( "Hora inválida." );
|
||||||
|
window.setTimeout( "document.getElementById( '" + element.name + "').focus()", 1 );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@ -0,0 +1,129 @@
|
|||||||
|
body
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noticias
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 9pt;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.asd
|
||||||
|
{
|
||||||
|
border-width: 1px 1px 1px 1px;
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.title
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.noticias
|
||||||
|
{
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.footer
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 8pt;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link,
|
||||||
|
a:visited,
|
||||||
|
a:active
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover
|
||||||
|
{
|
||||||
|
color: #C13F45;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.menu:link,
|
||||||
|
a.menu:visited,
|
||||||
|
a.menu:active
|
||||||
|
{
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.menu:hover
|
||||||
|
{
|
||||||
|
color: #C13F45;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.big:link,
|
||||||
|
a.big:visited,
|
||||||
|
a.big:active
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 12pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.big:hover
|
||||||
|
{
|
||||||
|
color: #C13F45;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 12pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.copy:link,
|
||||||
|
a.copy:visited,
|
||||||
|
a.copy:active
|
||||||
|
{
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 8pt;
|
||||||
|
font-weight: normal;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
select,
|
||||||
|
option,
|
||||||
|
input
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Erro</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style="background-color: transparent;">
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title" style="background: transparent url(html/images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;"> erro<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top; color: #C13F45">
|
||||||
|
$msg
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; height: 13px; vertical-align: top; background-image: url(html/images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,254 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta content="text/html; charset=ISO-8859-1"
|
||||||
|
http-equiv="content-type">
|
||||||
|
<link rel="stylesheet" href="html/css/style.css" type="text/css">
|
||||||
|
<title>SIPRP</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
<script>
|
||||||
|
if( !document.all )
|
||||||
|
{
|
||||||
|
window.captureEvents(Event.KEYUP);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
document.onkeypress = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
function s( e )
|
||||||
|
{
|
||||||
|
if( document.all ) // IE
|
||||||
|
{
|
||||||
|
var e = window.event.keyCode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e = e.which;
|
||||||
|
}
|
||||||
|
if( e == 13 )
|
||||||
|
{
|
||||||
|
document.loginForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table
|
||||||
|
style="width: 760px; height: 623px; background-image: url(html/images/fundo.jpg); background-repeat: no-repeat;"
|
||||||
|
align="center">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 623px; width: 20px;"><br>
|
||||||
|
</td>
|
||||||
|
<td style="vertical-align: top; width: 760px; height: 623px;">
|
||||||
|
<table style="text-align: center; width: 740px; height: 230px;"
|
||||||
|
border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 200px; vertical-align: top;" colspan="7"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 45px; vertical-align: top;"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/siprp.html" target="_ifrm">a SIPRP</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/servicos.html" target="_ifrm">serviços</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/colaboradores.html" target="_ifrm">colaboradores</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/contactos.html" target="_ifrm">contactos</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/links.html" target="_ifrm">links</a></td>
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table style="text-align: left; width: 740px; height: 367px;"
|
||||||
|
border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1" rowspan="3" style="vertical-align: top;"><!-- INICIO -->
|
||||||
|
<!-- $!msg -->
|
||||||
|
<!--<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title" style="background: transparent url(html/images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;"> erro<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top; color: #C13F45">
|
||||||
|
$msg
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; height: 13px; vertical-align: top; background-image: url(html/images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
-->
|
||||||
|
<iframe name="_ifrm" src="/siprpWeb/?erro=$msg" marginwidth="0" marginheight="0"
|
||||||
|
frameborder="0" height="100%" width="588" allowtransparency='true'>
|
||||||
|
</iframe><!--
|
||||||
|
<table style="width: 588px; text-align: left;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class='title' style="background: transparent url( images/texto%20topo.gif ) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;"> os nossos serviços</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 3px; background-color: #789BB5;"></td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<!-td class='text' style="vertical-align: top;">texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto</td->
|
||||||
|
<td id='textTable' class='text' style="vertical-align: top;"></td>
|
||||||
|
<td style="width: 2px;"></td>
|
||||||
|
<td style="width: 3px; background-color: #789BB5;"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; height: 13px; vertical-align: top; background-image: url( images/texto%20base.gif ); background-repeat: no-repeat;"><br></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style='font-weight: bold;'><br>
|
||||||
|
<a class='big' href='#' onclick='setText( 0 );'>-Higiene e Segurança</a><br>
|
||||||
|
<a class='big' href='#' onclick='setText( 1 );'>-Medicina do Trabalho</a><br>
|
||||||
|
<a class='big' href='#' onclick='setText( 2 );'>-Politica de Qualidade e Tratamento da Vertente Burocratica</a><br>
|
||||||
|
<a class='big' href='#' onclick='setText( 3 );'>-Serviços Complementares</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
--><!-- FIM --> <br>
|
||||||
|
</td>
|
||||||
|
<td style="vertical-align: top;">
|
||||||
|
<table
|
||||||
|
style="width: 143px; height: 101px; vertical-align: top; background-image: url(html/images/login.jpg); background-repeat: no-repeat;"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<form method="post" name="loginForm"> <input
|
||||||
|
name="form" value="Entrar" type="hidden">
|
||||||
|
<table
|
||||||
|
style="font-family: verdana; font-weight: bold; font-size: 10pt;"
|
||||||
|
align="center" cellpadding="0" cellspacing="0" height="90" width="120">
|
||||||
|
<tbody>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="title">user</td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td><input size="17" name="user" type="text" ></td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="title">password</td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td><input size="17" name="password"
|
||||||
|
onfocus="onkeypress = s" type="password" ></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 5px; vertical-align: top;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 141px; vertical-align: top;">
|
||||||
|
<table style="text-align: left; width: 141px;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="height: 30px; background-image: url(html/images/noticias_top.jpg); background-repeat: no-repeat;"> notícias<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<table style="width: 100%; text-align: left;"
|
||||||
|
border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="noticias"
|
||||||
|
style="text-align: left; vertical-align: top;">A SIPRP apresenta o
|
||||||
|
seu novo site em www.siprp.pt.<br>
|
||||||
|
<br>
|
||||||
|
Além de conteúdos sobre a empresa e o grupo, é
|
||||||
|
disponibilizado um portal online com funcionalidades para os seus
|
||||||
|
clientes. </td>
|
||||||
|
<td style="width: 1px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="height: 11px; background-image: url(html/images/noticias_base.jpg); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="footer"
|
||||||
|
style="width: 740px; height: 33px; background-image: url(html/images/rodape.jpg); background-position: right center; background-repeat: no-repeat;"
|
||||||
|
rowspan="1" colspan="2">Site optimizado para 800x600 - Todos os
|
||||||
|
direitos reservados Sociedade Ibérica de Prevenção
|
||||||
|
de Riscos Profissionais <br>
|
||||||
|
Desenvolvido por <a class="copy" href="http://www.evolute.pt" target="_blank">Evolute
|
||||||
|
- Consultoria Informática</a> e <a class="copy"
|
||||||
|
href="http://www.2-3design.com/" target="_blank">2/3 Design</a> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Higiene</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style="background-color: transparent;">
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;">
|
||||||
|
higiene e segurança<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;"><iframe
|
||||||
|
name="frame_3" src="conteudos/higiene_text.html" marginwidth="0"
|
||||||
|
marginheight="0" allowtransparency="true" frameborder="0" height="200"
|
||||||
|
width="100%"></iframe><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,229 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
||||||
|
<meta name="keywords"
|
||||||
|
content="medicina, trabalho, higiene, seguranca, segurança, formacao, formação, primeiros, socorros, suporte,
|
||||||
|
basico, básico, vida, combate, incendios, incêndios, evacuacao, evacuação, movimentacao, movimentação,
|
||||||
|
manual, cargas, empilhadores, ruido, ruído, ambiente, termico, térmico, iluminação,
|
||||||
|
iluminacao, qualidade, ar, contaminantes, quimicos, químicos, biologicos, biológicos,
|
||||||
|
ergonomia, planos, emergencia, emergência, SIPRP,
|
||||||
|
sociedade iberica prevencao riscos profissionais,
|
||||||
|
sociedade ibérica prevenção riscos profissionais,
|
||||||
|
sociedade, iberica, prevencao, riscos, profissionais,
|
||||||
|
sociedade, ibérica, prevenção, riscos, profissionais" />
|
||||||
|
<link rel="stylesheet" href="html/css/style.css" type="text/css">
|
||||||
|
<title>SIPRP</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
<script>
|
||||||
|
if( !document.all )
|
||||||
|
{
|
||||||
|
window.captureEvents(Event.KEYUP);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
document.onkeypress = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
function s( e )
|
||||||
|
{
|
||||||
|
if( document.all ) // IE
|
||||||
|
{
|
||||||
|
var e = window.event.keyCode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e = e.which;
|
||||||
|
}
|
||||||
|
if( e == 13 )
|
||||||
|
{
|
||||||
|
document.loginForm.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table
|
||||||
|
style="width: 760px; height: 623px; background-image: url(html/images/fundo.jpg); background-repeat: no-repeat;"
|
||||||
|
align="center">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 623px; width: 20px;"><br>
|
||||||
|
</td>
|
||||||
|
<td style="vertical-align: top; width: 760px; height: 623px;">
|
||||||
|
<table style="text-align: center; width: 740px; height: 230px;"
|
||||||
|
border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 200px; vertical-align: top;" colspan="7"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 45px; vertical-align: top;"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/siprp.html" target="_ifrm">a SIPRP</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/servicos.html" target="_ifrm">serviços</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/colaboradores.html" target="_ifrm">colaboradores</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/contactos.html" target="_ifrm">contactos</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a
|
||||||
|
class="menu" href="html/links.html" target="_ifrm">links</a></td>
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table style="text-align: left; width: 740px; height: 367px;"
|
||||||
|
border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1" rowspan="2" style="vertical-align: top;"><!-- INICIO --> <iframe
|
||||||
|
name="_ifrm" src="html/siprp.html" marginwidth="0" marginheight="0"
|
||||||
|
frameborder="0" height="100%" width="588" allowtransparency='true'></iframe><!--
|
||||||
|
<table style="width: 588px; text-align: left;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class='title' style="background: transparent url( html/images/texto%20topo.gif ) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;"> os nossos serviços</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 3px; background-color: #789BB5;"></td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<!-td class='text' style="vertical-align: top;">texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto texto</td->
|
||||||
|
<td id='textTable' class='text' style="vertical-align: top;"></td>
|
||||||
|
<td style="width: 2px;"></td>
|
||||||
|
<td style="width: 3px; background-color: #789BB5;"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; height: 13px; vertical-align: top; background-image: url( html/images/texto%20base.gif ); background-repeat: no-repeat;"><br></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style='font-weight: bold;'><br>
|
||||||
|
<a class='big' href='#' onclick='setText( 0 );'>-Higiene e Segurança</a><br>
|
||||||
|
<a class='big' href='#' onclick='setText( 1 );'>-Medicina do Trabalho</a><br>
|
||||||
|
<a class='big' href='#' onclick='setText( 2 );'>-Politica de Qualidade e Tratamento da Vertente Burocratica</a><br>
|
||||||
|
<a class='big' href='#' onclick='setText( 3 );'>-Serviços Complementares</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
--><!-- FIM --> <br>
|
||||||
|
</td>
|
||||||
|
<td style="vertical-align: top;">
|
||||||
|
<table
|
||||||
|
style="width: 143px; height: 101px; vertical-align: top; background-image: url(html/images/login.jpg); background-repeat: no-repeat;"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<form method="post" name="loginForm"> <input
|
||||||
|
name="form" value="Entrar" type="hidden">
|
||||||
|
<table
|
||||||
|
style="font-family: verdana; font-weight: bold; font-size: 10pt;"
|
||||||
|
align="center" cellpadding="0" cellspacing="0" height="90" width="120">
|
||||||
|
<tbody>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="title">user</td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td><input size="15" name="user" type="text" ></td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="title">password</td>
|
||||||
|
</tr>
|
||||||
|
<tr valign="top">
|
||||||
|
<td><input size="15" name="password"
|
||||||
|
onfocus="onkeypress = s" type="password" ></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- <tr>
|
||||||
|
<td style="height: 0px; vertical-align: top;">
|
||||||
|
</td>
|
||||||
|
</tr>-->
|
||||||
|
<tr>
|
||||||
|
<td style="width: 141px; vertical-align: top;">
|
||||||
|
<table style="text-align: left; width: 141px;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="height: 30px; background-image: url(html/images/noticias_top.jpg); background-repeat: no-repeat;"> notícias<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<table style="height: 165px; width: 100%; text-align: left;"
|
||||||
|
border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="noticias"
|
||||||
|
style="text-align: left; vertical-align: top;">
|
||||||
|
<iframe name="news_ifrm" src="/siprpWeb/noticias" marginwidth="0" marginheight="0"
|
||||||
|
frameborder="0" height="100%" width="100%" allowtransparency='true'></iframe>
|
||||||
|
<!--A SIPRP apresenta o
|
||||||
|
seu novo site em www.siprp.pt.<br>
|
||||||
|
<br>
|
||||||
|
Além de conteúdos sobre a empresa e o grupo, é
|
||||||
|
disponibilizado um portal online com funcionalidades para os seus
|
||||||
|
clientes. --></td>
|
||||||
|
<td style="width: 1px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- <tr>
|
||||||
|
</tr>-->
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="height: 11px; background-image: url(html/images/noticias_base.jpg); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="footer"
|
||||||
|
style="width: 740px; height: 33px; background-image: url(html/images/rodape.jpg); background-position: right center; background-repeat: no-repeat;"
|
||||||
|
rowspan="1" colspan="2">Site optimizado para 800x600 - Todos os
|
||||||
|
direitos reservados Sociedade Ibérica de Prevenção
|
||||||
|
de Riscos Profissionais <br>
|
||||||
|
Desenvolvido por <a class="copy" href="http://www.evolute.pt" target="_blank">Evolute
|
||||||
|
- Consultoria Informática</a> e <a class="copy"
|
||||||
|
href="http://www.2-3design.com/" target="_blank">2/3 Design</a> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Links</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style="background-color: transparent;">
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;">
|
||||||
|
links úteis<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;"><iframe
|
||||||
|
name="_ifrm" src="conteudos/links_text.html" marginwidth="0"
|
||||||
|
marginheight="0" allowtransparency="true" frameborder="0" height="277"
|
||||||
|
width="100%"></iframe><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="html/css/style.css" type="text/css">
|
||||||
|
<title>Enviado</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
A sua informação foi enviada com sucesso.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="html/css/style.css" type="text/css">
|
||||||
|
<title>Erro a enviar</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
Erro a enviar a sua informação.<br>
|
||||||
|
Verifique que preencheu "Nome Completo", "Telefone" e "E-Mail" com um valor válido.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
Envio de CV
|
||||||
|
|
||||||
|
Função: $rec_funcao
|
||||||
|
Nome: $rec_nome
|
||||||
|
Morada: $rec_morada
|
||||||
|
Telefone: $rec_telefone
|
||||||
|
E-mail: $rec_email
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="html/css/style.css" type="text/css">
|
||||||
|
<title>Enviado</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
O seu pedido foi enviado com sucesso
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
Pedido de informação de:
|
||||||
|
Nome: $request_name
|
||||||
|
Telefone: $request_phone
|
||||||
|
E-mail: $request_email
|
||||||
|
Assunto: $request_details
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="html/css/style.css" type="text/css">
|
||||||
|
<title>Erro a enviar</title>
|
||||||
|
</head>
|
||||||
|
<body class="text" style="background-color: transparent;">
|
||||||
|
Erro a enviar o seu pedido
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
Empresa: $empresa<br>
|
||||||
|
Estabelecimento: $estabelecimento<br>
|
||||||
|
Funcionário: $funcionario<br>
|
||||||
|
<br>
|
||||||
|
Pedido de marcação de $marcacao_tipo
|
||||||
|
data(s): $data#if( $marcacao_tipo == 'Consulta' )
|
||||||
|
Horário: $hora#end.<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Marcação de consulta</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<script language="javascript" src="/siprpWeb/html/css/funcs.js"></script>
|
||||||
|
<script>
|
||||||
|
function validateForm()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
//return isValid( document.f.data, 0 ) && isValid( document.f.hora, 1 );
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<body>
|
||||||
|
<form method='post' action='/siprpWeb/schedule' name='f'>
|
||||||
|
<input type="hidden" name="marcacao_tipo" id="marcacao_tipo" value="Consulta">
|
||||||
|
<table class='text'>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
Marcação de Consulta para:<br>
|
||||||
|
$funcionario
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<SCRIPT LANGUAGE="JavaScript">
|
||||||
|
var cal = new CalendarPopup();
|
||||||
|
</SCRIPT>
|
||||||
|
<td>Data(s)*:</td><td><input type='text' id='data' name='data'></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Horário:</td><td><input type='text' id='hora' name='hora'></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
Nota: a marcação está sujeita a confirmação via email.<br>
|
||||||
|
* - campo de preenchimento obrigatório
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
<input type='submit' value='Marcar' onclick='return validateForm()'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Marcação de consulta / exame</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body class='text'>
|
||||||
|
O pedido de marcação foi enviado com sucesso.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Marcação de exames</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<script language="javascript" src="/siprpWeb/html/css/funcs.js"></script>
|
||||||
|
<script>
|
||||||
|
function validateForm()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
//return isValid( document.f.data, 0 );
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<body>
|
||||||
|
<form method='post' action='/siprpWeb/schedule' name='f'>
|
||||||
|
<input type="hidden" name="marcacao_tipo" id="marcacao_tipo" value="Exame">
|
||||||
|
<table class='text'>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
Marcação de Exames para:<br>
|
||||||
|
$funcionario
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Data(s)*:</td><td><input type='text' id='data' name='data'></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
Nota: a marcação está sujeita a confirmação via email.<br>
|
||||||
|
* - campo de preenchimento obrigatório
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
<input type='submit' value='Marcar' onclick='return validateForm()'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Marcação de consulta / exame</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<script language="javascript" src="/siprpWeb/html/css/funcs.js"></script>
|
||||||
|
<script>
|
||||||
|
function validateForm()
|
||||||
|
{
|
||||||
|
checked = -1;
|
||||||
|
for( i = 0; i < document.f.marcacao_tipo.length; i++ )
|
||||||
|
{
|
||||||
|
if( document.f.marcacao_tipo[ i ].checked )
|
||||||
|
{
|
||||||
|
checked = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( checked == -1 )
|
||||||
|
{
|
||||||
|
alert( "Tem que escolher o tipo de marcação." );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return isValid( document.f.data, 0 ) && ( checked == 1 || isValid( document.f.hora, 1 ) );
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<body>
|
||||||
|
<form method='post' action='/siprpWeb/schedule' name='f'>
|
||||||
|
<table class='text'>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
Marcação para:<br>
|
||||||
|
$funcionario
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
<input type='radio' id='marcacao_tipo' name='marcacao_tipo' value='Consulta' onclick='document.getElementById( "hora" ).disabled = false;'>Consulta
|
||||||
|
<input type='radio' id='marcacao_tipo' name='marcacao_tipo' value='Exame' onclick='document.getElementById( "hora" ).disabled = true;'>Exame
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Data:</td><td><input type='text' id='data' name='data'>dd/mm/aaaa</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Hora:</td><td><input type='text' id='hora' name='hora'>hh:mm</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
Nota: a marcação está sujeita a confirmação via email.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
<input type='submit' value='Marcar' onclick='return validateForm()'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Marcação de consulta / exame</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body class='text'>
|
||||||
|
Ocorreu um erro a enviar o pedido de marcação.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Sessão expirou</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body class='text'>
|
||||||
|
A sua sessão expirou. Para efectuar uma marcação, autentique-se novamente.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Medicina</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style="background-color: transparent;">
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;">
|
||||||
|
medicina do trabalho<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;"><iframe
|
||||||
|
name="frame_3" src="conteudos/medicina_text.html" marginwidth="0"
|
||||||
|
marginheight="0" allowtransparency="true" frameborder="0" height="200"
|
||||||
|
width="100%"></iframe><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Notícias</title>
|
||||||
|
<link rel="stylesheet" href="/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body class="noticias">
|
||||||
|
$noticias
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style="background-color: transparent;">
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;">
|
||||||
|
política de qualidade e apoio administrativo<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;"><iframe
|
||||||
|
name="frame_3" src="conteudos/politica_text.html" marginwidth="0"
|
||||||
|
marginheight="0" allowtransparency="true" frameborder="0" height="200"
|
||||||
|
width="100%"></iframe><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
Empresa: $empresa<br>
|
||||||
|
<br>
|
||||||
|
Pedido de envio de relatório do ano: $ano<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Envio de dados do relatório anual</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body class='text'>
|
||||||
|
O pedido foi enviado com sucesso.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Envio de dados do relatório anual</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body class='text'>
|
||||||
|
Ocorreu um erro a enviar o pedido.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Pedido de dados do relatório anual</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<script language="javascript" src="/siprpWeb/html/css/funcs.js"></script>
|
||||||
|
<script>
|
||||||
|
function validateForm()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
//return isValid( document.f.data, 0 );
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<body>
|
||||||
|
<form method='post' action='/siprpWeb/relatorio' name='f'>
|
||||||
|
<table class='text'>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
Pedido de dados do relatório anual
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Ano pretendido:</td><td><input type='text' id='ano' name='ano'></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan='2'>
|
||||||
|
<input type='submit' value='Enviar Pedido' onclick='return validateForm()'>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Sessão expirou</title>
|
||||||
|
<link rel="stylesheet" href="/siprpWeb/html/css/style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body class='text'>
|
||||||
|
A sua sessão expirou. Para efectuar o pedido, autentique-se novamente.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style='background-color: transparent'>
|
||||||
|
<table border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><iframe name="frame_2" src="servicos_compl.html"
|
||||||
|
marginwidth="0" marginheight="0" frameborder="0" height="249"
|
||||||
|
width="588" allowtransparency='true'></iframe><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="font-weight: bold;"><a class="big"
|
||||||
|
href="servicos_compl.html" target="frame_2">-Serviços
|
||||||
|
Complementares</a><br>
|
||||||
|
<a class="big" href="medicina.html" target="frame_2">-Medicina do
|
||||||
|
Trabalho</a><br>
|
||||||
|
<a class="big" href="politica.html" target="frame_2">-Política de
|
||||||
|
Qualidade e Apoio Administrativo</a><br>
|
||||||
|
<a class="big" href="higiene.html" target="frame_2">-Higiene e
|
||||||
|
Segurança</a> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Serviços</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style="background-color: transparent;">
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;">
|
||||||
|
serviços complementares<br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;"><iframe
|
||||||
|
name="frame_3" src="conteudos/servicos_compl_text.html"
|
||||||
|
marginwidth="0" marginheight="0" allowtransparency="true"
|
||||||
|
frameborder="0" height="200" width="100%"></iframe><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||||
|
<title>SIPRP - Apresentação</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<body style="background-color: transparent;">
|
||||||
|
<table style="width: 588px; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title"
|
||||||
|
style="background: transparent url(images/texto_topo.gif) no-repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 588px; height: 29px; vertical-align: top;">
|
||||||
|
a
|
||||||
|
siprp</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 588px; vertical-align: top;">
|
||||||
|
<table style="width: 100%; text-align: left;" border="0"
|
||||||
|
cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"><br>
|
||||||
|
</td>
|
||||||
|
<td class="text" style="vertical-align: top;"><iframe
|
||||||
|
name="_ifrm" src="conteudos/siprp_text.html" marginwidth="0"
|
||||||
|
marginheight="0" allowtransparency="true" frameborder="0" height="277"
|
||||||
|
width="100%"></iframe><br>
|
||||||
|
</td>
|
||||||
|
<td style="width: 2px;"><br>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
style="width: 3px; background-color: rgb(120, 155, 181);"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
style="width: 588px; height: 13px; vertical-align: top; background-image: url(images/texto_base.gif); background-repeat: no-repeat;"><br>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,396 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
||||||
|
<title>SIPRP</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<style>
|
||||||
|
body
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bold
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
td
|
||||||
|
{
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.asd
|
||||||
|
{
|
||||||
|
border-width: 1px 1px 1px 1px;
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.title
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.text
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.noticias
|
||||||
|
{
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.footer
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 8pt;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link,
|
||||||
|
a:visited,
|
||||||
|
a:active
|
||||||
|
{
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover
|
||||||
|
{
|
||||||
|
color: #C13F45;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.text:link,
|
||||||
|
a.text:visited,
|
||||||
|
a.text:active
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.text:hover
|
||||||
|
{
|
||||||
|
color: #C13F45;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.copy:link,
|
||||||
|
a.copy:visited,
|
||||||
|
a.copy:active
|
||||||
|
{
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 8pt;
|
||||||
|
font-weight: normal;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.box5
|
||||||
|
{
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0px 1px 1px 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.box6
|
||||||
|
{
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0px 1px 1px 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script language="javascript" src="/siprpWeb/html/css/funcs.js"></script>
|
||||||
|
<script>
|
||||||
|
function marcacaoWindow()
|
||||||
|
{
|
||||||
|
m_wnd = window.open( "schedule?" + Math.random(), "marcacao_window", "menubar=0, resizeable=0, width=400, height=250, top=100, left=450" );
|
||||||
|
m_wnd.focus();
|
||||||
|
}
|
||||||
|
function marcacaoConsultaWindow()
|
||||||
|
{
|
||||||
|
m_wnd = window.open( "schedule?consulta", "marcacao_window", "menubar=0, resizeable=0, width=400, height=250, top=100, left=450" );
|
||||||
|
m_wnd.focus();
|
||||||
|
}
|
||||||
|
function marcacaoExamesWindow()
|
||||||
|
{
|
||||||
|
m_wnd = window.open( "schedule?exames", "marcacao_window", "menubar=0, resizeable=0, width=400, height=250, top=100, left=450" );
|
||||||
|
m_wnd.focus();
|
||||||
|
}
|
||||||
|
function pedidoRelatorioWindow()
|
||||||
|
{
|
||||||
|
m_wnd = window.open( "relatorio?" + Math.random(), "pedido_window", "menubar=0, resizeable=0, width=400, height=250, top=100, left=450" );
|
||||||
|
m_wnd.focus();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<body>
|
||||||
|
<table style="width: 760px; height: 623px; background-image: url(/siprpWeb/html/images/fundo.jpg); background-repeat: no-repeat;" align='center' >
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 623px; width: 20px;"><br></td>
|
||||||
|
<td style="vertical-align: top; width: 760px; height: 623px;">
|
||||||
|
<table style="text-align: center; width: 740px; height: 230px;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 200px; vertical-align: top;" colspan="7"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<!--td style="width: 45px; vertical-align: top;"></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a href="index.html" target="_blank">a SIPRP</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a href="html/frame_servicos.html" target="_blank">serviços</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a href="html/frame_clientes.html" target="_blank">clientes</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a href="html/frame_contactos.html" target="_blank">contactos</a></td>
|
||||||
|
<td style="width: 120px; vertical-align: top;"><a href="html/frame_links.html" target="_blank">links</a></td>
|
||||||
|
<td> </td-->
|
||||||
|
<!-- <td style="width: 120px; vertical-align: top;"><a href="html/frame_relatorio.html" target="_blank">relatório</a></td>-->
|
||||||
|
<td style="color: white; width: 120px; vertical-align: top; text-align: left"> $userName </td>
|
||||||
|
#if( $userRole != "manager" )
|
||||||
|
<td style='color: white; vertical-align: top; text-align: right'> </td>
|
||||||
|
<td style='color: white; vertical-align: top; text-align: right'><a href="javascript:pedidoRelatorioWindow();">pedido de relatório anual...</a></td>
|
||||||
|
#end
|
||||||
|
<td style='color: white; vertical-align: top; text-align: right'><a href="/siprpWeb/">logout » </a></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table style="text-align: left; width: 740px; height: 367px;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style='vertical-align: top;'>
|
||||||
|
<td>
|
||||||
|
<table cellspacing='0' cellpadding='0'>
|
||||||
|
<tr>
|
||||||
|
<!-- titulo -->
|
||||||
|
<td colspan='5' class='title' style="background: url(/siprpWeb/html/images/topo_740.gif); width: 740px; height: 29px; vertical-align: top;"> acesso restrito</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 3px; background-color: #789BB5;"></td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<!-- escolher empresa -->
|
||||||
|
<td style='width: 728; vertical-align: top;'>
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0'>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
#if( $userRole == "manager" && $empresa_nome )
|
||||||
|
<a class='text' href="/siprpWeb/?empresas">Empresa:</a> $!empresa_nome
|
||||||
|
#else
|
||||||
|
Empresa: $!empresa_nome
|
||||||
|
#end
|
||||||
|
</td>
|
||||||
|
<!--td class='text' style='text-align: right; background: url(/siprpWeb/html/images/logout.gif) no-repeat;' width='140' height='45' rowspan='3'>
|
||||||
|
$userName <br>
|
||||||
|
<a href="/siprpWeb/">Logout » </a><br>
|
||||||
|
</td-->
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
#if( $estabelecimento_id )
|
||||||
|
<a class='text' href="/siprpWeb/?$empresa_id">Estabelecimento</a>: $!estabelecimento_nome
|
||||||
|
#else
|
||||||
|
Estabelecimento:
|
||||||
|
#end
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
#if( $query == "trabalhador" )
|
||||||
|
<a class='text' href='/siprpWeb/?$empresa_id/$estabelecimento_id'>Funcionário</a>: $!funcionario.nome - Data de Nascimento: $!funcionario.data_nascimento
|
||||||
|
#else
|
||||||
|
Funcionário:
|
||||||
|
#end
|
||||||
|
|
||||||
|
#if( $query == "trabalhador" )
|
||||||
|
|
||||||
|
#end
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<td style="width: 3px; background-color: #789BB5;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<!-- base -->
|
||||||
|
<td colspan='5' class='title' style="background: url(/siprpWeb/html/images/base_740.gif) repeat; width: 740px; height: 13px; vertical-align: top;"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
#if( $query == "empresas" )
|
||||||
|
#set( $listaTitle = "empresas" )
|
||||||
|
#elseif( $query == "estabelecimentos" )
|
||||||
|
#set( $listaTitle = "estabelecimentos" )
|
||||||
|
#elseif( $query == "trabalhadores" || $query == "trabalhadores_tudo" || $query == "trabalhadores_pendentes" )
|
||||||
|
#set( $listaTitle = "funcionários:" )
|
||||||
|
#set( $lista_funcionarios = 1 )
|
||||||
|
#else ##( $query == "trabalhador" )
|
||||||
|
#set( $listaTitle = "funcionário" )
|
||||||
|
#end
|
||||||
|
<!-- LISTA -->
|
||||||
|
<tr >
|
||||||
|
#if( $lista_funcionarios )
|
||||||
|
|
||||||
|
<!-- titulo -->
|
||||||
|
<td colspan='5' class='title' style="background: url(/siprpWeb/html/images/topo_740.gif); width: 740px; height: 29px; vertical-align: top;">
|
||||||
|
<table cellpadding='0' cellspacing='0'>
|
||||||
|
<tr style="vertical-align: top;">
|
||||||
|
<td colspan='1' class='title'> funcionários:</td>
|
||||||
|
<td style='color: white; vertical-align: top; text-align: left'> <a href="/siprpWeb/?$empresa_id/$estabelecimento_id">todos</a></td>
|
||||||
|
<td style='color: white; vertical-align: top; text-align: left'> <a href="/siprpWeb/?$empresa_id/$estabelecimento_id/trabalhadores_tudo">com ficha de aptidão</a></td>
|
||||||
|
<td style='color: white; vertical-align: top; text-align: left'> <a href="/siprpWeb/?$empresa_id/$estabelecimento_id/trabalhadores_pendentes">com pendências</a></td>
|
||||||
|
<td style='color: white; vertical-align: top; text-align: left' align='right'> <a href='/siprpWeb/?$empresa_id/$estabelecimento_id/${query}_print' target="_blank">imprimir</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
#else
|
||||||
|
<td colspan='5' class='title' style="background: url(/siprpWeb/html/images/topo_740.gif); width: 740px; height: 29px; vertical-align: top;"> $listaTitle</td>
|
||||||
|
#end
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 2px; background-color: #789BB5;"></td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<td>
|
||||||
|
#if ($query == "trabalhador")
|
||||||
|
(*)ECD - Exames Complementares de Diagnóstico<br><br>
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0'>
|
||||||
|
<tr align='center' style='background-color: #789BB5;'>
|
||||||
|
<td width='14%' style='color: #ffffff'>Último ECD(*)</td>
|
||||||
|
<td width='14%' style='color: #ffffff'>Realizado</td>
|
||||||
|
<td width='14%' style='color: #ffffff'>Última Consulta</td>
|
||||||
|
<td width='14%' style='color: #ffffff'>Realizada</td>
|
||||||
|
<td width='14%' style='color: #ffffff'>Resultado</td>
|
||||||
|
<td width='14%'><a href='javascript:marcacaoExamesWindow();'>Próximo ECD(*)</a></td>
|
||||||
|
<td width='14%'><a href='javascript:marcacaoConsultaWindow();'>Próxima Consulta</a></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr align='center'>
|
||||||
|
<td class='box5'>$!funcionario.ultimo_exame </td>
|
||||||
|
<td class='box6'>$!funcionario.realizado </td>
|
||||||
|
<td class='box6'>$!funcionario.ultima_consulta </td>
|
||||||
|
<td class='box6'>$!funcionario.realizada </td>
|
||||||
|
<td class='box6'>$!funcionario.resultado </td>
|
||||||
|
<td class='box6'>$!funcionario.proximo_exame </td>
|
||||||
|
<td class='box6'>$!funcionario.proxima_consulta </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
#elseif( $query == "trabalhadores" )
|
||||||
|
(*)ECD - Exames Complementares de Diagnóstico<br><br>
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0' border="0">
|
||||||
|
<tr style='background-color: #789BB5; color: #ffffff;'>
|
||||||
|
<td width='55%' align='left' > Nome</td>
|
||||||
|
<td width='15%' align='center' >Último ECD(*)</td>
|
||||||
|
<td width='15%' align='center' >Última consulta</td>
|
||||||
|
<td width='15%' align='center' >Próxima consulta</td>
|
||||||
|
</tr>
|
||||||
|
#foreach( $element in $v1 )
|
||||||
|
#set ( $counter = $velocityCount - 1 )
|
||||||
|
#set ( $dados_trabalhador = $v2.get($counter) )
|
||||||
|
<tr align='center'>
|
||||||
|
<td class='box5'><a class='text' href="$v1.get($counter)">$dados_trabalhador.Nome</a> </td>
|
||||||
|
<td class='box6'>$dados_trabalhador.ultimo_exame </td>
|
||||||
|
<td class='box6'>$dados_trabalhador.ultima_consulta </td>
|
||||||
|
<td class='box6'>$dados_trabalhador.proxima_consulta </td>
|
||||||
|
</tr>
|
||||||
|
#end
|
||||||
|
</table>
|
||||||
|
#elseif( $query == "trabalhadores_tudo" )
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0' border="0">
|
||||||
|
<tr style='background-color: #789BB5; color: #ffffff;'>
|
||||||
|
<td width='75%' align='left' > Nome</td>
|
||||||
|
<td width='25%' align='center' >Data da Ficha de Aptidão</td>
|
||||||
|
</tr>
|
||||||
|
#foreach( $element in $v1 )
|
||||||
|
#set ( $counter = $velocityCount - 1 )
|
||||||
|
#set ( $dados_trabalhador = $v2.get($counter) )
|
||||||
|
<tr>
|
||||||
|
<td class='box5' align='left' ><a class='text' href="$v1.get($counter)"> $dados_trabalhador.Nome</a></td>
|
||||||
|
<td class='box6' align='center' >$dados_trabalhador.Data </td>
|
||||||
|
</tr>
|
||||||
|
#end
|
||||||
|
</table>
|
||||||
|
#elseif( $query == "trabalhadores_pendentes" )
|
||||||
|
<IMG SRC="/siprpWeb/html/images/red.gif"> - pendente
|
||||||
|
<IMG SRC="/siprpWeb/html/images/yellow.gif"> - marcado
|
||||||
|
<IMG SRC="/siprpWeb/html/images/green.gif"> - tratado <br>
|
||||||
|
(*)ECD - Exames Complementares de Diagnóstico<br><br>
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0' border="0">
|
||||||
|
<tr style='background-color: #789BB5; color: #ffffff;'>
|
||||||
|
<td width='75%' align='left' > Nome</td>
|
||||||
|
<td width='12%' align='center' >ECD(*)</td>
|
||||||
|
<td width='12%' align='center'>Consulta</td>
|
||||||
|
</tr>
|
||||||
|
#foreach( $element in $v1 )
|
||||||
|
#set ( $counter = $velocityCount - 1 )
|
||||||
|
#set ( $dados_trabalhador = $v2.get($counter) )
|
||||||
|
<tr>
|
||||||
|
<td class='box5' align='left' ><a class='text' href="$v1.get($counter)"> $dados_trabalhador.Nome</a></td>
|
||||||
|
<td class='box6' align='center' ><IMG SRC="/siprpWeb/html/images/${dados_trabalhador.Exame}.gif"></td>
|
||||||
|
<td class='box6' align='center' ><IMG SRC="/siprpWeb/html/images/${dados_trabalhador.Consulta}.gif"></td>
|
||||||
|
</tr>
|
||||||
|
#end
|
||||||
|
</table>
|
||||||
|
#else
|
||||||
|
#foreach( $element in $v1 )
|
||||||
|
#set ( $counter = $velocityCount - 1 )
|
||||||
|
<a class='text' href="$v1.get($counter)">$v2.get($counter)</a><br>
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<td style="width: 3px; background-color: #789BB5;"></td>
|
||||||
|
</tr>
|
||||||
|
<!-- !LISTA -->
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<!-- base -->
|
||||||
|
<td colspan='5' class='title' style="background: url(/siprpWeb/html/images/base_740.gif) repeat; width: 740px; height: 13px; vertical-align: top;"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class='footer' style="width: 740px; height: 33px; background-image:url(/siprpWeb/html/images/rodape.jpg); background-position: right center; background-repeat: no-repeat;" rowspan="1" colspan="2">Site optimizado para 800x600 - Todos os direitos reservados Sociedade Ibérica de Prevenção de Riscos Profissionais <br>Desenvolvido por <a class="copy" href="http://www.evolute.pt">Evolute - Consultoria Informática</a> e <a class="copy" href="http://www.2-3design.com/">2/3 Design</a> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,284 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
||||||
|
<title>SIPRP</title>
|
||||||
|
<link rel='icon' href='/html/images/siprp_simple_logo.gif'>
|
||||||
|
</head>
|
||||||
|
<style>
|
||||||
|
body
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bold
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
td
|
||||||
|
{
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.asd
|
||||||
|
{
|
||||||
|
border-width: 1px 1px 1px 1px;
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.title
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.text
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.noticias
|
||||||
|
{
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.footer
|
||||||
|
{
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 8pt;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link,
|
||||||
|
a:visited,
|
||||||
|
a:active
|
||||||
|
{
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover
|
||||||
|
{
|
||||||
|
color: #C13F45;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.text:link,
|
||||||
|
a.text:visited,
|
||||||
|
a.text:active
|
||||||
|
{
|
||||||
|
color: #497895;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.text:hover
|
||||||
|
{
|
||||||
|
color: #C13F45;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.copy:link,
|
||||||
|
a.copy:visited,
|
||||||
|
a.copy:active
|
||||||
|
{
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 8pt;
|
||||||
|
font-weight: normal;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.box5
|
||||||
|
{
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0px 1px 1px 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.box6
|
||||||
|
{
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0px 1px 1px 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body onload="javascript:print();">
|
||||||
|
<table style="width: 760px; height: 623px;" align='center' border='0' >
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 623px; width: 20px;"><br></td>
|
||||||
|
<td style="vertical-align: top; width: 760px; height: 623px;">
|
||||||
|
<table style="text-align: center; width: 740px; height: 100px;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="height: 100px; vertical-align: top;" colspan="7">
|
||||||
|
<img src="/siprpWeb/html/images/siprp_logo.jpg" align="center">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table style="text-align: left; width: 740px; height: 367px;" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style='vertical-align: top;'>
|
||||||
|
<td>
|
||||||
|
<table cellspacing='0' cellpadding='0' border='0'>
|
||||||
|
<tr>
|
||||||
|
<!-- titulo -->
|
||||||
|
<td colspan='5' class='title' style="width: 740px; height: 29px; vertical-align: top;"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 3px;"></td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<!-- escolher empresa -->
|
||||||
|
<td style='width: 728; vertical-align: top;'>
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0'>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<B>Empresa:</b> $!empresa_nome
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<b>Estabelecimento:</b> $!estabelecimento_nome
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<td style="width: 3px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<!-- base -->
|
||||||
|
<td colspan='5' class='title' style="width: 740px; height: 13px; vertical-align: top;"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
#if( $query == "trabalhadores" )
|
||||||
|
#set( $listaTitle = "Todos os Funcionários" )
|
||||||
|
#elseif( $query == "trabalhadores_tudo" )
|
||||||
|
#set( $listaTitle = "Funcionários com Tudo Resolvido" )
|
||||||
|
#elseif( $query == "trabalhadores_pendentes" )
|
||||||
|
#set( $listaTitle = "Funcionários com Pendências" )
|
||||||
|
#end
|
||||||
|
<!-- LISTA -->
|
||||||
|
<tr >
|
||||||
|
<td colspan='5' style="width: 740px; height: 29px; vertical-align: top;"> <B>$listaTitle</B></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width: 2px;"></td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<td>
|
||||||
|
#if( $query == "trabalhadores" )
|
||||||
|
(*)ECD - Exames Complementares de Diagnóstico<br><br>
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0' border="0">
|
||||||
|
<tr>
|
||||||
|
<td width='55%' align='left' > Nome</td>
|
||||||
|
<td width='15%' align='center' >Último ECD(*)</td>
|
||||||
|
<td width='15%' align='center' >Última consulta</td>
|
||||||
|
<td width='15%' align='center' >Próxima consulta</td>
|
||||||
|
</tr>
|
||||||
|
#foreach( $element in $v1 )
|
||||||
|
#set ( $counter = $velocityCount - 1 )
|
||||||
|
#set ( $dados_trabalhador = $v2.get($counter) )
|
||||||
|
<tr align='center'>
|
||||||
|
<td align='left'><a class='text' href="$v1.get($counter)">$dados_trabalhador.Nome</a> </td>
|
||||||
|
<td align='center'>$dados_trabalhador.ultimo_exame </td>
|
||||||
|
<td align='center'>$dados_trabalhador.ultima_consulta </td>
|
||||||
|
<td align='center'>$dados_trabalhador.proxima_consulta </td>
|
||||||
|
</tr>
|
||||||
|
#end
|
||||||
|
</table>
|
||||||
|
|
||||||
|
#elseif( $query == "trabalhadores_tudo" )
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0' border="0">
|
||||||
|
<tr>
|
||||||
|
<td width='75%' align='left' > Nome</td>
|
||||||
|
<td width='25%' align='center' >Data da Ficha de Aptidão</td>
|
||||||
|
</tr>
|
||||||
|
#foreach( $element in $v1 )
|
||||||
|
#set ( $counter = $velocityCount - 1 )
|
||||||
|
#set ( $dados_trabalhador = $v2.get($counter) )
|
||||||
|
<tr>
|
||||||
|
<td align='left' > $dados_trabalhador.Nome</td>
|
||||||
|
<td align='center' >$dados_trabalhador.Data </td>
|
||||||
|
</tr>
|
||||||
|
#end
|
||||||
|
</table>
|
||||||
|
#elseif( $query == "trabalhadores_pendentes" )
|
||||||
|
<!--<IMG SRC="/siprpWeb/html/images/red.gif"> - pendente
|
||||||
|
<IMG SRC="/siprpWeb/html/images/yellow.gif"> - marcado
|
||||||
|
<IMG SRC="/siprpWeb/html/images/green.gif"> - tratado <br>-->
|
||||||
|
(*)ECD - Exames Complementares de Diagnóstico<br><br>
|
||||||
|
<table width='100%' cellspacing='0' cellpadding='0' border="0">
|
||||||
|
<tr>
|
||||||
|
<td width='75%' align='left' > Nome</td>
|
||||||
|
<td width='12%' align='center' >ECD(*)</td>
|
||||||
|
<td width='12%' align='center'>Consulta</td>
|
||||||
|
</tr>
|
||||||
|
#foreach( $element in $v1 )
|
||||||
|
#set ( $counter = $velocityCount - 1 )
|
||||||
|
#set ( $dados_trabalhador = $v2.get($counter) )
|
||||||
|
<tr>
|
||||||
|
<!--<td align='left' ><a class='text' href="$v1.get($counter)"> $dados_trabalhador.Nome</a></td>
|
||||||
|
<td align='center' ><IMG SRC="/siprpWeb/html/images/${dados_trabalhador.Exame}.gif"></td>
|
||||||
|
<td align='center' ><IMG SRC="/siprpWeb/html/images/${dados_trabalhador.Consulta}.gif"></td>-->
|
||||||
|
<td align='left' ><a class='text' href="$v1.get($counter)"> $dados_trabalhador.Nome</a></td>
|
||||||
|
<td align='center' >$dados_trabalhador.Exame_estado</td>
|
||||||
|
<td align='center' >$dados_trabalhador.Consulta_estado</td>
|
||||||
|
</tr>
|
||||||
|
#end
|
||||||
|
</table>
|
||||||
|
#end
|
||||||
|
</td>
|
||||||
|
<td style="width: 4px;"></td>
|
||||||
|
<td style="width: 3px;"></td>
|
||||||
|
</tr>
|
||||||
|
<!-- !LISTA -->
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
/trunk/html/images/
|
||||||
|
/trunk/html/html/conteudos/Images/
|
||||||
|
/trunk/html/html/images/
|
||||||
|
/trunk/html/conteudos/Images/
|
||||||
Loading…
Reference in new issue