<!-- 
* Copyright (C) 2004 
* 
* Script que mostra dia, m�s por extenso e ano (selecionando os atuais) em 3 INPUTs SELECT
* Vers�o 0.1
* 15, Fevereiro, 2004
*
*	CHANGELOG
*
* - Nenhum registro. Primeira vers�o
*
* DO NOT DELETE COPYRIGHT TEXT BELOW 
* 
* Luiz Miguel Axcar (lmaxcar@yahoo.com.br) 
* http://www.geocities.com/lmaxcar 
* http://www.phpbrasil.com/profile.php/user/lmaxcar
* Campinas, S�o Paulo, Brasil 
* 55 19 9749 6970 
* The penguin never sleeps. 
* 
* Permission to use and modify this software and its 
* documentation for any purpose other than its incorporation 
* into a commercial product is hereby granted WITHOUT FEE, 
* as long as the AUTHOR IS NOTIFIED that this piece of software 
* is being used in other applications. 
* Permission to copy and distribute this software and its 
* documentation only for non-commercial use is also granted 
* without fee, provided, however, that the ABOVE COPYRIGHT 
* notice and the manual appear in all copies, that both that 
* copyright notice and this permission notice appear in supporting 
* documentation. The author makes NO REPRESENTATIONS about the 
* suitability of this software for any purpose.  It is 
* provided "as is", without express or implied warranty. 
* ALL MODIFICATIONS MUST BE SEND TO THE AUTHOR. 
-->

<?php
/*
//comente a matriz com meses em portugu�s e descomente esta para que os meses aparecam em ingl�s no select

	$matriz [] = "January";
	$matriz [] = "February";
	$matriz [] = "March";
	$matriz [] = "April";
	$matriz [] = "May";
	$matriz [] = "June";
	$matriz [] = "July";
	$matriz [] = "August";
	$matriz [] = "September";
	$matriz [] = "October";
	$matriz [] = "November";
	$matriz [] = "December";
*/

	$matriz [] = "Janeiro";
	$matriz [] = "Fevereiro";
	$matriz [] = "Mar�o";
	$matriz [] = "Abril";
	$matriz [] = "Maio";
	$matriz [] = "Junho";
	$matriz [] = "Julho";
	$matriz [] = "Agosto";
	$matriz [] = "Setembro";
	$matriz [] = "Outubro";
	$matriz [] = "Novembro";
	$matriz [] = "Dezembro";


// configurado por padr�o para mm/dd/YYY ... Recorte e cole se deseja alterar a ordem

	
	/* ****** MES ****** */	
	echo "<select name='mes'>";
	foreach($matriz as $chave => $valor)
	{
		$controle = $chave +1;
		
		if (date ('n') == ($controle))
		{
			echo "<option value='$controle' selected>$valor</option>";
		}
		else
		{
			echo "<option value='$controle'>$valor</option>";		
		}		
	}
	echo "</select>";
	/* ###### MES ###### */
	
	
	/* ****** DIA ****** */	
	echo "<select name='dia'>";
	for($i=1;$i<32;$i++)
	{
		$dia = (strlen($i)==1) ? '0'.$i : $i;
		
		if (date ('d') == ($dia))
		{
			echo "<option value='$dia' selected>$dia</option>";
		}
		else
		{
			echo "<option value='$dia'>$dia</option>";		
		}		
	}
	echo "</select>";
	/* ###### DIA ###### */
	
	
	//mostra ano corrente selecionado, com cinco anteriores e cinco posteriores. 
	/* ****** ANO ****** */	
	echo "<select name='ano'>";

	//mostrando cinco anos anteriores
	echo "<option value='".(date('Y')-5)."'>".(date('Y')-5)."</option>";
	echo "<option value='".(date('Y')-4)."'>".(date('Y')-4)."</option>";
	echo "<option value='".(date('Y')-3)."'>".(date('Y')-3)."</option>";
	echo "<option value='".(date('Y')-2)."'>".(date('Y')-2)."</option>";
	echo "<option value='".(date('Y')-1)."'>".(date('Y')-1)."</option>";
	
	//corrente selecionado
	echo "<option value='".(date('Y'))."' selected>".(date('Y'))."</option>";
	
	//mostrando cinco anos anteriores
	echo "<option value='".(date('Y')+1)."'>".(date('Y')+1)."</option>";
	echo "<option value='".(date('Y')+2)."'>".(date('Y')+2)."</option>";
	echo "<option value='".(date('Y')+3)."'>".(date('Y')+3)."</option>";
	echo "<option value='".(date('Y')+4)."'>".(date('Y')+4)."</option>";
	echo "<option value='".(date('Y')+5)."'>".(date('Y')+5)."</option>";
		
	echo "</select>";
	/* ###### ANO ###### */				 
?>