arbejde med en database
hejjeg har et lille problem, jeg står og skal aflevere en kalender i morgen til et KOM/IT projekt i morgen, så det ville virkelig være perfekt hvis der var en som ville hjælpe mig lidt.
Jeg har denne kalender, men kan ikke se hvordan jeg skal få den til at arbejde sammen med databasen? - HJÆLP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Calendar</title>
<style type="text/css" media="all">
body {
background-color: #2A2A2A;
color: #EEEEEE;
font-family: Tahoma, Verdana, sans-serif;
font-size: 10px;
}
table {
width: 125px;
}
td {
padding: 1px;
border: 1px solid #666666;
text-align: center;
}
</style>
</head>
<body>
<?php
$thismonth = ( int ) date( "m" );
$thisyear = date( "Y" );
$numdaysinmonth = cal_days_in_month( CAL_GREGORIAN, $thismonth, $thisyear );
$jd = cal_to_jd( CAL_GREGORIAN, date( "m" ),date( 1 ), date( "Y" ) );
$startday = jddayofweek( $jd , 0 );
$monthname = jdmonthname( $jd, 1 )
?>
<table>
<tr>
<td colspan="7"><div align="center"><strong><?= $monthname ?></strong></div></td>
</tr>
<tr>
<td><strong>Søn</strong></td>
<td><strong>Man</strong></td>
<td><strong>Tir</strong></td>
<td><strong>ons</strong></td>
<td><strong>Tor</strong></td>
<td><strong>Fre</strong></td>
<td><strong>Lør</strong></td>
</tr>
<tr>
<?php
$emptycells = 0;
for( $counter = 0; $counter < $startday; $counter ++ ) {
echo "\t\t<td>-</td>\n";
$emptycells ++;
}
$rowcounter = $emptycells;
$numinrow = 7;
for( $counter = 1; $counter <= $numdaysinmonth; $counter ++ ) {
$rowcounter ++;
echo "\t\t<td>$counter</td>\n";
if( $rowcounter % $numinrow == 0 ) {
echo "\t</tr>\n";
if( $counter < $numdaysinmonth ) {
echo "\t<tr>\n";
}
$rowcounter = 0;
}
}
$numcellsleft = $numinrow - $rowcounter;
if( $numcellsleft != $numinrow ) {
for( $counter = 0; $counter < $numcellsleft; $counter ++ ) {
echo "\t\t<td>-</td>\n";
$emptycells ++;
}
}
?>
</tr>
</table>
</body>
</html>
