Egutegia euskaraz php lengoaian

eushacker 1456132452316 Webmasterren gunea | 2006-11-27 21:04



<table>
 <?PHP
$fontfamily = isset($fontfamily) ? $fontfamily : "Tahoma, Geneva, sans-serif";
$defaultfontcolor = isset($defaultfontcolor) ? $defaultfontcolor : "#00000000";
$defaultbgcolor = isset($defaultbgcolor) ? $defaultbgcolor : "#FFFFFF";
$todayfontcolor = isset($todayfontcolor) ? $todayfontcolor : "#FFFFFF";
$todaybgcolor = isset($todaybgcolor) ? $todaybgcolor : "#CC0000";
$monthcolor = isset($monthcolor) ? $monthcolor : "#333399";

$relfontsize = isset($relfontsize) ? $relfontsize : "1";
$cssfontsize = isset($cssfontsize) ? $cssfontsize : "8pt";

$month = (isset($month)) ? $month : date("n",time());
$monthnames = array("Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua");
$textmonth = $monthnames[$month - 1];
$year = (isset($year)) ? $year : date("Y",time());
$today = (isset($today))? $today : date("j", time()); ## Make $today really big to avoid hilite
$today = ($month == date("n",time())) ? $today : 32;
if ( (($month < 8) && ($month % 2 == 1)) || (($month > 7) && ($month % 2 == 0)) )
$days = 31;
if ( (($month < 8) && ($month % 2 == 0)) || (($month > 7) && ($month % 2 == 1)) )
$days = 30;
if ($month == 2)
$days = (date("L",time())) ? 29 : 28;

$dayone = date("w",mktime(1,1,1,$month,1,$year));
$daylast = date("w",mktime(1,1,1,$month,$days,$year));
?>
<table width="49%" border="1" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td bgcolor="#FFCC00" colspan="7" valign="middle" align="center"><font color="<?php echo $monthcolor ?>" face="Arial, Helvetica, sans-serif" size="3"><b><?PHP echo $textmonth ?></b></font></td>
</tr>
<tr>
<td width="7%" align="center" valign="middle" bgcolor="#FFFFFF"><span><font face="<?PHP echo $fontfamily ?>" size="1">Ig</font></span></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="7%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Al</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="7%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Ar</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="7%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Az</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="7%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Og</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="7%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Or</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="7%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Lb</b></font></td>
</tr>
<?PHP
if($dayone != 0)
$span1 = $dayone;
if(6 - $daylast != 0)
$span2 = 6 - $daylast;

for($i = 1; $i <= $days; $i++):
$dayofweek = date("w",mktime(1,1,1,$month,$i,$year));
$width = "7%";

if($dayofweek == 0 || $dayofweek == 6)
$width = "7%";

if($i == $today):
$fontcolor = $todayfontcolor;
$bgcellcolor = $todaybgcolor;
endif;
if($i != $today):
$fontcolor = $defaultfontcolor;
$bgcellcolor = $defaultbgcolor;
endif;

if($i == 1 || $dayofweek == 0):
echo " <tr bgcolor='$defaultbgcolor'>
";
if($span1 > 0 && $i == 1)
echo " <td align='left' bgcolor='$defaultbgcolor' colspan='$span1'><font face='null' size='1'>&nbsp;</font></td>
";
endif;
?>
<td bgcolor="<?PHP echo $bgcellcolor ?>" valign="middle" align="center" width="<?PHP echo $width ?>"><font color="<?PHP echo $fontcolor ?>" face="<?PHP echo $fontfamily ?>" size="1"><?PHP echo $i ?></font></td>
<?PHP
if($i == $days):
if($span2 > 0)
echo " <td align='left' bgcolor='$defaultbgcolor' colspan='$span2'><font face='null' size='1'>&nbsp;</font></td>
";
endif;
if($dayofweek == 6 || $i == $days):
echo " </tr>
";
endif;
endfor;
?>

</table>

Nork: miel.2006/11/27 21:02:37.695 GMT+1


Utzi iruzkina: