Blog de Mario Cezzare Angelicola Chiodi.
Analista de Sistemas, Produtor Musical, Professor, Consultor, entre outras atividades.
+ Quem :
https://www.mcezzare.com.br/ |
https://www.linkedin.com/in/mcezzare/ |
https://github.com/mcezzare | GitHub
+ info musica em :
https://www.insonicmusic.com/ | http://myspace.com/insonic | https://www.facebook.com/insonicmusic | http://soundcloud.com/insonic | http://myspace.com/subsonictrance
Olá, pesquisando na web, achei várias tentativas de colorir uma ou mais linhas de um JTable, mas não tão flexíveis como o que venho apresentar nesse POST.
Uma opção também é usar o Tema Nimbus que já aplica isso nas tabelas.
Eu uso essa classe em meus projetos p/ alternar a cor das linhas de uma tabela, facilitando a visualização do usuário na grade de Dados.
Exemplo :
tabela carregada sem itens selecionados
e ao clicar no checkbox da coluna ATIVO, a linha tem sua cor e fonte alterado, destacando o item selecionado, porém observação: quando seleciona a opção ativo, a linha continua como no exemplo abaixo na linha 5 pois está usando o renderer padrão da tabela.
tabela com os itens selecionados
veja em funcionamento :
http://mario.portari.com.br/~surfer/blog/colorir_jtable.swf
Classe ColorRender que extende a classe DefaultTableCellRenderer
/*
* Colorindo jTable.java
* Pintas as tabelas alterando as linhas
* Destaca uma linha se o checkbox da linha for selecionado
* Author : Mario Cezzare Angelicola Chiodi
* mcezzare@gmail.com
*/
package lib;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
public class ColorRender extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(
JTable table, Object value,
boolean isSelected, boolean hasFocus,
int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected,
hasFocus, row, column);
// seta o resultado p/ falso porque isso sera usado em varias Jtables do sistema
boolean result = false;
try{
// no nosso exemplo
if (table.getName() != null) { // p/ não escrever um null cada vez que carregar uma célula
if (table.getName().equals("jTable1")) {
result = (Boolean) table.getModel().getValueAt(row, 3);
}
if (table.getName().equals("titulosAutorizacao")) {
result = (Boolean) table.getModel().getValueAt(row, 6);
}
}
}
catch (java.lang.NullPointerException ex){
System.out.println(ex.getMessage());
}
//se for uma linha selecionada
if (isSelected) {
setBackground(table.getSelectionBackground());
setForeground(table.getSelectionForeground());
} else {
// se o checkbox estiver selecionado
// pinta a linha inteira
if (result) {
setBackground(Color.YELLOW);
setForeground(Color.RED);
setFont(new Font("Verdana",Font.BOLD,10));
} else {
// se não , colore alternado as linhas
if (row % 2 == 0) {
setBackground(Color.LIGHT_GRAY);
setForeground(Color.black);
} else {
setBackground(Color.WHITE);
setForeground(Color.black);
}
}
}
return this;
}
}
Frame testTable
//Colorindo jTable.java
//Author : Mario Cezzare Angelicola Chiodi
// mcezzare@gmail.com
package tests;
import javax.swing.table.DefaultTableModel;
import lib.ColorRender;
public class testTable extends javax.swing.JFrame {
/**
* Creates new form testTable
*/
public testTable() {
initComponents();
carregaTabela();
}
public final DefaultTableModel modelo =new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"ID", "NOME", "EMAIL", "ATIVO"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class
};
boolean[] canEdit = new boolean [] {
false, false, false, true
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
};
private void carregaTabela() {
// apenas para dar carga na tabela
String [] nomes={"AAA","BBB",
"CCC","DDD",
"EEE","FFF",
"FFF","HHH"
};
for (int i=0;i<8;i++){
Object[] row = new Object[4];
row[0]=i;
row[1]=nomes[i];
row[2]=nomes[i].toLowerCase()+"@email.org";
row[3]=false;
modelo.addRow(row);
}
jTable1.setModel(modelo);
// fim da carga
// a grande manha para funcionar, especifique um nome p/ a JTable
jTable1.setName("jTable1");
// aplica o ColorRender na tabela
jTable1.setDefaultRenderer(Object.class, new ColorRender());
jLbTotal.setText(jTable1.getRowCount()+"");
}
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
jLbTotal = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Teste Colorir tabela");
jScrollPane1.setViewportView(jTable1);
jLabel1.setText("Total de Usuários:");
jLbTotal.setText("0");
jLbTotal.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
jLabel2.setForeground(new java.awt.Color(0, 0, 255));
jLabel2.setText("exemplo de Mario Cezzare - mcezzare@gmail.com");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addContainerGap())
.add(layout.createSequentialGroup()
.add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLbTotal)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 23, Short.MAX_VALUE)
.add(jLabel2)
.add(14, 14, 14))))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 222, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel1)
.add(jLbTotal)
.add(jLabel2))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
// Set the Nimbus look and feel
//* If Nimbus (introduced in Java SE 6) is not available, stay with the
//* default look and feel. For details see
//* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
//
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(testTable.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(testTable.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(testTable.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(testTable.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new testTable().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLbTotal;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
// End of variables declaration
}
Olá, como não achei uma calculadora que se atendesse minha necessidade p/ implementar como JInternalFrame, decidi fazer uma.
Este exemplo faz parte de um software de controle financeiro proprietário, que uma das opções contém uma tela p/ controle de movimentação de conta com 4 abas:
Entrada
Transferência
Retirada
Cheque
veja a tela que chama a calculadora :
o ícone calculadora ao lado do campo valor que chama o calculadora.java
Esta Tela é um exemplo de uma aplicação MDI que contém um JDesktop principal e JInternalFrames como as janelas. A calculadora será adicionada ao JDesktop para uso.
Trecho da Classe JIRelatorioConta - que é o Frame de movimentação e chama as calculadoras:
--------------------------------------------------------------------------------
só p/ constar. Essa classe FormUtils, eu uso p/ limpar os campos, listas, tabelas, etc
segue abaixo essa classe :
package lib;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
public class FormUtils {
public FormUtils() {
}
public void LimpaCampo(JTextField T) {
T.setText(null);
}
public void LimpaCampo(JTextArea T) {
T.setText(null);
T.setText("");
}
public void LimpaCampo(JLabel L) {
L.setText(null);
L.setToolTipText(null);
}
public void LimpaCampo(JList L) {
L.removeAll();
}
public void LimpaCampo(JComboBox C) {
if (C.isEnabled() && C.isValid()) {
C.removeAllItems();
}
}
public void LimpaCombo(JComboBox C) {
C.removeAllItems();
}
public void LimpaCampo(JCheckBox C) {
C.setSelected(false);
}
public void limpaTabela(JTable J) throws Exception {
int totalLinha = J.getRowCount();
int totalColuna = J.getColumnCount();
if (totalLinha > -1) {
for (int i = 0; i < totalLinha; i++) {
for (int j = 0; j < totalColuna; j++) {
J.getModel().setValueAt(null, i, j);
}
}
}
}
public void limpaTabela(JTable J, DefaultTableModel M) throws Exception {
int totalLinha = J.getRowCount();
int totalColuna = J.getColumnCount();
for (int i = 0; i <= M.getRowCount(); i++) {
try {
M.removeRow(i);
} catch (java.lang.ArrayIndexOutOfBoundsException E) {
}
}
if (totalLinha > -1) {
for (int i = 0; i < totalLinha; i++) {
for (int j = 0; j < totalColuna; j++) {
try {
J.getModel().setValueAt(null, i, j);
M.removeRow(i);
} catch (Exception E) {// java.lang.ArrayIndexOutOfBoundsException E) {
}
}
}
}
}
}
/* Dentro de um software de RH, na parte de datas de experiência, deve ser calculado 30 e 45 dias a partir de uma data inicial */ import java.text.SimpleDateFormat; import java.util.Calendar;
/** * * @author Mario Cezzare Angelicola Chiodi mcezzare@gmail.com */
public class testeData {
private static void calculaPeriodoExperiencia(String dataInicial,int periodo, int dias) {
break; // case 2 , se forem outros campos texto no form } }
public static void main(String args[]) { String dataInicial = "01/01/2000"; calculaPeriodoExperiencia(dataInicial,1, 29); // q são 30 dias , mas conta a data inicio calculaPeriodoExperiencia(dataInicial,1, 44);// q são 45 dias , mas conta a data inicio } }
Esse script pode ser usado p/ fazer backups diários de todas as bases postgres
exemplo no crontab diariamente as 23:50
50 23 * * * /scripts/backup_pgsql.sh
#!/bin/sh
# Script to backup postgres databases
# Create a complete bkp with all databses and a separated for each one
# Author: Mario Cezzare mcezzare@gmail.com
# last update on Wed Dec 29 16:24:11 on ttys005
PGDUMPALL="$(which pg_dumpall)"
PSQL="$(which psql)"
GZIP="$(which gzip)"
x=`date '+BACKUP-%d.%m.%y'`
separator="-----------------------------------"
path_backup=/backup/pgsql/
notify="sysadmin@email.com.br"
cd $path_backup
mkdir $x
path_backup="$path_backup/$x"
echo $x
now=`date '+%d.%m.%y %H:%M:%S'`
##################################################################################
# PART 1 - LOGS
##################################################################################
echo " starting at $x $now" >> $path_backup/pgsql-databases-$x.log
##################################################################################
# PART 2 - ALL DATAL
##################################################################################
$PGDUMPALL -U postgres | $GZIP -c > $path_backup/$x-all-pg.pgsql.gz
##################################################################################
# PART 3 - EACH ONE
##################################################################################
DIR=$path_backup
[ ! $DIR ] && mkdir -p $DIR || :
LIST=$($PSQL -U postgres -l | awk '{ print $1}' | grep -vE '^-|^List|^\(|^Name|template[0|1]')
for d in $LIST
do
echo "Dumping $d"
pg_dump -U postgres $d | $GZIP -c > $DIR/$d.pgsql.gz
now=`date '+%d.%m.%y %H:%M:%S'`
echo "$d em $now" >> $path_backup/pgsql-databases-$x.log
done
##################################################################################
# PART 1B - END LOGS
##################################################################################
echo " ending at $x $now" >> $path_backup/pgsql-databases-$x.log
##################################################################################
# PART 4 - NOTIFICATIONS
##################################################################################
ls -aloh $path_backup | mail -s BACKUP_POSTGRES_DATABASES $notify
Esse script pode ser usado p/ fazer backups diários de todas as bases mysql
exemplo no crontab diariamente as 23:50
50 23 * * * /scripts/backup_mysql.sh
como root no mysql de permissao de leitura p/ o usuario backup_operator
GRANT ALL ON *.* TO 'backup_operator'@'localhost'
#!/bin/sh
# Script to backup mysql databases
# Create a complete bkp with all databses and a separated for each one
# Author: Mario Cezzare mcezzare@gmail.com
# last update on Wed Dec 29 16:24:11 on ttys005
x=`date '+BACKUP-%d.%m.%y'`
now=`date '+%d.%m.%y %H:%M:%S'`
separator="-----------------------------------"
path_backup=/backup/mysql/
notify="sysadmin@email.com.br"
cd $path_backup
mkdir $x
path_backup="$path_backup/$x"
echo $x
##################################################################################
# PART 1 - LOGS
##################################################################################
echo " starting at $x $now" >> $path_backup/mysql_databases-$x.log
echo $separator
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
MYSQLUSER="backup_operator"
MYSQLPASSWD="senha_do_backup_operator"
MYSQLHOST="localhost"
GZIP="$(which gzip)"
##################################################################################
# PART 2 - ALL DATA
##################################################################################
echo "backup of mysql databases "
mysqldump --all-databases -h $MYSQLHOST -u $MYSQLUSER -p$MYSQLPASSWD | gzip -c > $path_backup/backup-all-mysql-$x.mysql.gz
##################################################################################
# PART 3 - EACH ONE
##################################################################################
DBS="$($MYSQL -u $MYSQLUSER -h $MYSQLHOST -p$MYSQLPASSWD -Bse 'show databases')"
for db in $DBS ; do
echo "backing up $db"
FILE="mysql_$db-$x.mysql.gz"
$MYSQLDUMP -u $MYSQLUSER -h $MYSQLHOST -p$MYSQLPASSWD $db | $GZIP -c > $path_backup/$FILE
now=`date '+%d.%m.%y %H:%M:%S'`
echo " $db at $x $now" >> $path_backup/mysql_databases-$x.log
done
##################################################################################
# PART 3 - EACH ONE
##################################################################################
now=`date '+%d.%m.%y %H:%M:%S'`
echo " ending at $x $now" >> $path_backup/mysql_databases-$x.log
##################################################################################
# PART 4 - NOTIFICATIONS
##################################################################################
ls -aloh $path_backup | mail -s BACKUP_MYSQL_DATABASES $notify
Mexendo em umas aplicações webs mais antigas por aqui, encontrei um script q desenvolvi há um tempo atras e que me custou um tempinho p/ fazer.
Resolvi compartilhá-lo.
Segue o código fonte abaixo , salve o como mcezzare_calendar.asp, ou como quiser, e aonde está o código <a href="http://REPLACE_YOUR_SITE/agenda_itens.php?data=<%=x%>/<%=mes%>/<%=ano%>" target="miolo"><%=x%></a>
1 - Acerte o link e o target caso esteja dentro de um frame ou o detalhe do evento esteja num iframe. se não remova o texto target="miolo".
2 - Este calendario pode ser usado p/ varios sites :
veja um exemplo chamando script dessa maneira na url :
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Option Explicit
'Mcezzare's Calendar
'mcezzare@gmail.com last update Mon Aug 9 10:21:23 on ttys000
'version 1.3 date Fri Nov 25 08:31:32 BRST 2005
'this file display a calendar in table acording to the variable data on url ?data=dd/mm/yy
'if no value given, the default system time (now) wiill be used
' use : http://your_domain.com/calendar_final.asp?data=01/3/2005&days=1-9-14-25-27
'this calendar is mathematically correct, just chnage the line Session.lcid = xxx to you timezone/language
'from the value data on url the script builds a ccalendar based on Year and Month
'If you want to flag some days
Dim mes_st,mes,dia_st,dia_ini,dia_fim,dtx,mes_fresco,data,mesname,proximomes,ano,dia,mesanterior
Dim link,linkano,linkano_prox,linkmes_prox,linkmes_ant,linkano_ant,linksmes_prox
Dim i,x,z
Dim days,days_aux,high_days, color,teste,check_high
Dim diasr, diasr_aux,writeaux
Dim aux_file
Session.lcid = 1046 ' pt-BR
if request("data") = "" then
data = now
else
data = request("data")
end if
if not isdate(data) then data = now
' date variables
mes_st = month(data)
mes = month(data)
mesname = monthname(mes)
dia_st=1
ano = year(data)
dia_ini = dateserial(ano,mes,1)
dia_fim =dateserial(ano,mes +1,1)-1
dtx =weekday(dateserial(ano,mes,dia_st))
mes_fresco = Ucase(Left(mesname,1)) & Lcase(right(mesname,len(mesname)-1))
' file name , you can give any name.
link = Request.ServerVariables("SCRIPT_NAME") & "?data=01/"
aux_file= "http://REPLACE_YOUR_SITE/agenda_itens.php"
' if there is a other file you want to save data on database for example, you can call this page for your site
' like this
proximomes = mes + 1
mesanterior= mes - 1
'tem q fazer um select case p/ o mes qdo for 01 e 12
linkano = ano
linkano_prox = ano
linkano_ant = ano
linkmes_ant = mes
linksmes_prox = mes
select case mes
case 1
linkano_ant = ano - 1
linkmes_ant = 12
linkmes_prox = mes + 1
case 12
linkano_prox= ano + 1
linkmes_prox = 1
linkmes_ant = mes -1
linkano_ant = ano
case else
linkano = ano
linkano_prox = ano
linkano_ant = ano
linkmes_ant = mes - 1
linkmes_prox = mes + 1
end select
days=Request("days")
days_aux = split(days,"-")
diasr= Request("dias")
diasr_aux = split(diasr,"-")
check_high = false
color = "#FFFFFF"
function testa(x)
testa = false
for z = lbound(days_aux) to Ubound(days_aux)
' if cdbl(days_aux(z)) = cdbl(x) then check_high = true
' if cdbl(days_aux(z)) = cdbl(x) then color = "#FF0000"
if cdbl(days_aux(z)) = cdbl(x) then testa = true
'response.write typename(vartype(days_aux(z))) & "-" & typename(vartype(x)) & " " & check_high & "<br>"
response.write cdbl(days_aux(z)) & "-" & cdbl(x) & " --> " & check_high & " " & color & "<br>"
'response.write z & "-" & days_aux(z) & "-" & x
next
end function
'
'high_days = high_days &
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Calendario</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="calendar.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
<!--
function pinta(x){
document.getElementById("calendar").bgColor= "#FFFF00";
}
function pintacel(x){
var f = document.form1;
var campo = x;
//document.form1.x.class='botao3';
//window.alert(document.getElementById(''+campo).value);
//document.getElementById(''+campo)
document.ids.cp1.color="#FFFF00";
}
function pintacelretorno(x){
var f = document.form1;
var campo = x;
document.ids.cp1.color="#6699FF";
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_changeProp(objName,x,theProp,theValue) { //v6.0
var obj = MM_findObj(objName);
if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
if (theValue == true || theValue == false)
eval("obj."+theProp+"="+theValue);
else eval("obj."+theProp+"='"+theValue+"'");
}
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="
<% for z = lbound(diasr_aux) to Ubound(diasr_aux)%>
<!-- <p>
mes : <% = mes %><br>
ano : <% = ano %><br>
primeiro dia da semana : <% = weekdayname(dtx) %><br>
primeiro dia do mes : <% = dia_ini %><br>
ultimo dia do mes : <% = dia_fim %><br>
dias selecionados : <% = days %>
<br>
<a href="#" onClick="pinta(1);">pinta</a> tabela<br>
<a href="#" onClick="pintacel('cp2');">pinta celula</a><br>
<a href="#" onClick="MM_changeProp('div2','','style.backgroundColor','#FFFF00','DIV')">cc
</a> <a href="#" onClick="MM_changeProp('cp2','','style.backgroundColor','#FFFF00','DIV')">cc </a> <a href="#" onClick="MM_changeProp('cp8','','style.backgroundColor','#FFFF00','DIV')">cc </a><br>
</p>
Select Case dtx 'day of week
case 1
color = "#FFFFFF"
for x = day(dia_ini) to day(dia_fim)
%>
<td> <div class="botao2" id="cp<%=x%>"><a href="<%=aux_file%>?data=<%=x%>/<%=mes%>/<%=ano%>" target="miolo"><%=x%></a></div></td>
<%
if x mod 7 =0 then response.write " </tr><tr align='center'>"
next
%>
<% case 2 %>
<td><div class="botao2" id="branco"></div></td>
<% for x = day(dia_ini) to day(dia_fim)
%>
<td><div class="botao2" id="cp<%=x%>"><a href="<%=aux_file%>?data=<%=x%>/<%=mes%>/<%=ano%>" target="miolo"><%=x%></a></div></td>
<%
if x =6 then response.write " </tr><tr align='center'>"
if x =13 then response.write " </tr><tr align='center'>"
if x =20 then response.write " </tr><tr align='center'>"
if x =27 then response.write " </tr><tr align='center'>"
if x mod 7 =0 and x <> 7 and x <> 13 and x <> 14 and x <> 21 and x <> 28 then response.write " </tr><tr align='center'>"
next
%>
<% case 3 %>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<%
for x = day(dia_ini) to day(dia_fim)
%>
<td><div class="botao2" id="cp<%=x%>"><a href="<%=aux_file%>?data=<%=x%>/<%=mes%>/<%=ano%>" target="miolo"><%=x%></a></div></td>
<%
if x =5 then response.write " </tr><tr align='center'>"
if x =12 then response.write " </tr><tr align='center'>"
if x =19 then response.write " </tr><tr align='center'>"
if x =26 then response.write " </tr><tr align='center'>"
if x mod 7 =0 and x <> 7 and x <> 14 and x <> 21 and x <> 28 then response.write " </tr><tr align='center'>"
next
%>
<% case 4 %>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<%
for x = day(dia_ini) to day(dia_fim)
%>
<td><div class="botao2" id="cp<%=x%>"><a href="<%=aux_file%>?data=<%=x%>/<%=mes%>/<%=ano%>" target="miolo"><%=x%></a></div></td>
<%
if x =4 then response.write " </tr><tr align='center'>"
if x =11 then response.write " </tr><tr align='center'>"
if x =18 then response.write " </tr><tr align='center'>"
if x =25 then response.write " </tr><tr align='center'>"
if x mod 7 =0 and x <> 7 and x <> 14 and x <> 21 and x <> 28 then response.write " </tr><tr align='center'>"
next
%>
<% case 5 %>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<%
for x = day(dia_ini) to day(dia_fim)
%>
<td><div class="botao2" id="cp<%=x%>"><a href="<%=aux_file%>?data=<%=x%>/<%=mes%>/<%=ano%>" target="miolo"><%=x%></a></div></td>
<%
if x =3 then response.write " </tr><tr align='center'>"
if x =10 then response.write " </tr><tr align='center'>"
if x =17 then response.write " </tr><tr align='center'>"
if x =24 then response.write " </tr><tr align='center'>"
if x mod 7 =0 and x <> 7 and x <> 14 and x <> 21 and x <> 28 then response.write " </tr><tr align='center'>"
next%>
<% case 6 %>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<%
for x = day(dia_ini) to day(dia_fim)
%>
<td><div class="botao2" id="cp<%=x%>"><a href="<%=aux_file%>?data=<%=x%>/<%=mes%>/<%=ano%>" target="miolo"><%=x%></a></div></td>
<%
if x =2 then response.write " </tr><tr align='center'>"
if x =9 then response.write " </tr><tr align='center'>"
if x =16 then response.write " </tr><tr align='center'>"
if x =23 then response.write " </tr><tr align='center'>"
if x =30 then response.write " </tr><tr align='center'>"
if x mod 7 =0 and x <> 7 and x <> 14 and x <> 21 and x <> 28 then response.write " </tr><tr align='center'>"
next%>
<% case 7 %>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<td><div class="botao2" id="branco"></div></td>
<%
for x = day(dia_ini) to day(dia_fim)
%>
<td><div class="botao2" id="cp<%=x%>"><a href="<%=aux_file%>?data=<%=x%>/<%=mes%>/<%=ano%>" target="miolo"><%=x%></a></div></td>
<%
if x =1 then response.write " </tr><tr align='center'>"
if x =8 then response.write " </tr><tr align='center'>"
if x =15 then response.write " </tr><tr align='center'>"
if x =22 then response.write " </tr><tr align='center'>"
if x =29 then response.write " </tr><tr align='center'>"
if x mod 7 =0 and x <> 7 and x <> 14 and x <> 21 and x <> 28 then response.write " </tr><tr align='center'>"
next%>
<%
end Select
%>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>