<?php
//require('connect.php');
//mysql_connect($dbroot,$dbuser,$dbpass);
//mysql_select_db('elizit_2015');
//$query = 'SELECT * FROM `termine`';
//$result = mysql_query($query);
$starttt = microtime(true);
if(!isset($_POST['year'])) {$year = date('o', time());} else {$year = $_POST['year'];}
if(!isset($_POST['week'])) {$week = date('W', time()); $month = date('m', time());} else {$week = $_POST['week'];}
$day = date('j', time());
//Kalender erzeugen
$monate_lang = array('Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember');
$monate_kurz = array('Jan','Feb','März','Apr','Mai','Juni','Juli','Aug','Sep','Okt','Nov','Dez');
$tage_lang = array('Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag');
$tage_kurz = array('So','Mo','Di','Mi','Do','Fr','Sa');
function zeigeKWDatum($kw, $jahr, $i)
{
$wtage = array(1,0,-1,-2,-3,3,2);
$w = date("w",mktime(0,0,0,1,1,$jahr));
$tage = ($kw-1)*7 + $wtage[$w];
$ts= mktime(0,0,0,1,1+$tage+$i,$jahr);
$datum = date("Y-m-d", $ts).'.';
return $datum;
}
for($i = 1; $i <=7; $i++){
$wochentag[] = $i;
if($i <= 6) {
$wd[$i] = zeigeKWDatum($week, date("Y"), $i-1);}
if($i == 7) {
$wd[$i] = zeigeKWDatum($week, date("Y"), $i-8);}
}
$so = $wd[7]; $so2 = substr($so,8,2).'.'; $week_start = strtotime($so); $year = date('Y',$week_start); $week_anz = date('W',$week_start);
$mo = $wd[1]; $mo2 = substr($mo,8,2).'.';
$di = $wd[2]; $di2 = substr($di,8,2).'.';
$mi = $wd[3]; $mi2 = substr($mi,8,2).'.';
$do = $wd[4]; $do2 = substr($do,8,2).'.';
$fr = $wd[5]; $fr2 = substr($fr,8,2).'.';
$sa = $wd[6]; $sa2 = substr($sa,8,2).'.'; $week_end = strtotime($sa);
$month_start = date('m',$week_start);
$month_end = date('m',$week_end);
if ($month_start == $month_end) {$month_text = $monate_lang[$month_end-1];}
if ($month_start < $month_end) {$month_text = $monate_lang[$month_start-1].' / '.$monate_lang[$month_end-1];}
if ($month_start > $month_end) {$month_text = $monate_lang[$month_start-1].' '.$year.' / '.$monate_lang[$month_end-1]; $year = $year+1;}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Kalender</title>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr height="50"><td align="left" style="padding-left:10px;"><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><input type="hidden" name="week" value="<?php echo $week-1; ?>"><input type="submit" name="sub_minus" value="<< zurück"></form></td><td colspan="6" align="center"><?php echo $month_text.' '.$year;?></td><td align="right" style="padding-right:10px;"><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><input type="hidden" name="week" value="<?php echo $week+1; ?>"><input type="submit" name="sub_plus" value="vor >>"></form></td></tr>
<tr height="40">
<td width="9%" rowspan="2" align="center" valign="middle"><?php echo 'Woche: '.$week_anz; ?></td>
<td width="13%" align="center">So <?php echo $so2; ?></td>
<td width="13%" align="center">Mo <?php echo $mo2; ?></td>
<td width="13%" align="center">Di <?php echo $di2; ?></td>
<td width="13%" align="center">Mi <?php echo $mi2; ?></td>
<td width="13%" align="center">Do <?php echo $do2; ?></td>
<td width="13%" align="center">Fr <?php echo $fr2; ?></td>
<td align="center">Sa <?php echo $sa2; ?></td>
</tr>
<tr height="200">
<td></td> Hier kommen dann die Termine aus der Datenbank rein
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
echo ($starttt-microtime(true))."s";
?>
- Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.35
- Parse error: syntax error, unexpected '<' in /in/01trZ on line 51
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected '<' in /in/01trZ on line 51
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error in /in/01trZ on line 51
Process exited with code 255.
preferences:
194.67 ms | 1395 KiB | 125 Q