PHP-Logo
Druckansicht von http://www.php-homepage.de/scripts/source_69.html

PHP-Logo
[ Main Menue ]
Homepage
Downloads
Artikel
Scripts
Forum
PHP-Manual
Links
News
Freelancer
Bücher
RuDolF
Suche
Misc
Über diese Seite
Kontakt
Wunschzettel
MyGuestbook
*
[ Suche ]
*
[ Partner ]


Domain Webhosting
*
[ Partner Sites ]
Dynamic-Webpages
PHP-Center
PHP-Welt
phpUG.de
Random Link
*
[ Autoren gesucht! ]
PHP-Homepage.de sucht laufend Autoren für News und Artikel
Interesse?
*

Follow on Twitter - @phphomepage

RSS Feed blogoscoop

[Start] [Suche] [Neue Einträge

Kalender wie Windows-Kalender (Mehrsprachig)

// index.php4

<?PHP
// *******************************************************************
// (c) 2001 by Sebastian Lothary (Fireball88.de). All rights reserved.
// *******************************************************************
// this is a sample how you can use the calendar.lib
// *******************************************************************

include("calendar.lib.php4");

echo "<html>\n";
echo " <head>\n";
echo " <title>Calendar</title>\n";
echo " </head>\n\n";

// Cascading-Stylesheet for the visualisation
// ***************************************************
echo " <link rel=stylesheet type=\"text/css\" href=\"calendar.css\">\n\n";
// ***************************************************

echo " <body bgcolor=\"#FFFFFF\">\n";


// call the Calendar-Function, see library for
// defined parameters.
// *******************************************************************
wrCalendar($PHP_SELF, "eng", $d,$m,$y);
// *******************************************************************


echo " </body>\n";
echo "</html>\n";
?>

// calendar.css
<style>
--
body {margin:0px;}

a {font-size:10pt;font-family:Helvetica,Arial;text-decoration:none;color:#003399;}
a:hover {font-family:Helvetica,Arial;text-decoration:none;color:#FF0000;}

font {font-size:10pt;font-family:Helvetica,Arial;}

font.Calendar {font-size:8pt;font-family:Helvetica,Arial;font-weight:none;text-decoration:none;color:#000000;}
font.Calendar2 {font-size:10pt;font-family:Helvetica,Arial;font-weight:bold;text-decoration:none;color:#FFFFFF;}
a.Calendar {font-size:8pt;font-family:Helvetica,Arial;text-decoration:none;color:#336699;}
a.Calendar:hover {font-size:8pt;font-family:Helvetica,Arial;text-decoration:none;color:#FF0000;}
a.Calendar2 {font-size:8pt;font-family:Helvetica,Arial;text-decoration:none;color:#FFFFFF;}
a.Calendar2:hover {font-size:8pt;font-family:Helvetica,Arial;text-decoration:none;color:#FFFF00;}
a.Calendar3 {font-size:10pt;font-family:Helvetica,Arial;text-decoration:none;color:#FFFFFF;}
a.Calendar3:hover {font-size:10pt;font-family:Helvetica,Arial;text-decoration:none;color:#FFFF00;}
-->


// calendar.lib.php4

// ***************************************************
// (c) 2001 by Sebastian Lothary. All rights reserved.
// ***************************************************
// Function-library to show a calendar.
// ------------------------------------
// This library is freeware, don't delete
// copyright-informations!!!
// ***************************************************

// call calendar with parameters:
// $site = the site you have include this function,
// example: $PHP_SELF
// $lan = is the language of calendar
// "eng" = english
// "ger" = german
// for other languages please modifi function

// please dont't modifi this 3 variables ($d, $m, $y)
// $d = chosen day
// $m = chosen month
// $y = chosen year

// includingTag for the calendar.css
// location: after bevor
//

// Style-Sheet Example for the caledar.css
//

function wrCalendar($site, $lan, $d,$m,$y) {
// example for calling function
// wrCalendar($PHP_SELF, "eng", $d,$m,$y);


$showDay = $d;
$showMonth = $m;
$showYear = $y;

if (trim($showDay)=="") {
$showDay = date("d");
}

if (trim($showMonth)=="") {
$showMonth = date("m");
} else {
if (trim($showMonth)==13) {
$showMonth = 1;
$showYear++;
}

if (trim($showMonth)==0) {
$showMonth = 12;
$showYear--;
}
}

if (trim($showYear)=="") {
$showYear = date("Y");
}

settype ($showDay, "integer");
settype ($showMonth, "integer");
settype ($showYear, "integer");

// 01
$nowDay = date("d");

//12
$nowMonth = date("m");

//2001
$nowYear = date("Y");

settype ($nowDay, "integer");
settype ($nowMonth, "integer");
settype ($nowYear, "integer");

$totalDays = trim(date ("d", mktime(0,0,0,$nowMonth+1,1-1,$nowYear)));

$sMonth = trim(date ("F", mktime(0,0,0,$showMonth,1,$showYear)));
$sYear = trim(date ("Y", mktime(0,0,0,$showMonth,1,$showYear)));

$i = 1;

switch (trim(date ("D", mktime(0,0,0,$showMonth,1,$showYear)))) {
case "Mon":
$i = 1;
break;
case "Tue":
$i = 2;
break;
case "Wed":
$i = 3;
break;
case "Thu":
$i = 4;
break;
case "Fri":
$i = 5;
break;
case "Sat":
$i = 6;
break;
case "Sun":
$i = 7;
break;
}

switch (trim($lan)) {
case "eng":
$Mon = "Mon";
$Tue = "Tue";
$Wed = "Wed";
$Thu = "Thu";
$Fri = "Fri";
$Sat = "Sat";
$Sun = "Sun";
break;
case "ger":
$Mon = "Mo";
$Tue = "Di";
$Wed = "Mi";
$Thu = "Do";
$Fri = "Fr";
$Sat = "Sa";
$Sun = "So";
switch (trim($sMonth)) {
case "January":
$sMonth = "Januar";
break;
case "February":
$sMonth = "Februar";
break;
case "March":
$sMonth = "M&auml;rz";
break;
case "April":
$sMonth = "April";
break;
case "May":
$sMonth = "Mai";
break;
case "June":
$sMonth = "Juni";
break;
case "July":
$sMonth = "Juli";
break;
case "August":
$sMonth = "August";
break;
case "September":
$sMonth = "September";
break;
case "October":
$sMonth = "Oktober";
break;
case "November":
$sMonth = "November";
break;
case "December":
$sMonth = "Dezember";
break;

}
break;
default:
$Mon = "Mon";
$Tue = "Tue";
$Wed = "Wed";
$Thu = "Thu";
$Fri = "Fri";
$Sat = "Sat";
$Sun = "Sun";
}


echo " \n";
echo " \n";
echo " \n";
echo " \n";
echo " \n";
echo " \n";

echo " \n";
echo " \n";
echo " \n";
echo " \n";
echo " \n";
echo " \n";
echo " \n";
echo " \n";
echo " \n";

$i--;

echo " \n";
echo " \n";
}

switch (trim(trim($Day).".".trim($showMonth).".".trim($showYear))) {
case trim(trim($showDay).".".trim($showMonth).".".trim($showYear)):
echo " \n";
break;
case trim(trim($nowDay).".".trim($nowMonth).".".trim($nowYear)):
echo " \n";
break;
default:
echo " \n";
}

if ($i==7) {
$i = 0;
echo " \n";
}

$Day++;
$i++;
}

switch ($i) {
case 1:
break;
case 2:
echo " \n";
break;
case 3:
echo " \n";
break;
case 4:
echo " \n";
break;
case 5:
echo " \n";
break;
case 6:
echo " \n";
break;
case 7:
echo " \n";
break;
}
echo " \n";

$LastMonth = $showMonth-1;
$NextMonth = $showMonth+1;

echo " \n";
echo " \n";
echo " \n";
echo " \n";

echo"
$sMonth$sYear
$Mon$Tue$Wed$Thu$Fri$Sat$Sun
\n";

$i++;
$Day = 1;
while ($Day <= $totalDays) {
if ($i==1) {
echo "
$Day$Day$Day
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;&lt;&gt;&gt;
\n";
echo " \n";
}
?>
© Copyright 1999 - 2011 by Mark Kronsbein | Impressum | NutzungsbedingungenWeiterempfehlen | Seitenanfang
0.3727